Summary of error prone in PHP programming
this article makes a summary of errors in PHP programming, hoping the novice can avoid it!
1: why I can't get the variable
name on one web page to another page, POST data name. Why don't you get any value when you output $name?
if you want to get a variable from another page in a later version of PHP4.2: Find register_global and set it to on.
method two: put this extract ($_POST) at the front of the receiving page; extract ($_GET); (notice extract ($_SESSION) must have Session_Start ()).
method three: one reads variable $a=$_GET[.quot; Troublesome, but safer.
2: debug your program
at runtime you must know the value of a variable. I do this to establish a document debug.php, with the following contents:
[code]Ob_Start ();
Session_Start ();
Echo.Quot;.Lt; pre.gt;.Quot; Print_R ($_POST);
Echo.Quot; the _COOKIE variable on this page is.Quot;
Print_R ($_COOKIE); .quot; c:/php.quot; and put debug.php in this folder, after
, you can include this file in every web page to see the variable name and value.