FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Urls into variables

 


janszmatt
i have a site

www.mysite.com/index.php?email=something@wat.com


how do i get the email places into a variable

is it like this?



Code:
$sentto=urlemail


or something else???
yjwong
Basically just use the $_GET array. To access to specified value on the URL, just use $_GET["email"].
hexkid
janszmatt wrote:
i have a site

www.mysite.com/index.php?email=something@wat.com


how do i get the email places into a variable

is it like this?



Code:
$sentto=urlemail


or something else???


When your PHP script gets control, the parameters in the request string are already in a variable. This variable is the predefined superglobal array $_GET.
rohan2kool
janszmatt wrote:

is it like this?



Code:
$sentto=urlemail


or something else???


to use it directly, you have to set register_globals as 'on' in php.ini, but that isn't recommended for security and portability purposes. As for ur query, hexkid and yjwong have already cleared it Very Happy
tony
frihost servers have register_globals turned off (which is good). you need to use...

Code:
$sentto = $_GET['urlemail'];


hope that helps.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.