FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free 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.
Related topics
PHP Help Needed
Google's Secret Revealed
php SESSIONS question
Need Help integrating php variable into mySQL SELECT query
PHP Image functions
problem with get variables!
Problems with Dynamic URLs
.htaccess SEF urls
HTML Single link to open multiple pages
PHP load array from $_POST
How Can I Remove Unwanted URLs From Google Search Result?
Allow links for hosters only
Only www subdomain of subdomain loads
Firefox Addons Used
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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