Hi, I'm trying to help a client who wants to host their own site & just installed php on their web server. I gave them all the files for their site, which works at 2 independent hosts. However, their setup seems to be unable to read variables passed in the URL string.
For example, the URL might be http://www.test.com/test.php?thisvar=20 but when I reference $thisvar in the code within test.php, it doesn't have a value.
Is there something they need to do w/ their configuration to allow passing variables?
Thanks for your help!
[SOLVED] configuring php - can't read url variables
Moderator: General Moderators
some us some code....but do you have it $_GET['thisvar'] to reference the variable??
Code: Select all
if($_GET['thisvar'] == 20)
{
echo 'worked;
}
else
{
echo 'nope not going todo it';
}well, his problem is that he's not using $_GET at all, so $thisvar is not even being assigned a value.
so, he should have
so, he should have
Code: Select all
if($_GETї'thisvar'] != '')
{
$thisvar = $_GETї'thisvar'];
echo $thisvar;
}
else
{
echo 'Nothing was set';
}