I am a beginner in php. how can I transfer the values of these two pages ??? 1. php & lt; tablewidth & quot; 208 & quot; border & quot; 1 & quot; align & quot; center & quot; cellpadding & quot; 0 & quot; cellspacing & quot; 0 & quot; & gt; & nbsp; & lt php value passing
I am a beginner in php. how can I transfer the values of these two pages ???
1. php
2. php
$ _ POST [username] = $ username; // Get the submitted variable value
$ _ POST [grade] = $ grade;
If ($ Submit = "Submit "){
Echo "player". $ _ POST [username]."
";
Echo "score". $ _ POST [grade]."
";
If ($ grade> 70)
Echo "you win! ";
If ($ grade <90) {echo "you lost! ";}
If ($ grade> 88) {echo "Congratulations! ";}
Else {
Echo "try again next time! ";
}
If ($ grade <60)
Echo "you are too bad! ";
Elseif ($ grade> 70 & $ grade <88)
Echo "normal level! ";
Elseif ($ grade> 88 & $ grade <99)
Echo "very good technology! ";
Else
Echo "very good technology! ";
}
?>
------ Solution --------------------
You reversed it, no
$ _ POST [username] = $ username; // Get the submitted variable value
$ _ POST [grade] = $ grade;
Instead
$ Username = $ _ POST [username];
$ Grade = $ _ POST [grade];
$ _ POST is a special array. all submitted data is placed in it. do not assign values to it.
------ Solution --------------------
Discussion
You reversed it, no
$ _ POST [username] = $ username; // Get the submitted variable value
$ _ POST [grade] = $ grade;
Instead
$ Username = $ _ POST [username];
$ Grade = $ _ POST [grade];
$ _ POST is a special array. all submitted data is placed in it. do not assign values to it.