Jump to content
Ghost Recon.net Forums

Recommended Posts

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. :D

Link to post
Share on other sites

yes, well done super bob rofl :P ......

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 by Urban_Tiger
Link to post
Share on other sites
But it doesn't work! Anybody know? Thanks in advance. :D

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?

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...