Php/MySQL/Apache problems, too, but different

Squintel

Registered
I have installed the above on a TiBook and I am getting inconsistent behavior. I cannot get examples from the book "Php and MySql Web Development" to pass variables from one browser page to the next. The error checking code in page two is the first instruction. It says "if not variable, then state it." Page 2 never receives the variable. I don't even get to the data query.

What I have done to troubleshoot:
• Chown to root, all users;
• Chmod 777 for Directory and all Files;
• Typed out my own code in BBEdit (Quadruple-checked spelling);
• Used examples pages off CD-Rom (included with book);
• Entered variables via URL string (still no result);
• Restarted apache :)
• Tested using IExplorer and Netscape;

When I ran php_info(), I noticed under the Apache section that the Request_Method is set to "Get". Is that set properly or is it somehow disallowing the post action in the form?


The odd thing is that when I downloaded the phpbb forum application and installed it, it works Great!


Many thanks to anyone who can point me in the right direction.
Ciao.
 
This is probably due to a change introduced in PHP 4.2 and later. Things like post, get, server and global variables are now stored in separate arrays. If you have a get variable (in the URL string) named $foo, try accessing it as $_GET[foo] and see what happens. Same goes with a post variable, but you would use $_POST[foo]. To turn this off, open your /usr/local/lib/php.ini and add the line "register_globals=on" then run the command "sudo apachectl graceful" to change the configuration and restart the server. More information is available at http://www.php.net/manual/en/language.variables.predefined.php.
 
Back
Top