To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
I'm in the process of learning PHP. I've set up PHP4 on my dev machine currently running Win98. I'm fairly solid with ASP but want the cross platform and open source benefits of PHP.
Set up of PHP4 and mySQL seemed to go fine. Hello World worked fine. However, when I decided to pass some info from one page to another I ran into problems.
The output from the following code doesn't include the parameter passed from a form on the previous page although I'm sure it should.
<?php
echo ("<p>Thankyou " .$FName. "We appreciate your time</p>");
?>
All I get is
Thankyou We appreciate your time.
Any thoughts ? The PHP is obviously being processed. I copied some Wrox code and that does exactly the same i.e. is processed but ignores what I would term the QueryString data.
Check these sections of your php.ini file. They control the HTTP_*_VARS and whether you can take the shortcut using just $fName. I believe I read they were phasing the shortcut out.
register_globals = Off
"Whether or not to register the EGPCS variables as global variables. You may want to turn this off if you don't want to clutter your scripts' global scope with user data. This makes most sense when coupled with track_vars - in which case you can access all of the GPC variables through the $HTTP_*_VARS[], variables."
register_argc_argv = Off
"This directive tells PHP whether to declare the argv&argc variables (that would contain the GET information). If you don't use these variables, you should turn it off for
increased performance"
track_vars = On
"enable the $HTTP_*_VARS[] arrays, where * is one of ENV, POST, GET, COOKIE or SERVER."
If I'd read the ini file notes properly I would have solved this in two seconds flat. Sorry if I've wasted anyones time.....
"; - register_globals = Off
; Global variables are no longer registered for input data (POST, GET, cookies,
; environment and other server variables). Instead of using $foo, you must use
; $HTTP_POST_VARS["foo"], $HTTP_GET_VARS["foo"], $HTTP_COOKIE_VARS["foo"],
; $HTTP_ENV_VARS["foo"] or $HTTP_SERVER_VARS["foo"], depending on which kind
; of input source you're expecting 'foo' to come from.