I'm having an odd little php problem... I just installed PHP and Apache2 on a second Linux box, and everything seemed to be working fine (ie: phpnuke works flawlessly), but when I put a calculator script on it, it didn't work (It did work on my other Linux webserver). I made a VERY simple script to just take a couple inputs and output a result, but it fails - the variables are not being passed back to the script after the HTML submit.
Here's the simple script:
PHP Code:
<HTML>
<HEAD><TITLE>Simple Script</TITLE>
<BODY><?php
echo "<B>voltage calc</B>";
echo "<P><P>";
echo "Enter the following info:<P>";
echo "<FORM METHOD=\"POST\" ACTION=\"$PHP_SELF\">";
echo "<BR>resistance:<INPUT NAME=\"r\" TYPE=\"text\">";
echo "<BR>current:<INPUT NAME=\"i\" TYPE=\"text\">";
echo "<P><INPUT TYPE=\"submit\" name=\"submit\" value=\"Calculate!\"></FORM>";
echo "<P>Submit: $submit r=$r i=$i"; // dump out the vars
if($submit)
{
$result = $i*$r;
echo "Result is: $result";
}
?></BODY><HTML>
Again, this script works on one machine (Apache/2.0.44 (Unix) PHP/4.3.3), but not on the other (Apache/2.0.48 (Gentoo/Linux) PHP/4.3.4 ). The script "runs", but it is simply not getting the variables.
Any thoughts?
Thanks