dieselserpent Posted July 22, 2009 Share Posted July 22, 2009 I keep getting this error on the code below and I'm just not seeing it anybody got any ideas? Parse error: syntax error, unexpected T_VARIABLE in /home/a7232973/public_html/phptroubleshooting.php on line 9 <?php //adder.php if (isset($_POST['num1'])) { $num1 = $_POST['num1']; $num2 = $_POST['num2']; $myTotal -= $num1 + $num2; print "<h2 align=center>You added <font color=blue>". $num1 ."</font> and "; print "<font color=blue>" . $num2 . "</font> and the answer is <font color=red>" $myTotal ."</font>!"; unset($_POST['num1']); unset($_POST['num2']); print "<br /><a href=" . $_SERVER['PHP_SELF']; . ">Reset page</a>"; }else{ ?> <html> <body> <h1 align="center">Adder.php</h1> <form action="<?php print $_SERVER['PHP_SELF']; ?>"> Enter the first number:<input type="text" name="num1"><br /> Enter the second number:<input type="text" name="num2"><br /> <input type="submit" value="Add Em!!"> </form> </body> </html> <?php { ?> Link to comment https://forums.phpfreaks.com/topic/166887-solved-little-help-for-someone-new-to-php/ Share on other sites More sharing options...
samshel Posted July 22, 2009 Share Posted July 22, 2009 print "<font color=blue>" . $num2 . "</font> and the answer is <font color=red>" $myTotal ."</font>!"; should be print "<font color=blue>" . $num2 . "</font> and the answer is <font color=red>".$myTotal ."</font>!"; error shows the line number Link to comment https://forums.phpfreaks.com/topic/166887-solved-little-help-for-someone-new-to-php/#findComment-879940 Share on other sites More sharing options...
dieselserpent Posted July 22, 2009 Author Share Posted July 22, 2009 Thanks a lot I find my self getting tunnel vision on some these troubleshooting issues. Link to comment https://forums.phpfreaks.com/topic/166887-solved-little-help-for-someone-new-to-php/#findComment-879942 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.