firefly2442 0 Posted May 10, 2003 Share Posted May 10, 2003 Ok, so I'm trying to get a variable from a url string... for example.... www.mywebsite.com/test.php?HelloWorld so my code is.... <?php $thetext = $QUERY_STRING; echo $thetext; ?> But it doesn't work! Anybody know? Thanks in advance. Quote Link to post Share on other sites
Super-Bob 0 Posted May 10, 2003 Share Posted May 10, 2003 You would think I know php, wouldn't you? Quote Link to post Share on other sites
Urban_Tiger 0 Posted May 10, 2003 Share Posted May 10, 2003 Have you tried small things like no spaces between characters and the = etc ?? example off here for instance...... ;<a href='http://www.ghostrecon.net/forums/index.php?act=Search&CODE=getnew'>View New Posts</a> Quote Link to post Share on other sites
Super-Bob 0 Posted May 10, 2003 Share Posted May 10, 2003 That's a URL, not code. Quote Link to post Share on other sites
RooK 0 Posted May 10, 2003 Share Posted May 10, 2003 Try print instead of echo Quote Link to post Share on other sites
Urban_Tiger 0 Posted May 10, 2003 Share Posted May 10, 2003 (edited) yes, well done super bob rofl ...... hence it says it's an example of the no spacing between when using = in php ....... As in...... first instance=second instance or so on and so forth lol!!!!! The url is irrelevant and also why it is ;charactered out as well or it would have activated as a url, it was there as an example of trying it with no spacings around the = as often it can make a difference ! Edited May 10, 2003 by Urban_Tiger Quote Link to post Share on other sites
Dannik 43 Posted May 10, 2003 Share Posted May 10, 2003 But it doesn't work! Anybody know? Thanks in advance. I just tested your code, and it worked correctly. Is there, by some slim chance, the possiblity that your webhost isn't configured properly for PHP? Quote Link to post Share on other sites
firefly2442 0 Posted May 10, 2003 Author Share Posted May 10, 2003 Hmmmmm... maybe I need to tweak a setting in the php configuration. It works eh? I'll check it out. Thanks for the help guys. Quote Link to post Share on other sites
firefly2442 0 Posted May 10, 2003 Author Share Posted May 10, 2003 I had Register_Globals set to OFF so that's why it wasn't working. This code worked... woohoo, problem solved. <?php $page = $_GET['page']; echo $page; ?> With URL; www.mywebsite.com/test.php?page=1 it displays '1' on the screen. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.