rbvinc Posted July 14, 2007 Share Posted July 14, 2007 I am trying to do the following, instead results, I am getting blank screen. Can somebody please advise me. I have two files below, form-calc.php, calculate2.php Thanks, /// form-calc.php, <HTML> <HEAD> <TITLE>Calculation Form</TITLE> </HEAD> <BODY> <FORM METHOD="post" ACTION="calculate2.php"> <P>Value 1: <INPUT TYPE="text" NAME="val1" SIZE=10></P> <P>Value 2: <INPUT TYPE="text" NAME="val2" SIZE=10></P> <P>Calculation:<br> <INPUT TYPE="radio" NAME="calc" VALUE="add"> add<br> <INPUT TYPE="radio" NAME="calc" VALUE="subtract"> subtract<br> <INPUT TYPE="radio" NAME="calc" VALUE="multiply"> multiply<br> <INPUT TYPE="radio" NAME="calc" VALUE="divide"> divide</P> <P><INPUT TYPE="submit" NAME="submit" VALUE="Calculate"></P> </FORM> </BODY> </HTML> // filetwo - calculate2.php <?php if (($_POST[val1] == "") || ($_POST[val2] == "") || ($_POST[calc] == "")) { header("Location: calculate_form.html"); exit; } if ($_POST[calc] == "add") { $result = $_POST[val1] + $_POST[val2]; } else if ($_POST[calc ] == "subtract"){ $result = $_POST[val1] - $_POST[val2]; } else if ($_POST[calc ] == "multiply"){ $result = $_POST[val1] * $_POST[val2]; } else if ($_POST[calc ] == "divide"){ $result = $_POST[val1] / $_POST[val2]; } ?> <HTML> <HEAD> <TITLE>Calculation Result</TITLE> </HEAD> <BODY> <P>The result of the calculation is: <? echo $result; ?></p> </BODY> </HTML> Quote Link to comment Share on other sites More sharing options...
AndyB Posted July 14, 2007 Share Posted July 14, 2007 I am getting blank screen. Absolutely nothing displayed at all? All of your $_POST[xyz] should be $_POST['xyz'] Quote Link to comment Share on other sites More sharing options...
rbvinc Posted July 14, 2007 Author Share Posted July 14, 2007 I tried what you said 'xyz', no luck still blank screen. Quote Link to comment Share on other sites More sharing options...
rbvinc Posted July 14, 2007 Author Share Posted July 14, 2007 Continuing on previous reply, I tried northwind access database, it works fine with php (windows 2000/access 2000/php), I tried <?php phpinfo() ?>, this works fine. Only the above email problem, and mysql connection. I cannot connect thru php, but I can see dbs, tables, thru 'navicat' mysql editor. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.