Page 1 of 1

need help !

Posted: Sat Nov 23, 2002 2:49 pm
by swouxhall
ok, i am not a very good programmer, but i've used PHP+MySQL+omniHTTPd for
designing my web pages.
here is the problem-

- i have installed everything above.
it just can use "GET_VARS" or something, because i have this little script
(test.php):

<?
echo $a;
$a=123;
echo $a;
?>

ok, i start IE, hit "localhost", it displays 123, but if i assign to "a"
something like a=adadada, it doesen't get the values, still displays
123....what i've done wrong, everything is setup as ussual, i've tryed
Apache instead of omnihttpd, still nothing......

please help me on this one....! :(

Posted: Sat Nov 23, 2002 5:33 pm
by volka
if you're just testing php edit your php.ini, search and set the following properties.
error_reporting = E_ALL
display_errors = On
does this output any error?
a=adadada
that's supposed to be a stringliteral so you have to quote it, read http://www.php.net/manual/en/language.types.string.php to learn more about this.


also add

Code: Select all

echo date('D M j G:i:s T Y');
to your script to check wether this a caching problem

Posted: Mon Nov 25, 2002 3:00 am
by twigletmac
Are you trying to access a from the URL? If so then you need to edit your script to something like below in order to test it:

Code: Select all

&lt;?php
$a = (!empty($_GET&#1111;'a'])) ? $_GET&#1111;'a'] : 123;
echo $a;
?&gt;
This does depend a bit on your PHP version though, so if you have PHP version 4.0.6 or less you would need to use $HTTP_GET_VARS instead of $_GET.

Mac