PHP Help

I'm new to PHP and I can't get this simple script to run - it gives an
error on line 31. What am I doing wrong?



$message = "";

if ( ! isset( $_POST['guess'] ) ) {
$message = "This is an if/then, loop program.";
} else if ( $_POST['guess'] > 101 ) {
$message = $_POST['guess']." is too big!";
} else {
for ($i = 1; $i <= $_POST['guess']; $i++ ) {
$message = "Number $i\n";


<title>If/Then, Loop Program</title>
<body><basefont face="verdana">
<?php print $message ?>
<form method="post" action="<?php print $_SERVER['PHP_SELF']?>">
Type a number: <input type="text" name="guess" />
<input type="submit" value="submit" />


Relevant Pages

    ... php classified script ... guestbook ardguest free php guestbook script ... php file upload script ...
  • Re: [PHP] PHP console script vs C/C++/C#
    ... My script is taking a longer time to execute than I want. ... I prefer to write in PHP because that is what I know best. ... This is why I am thinking about rewriting my whole script in a C language. ... Perhaps there are different methods I could be using to speed up execution. ...
  • Re: How to Add a Feeback Form
    ... I saw nothing in that script that indicates where the form is e-mailed to so ... Greg Maxey/Word MVP ... PHP or not. ... have the support available yet. ...
  • How best to show PHP source? (was: One page, multiple submit buttons)
    ... script to add to the top of a PHP script to enable showing its ... Maybe anybody submitting their own PHP code for critique here ... Anything posted to a newsgroup is a "snapshot" of what the ... there ought to be a FAQ for this ...
  • Email form script
    ... I have a web form that posts to a .php ... who cannot run .php on their server. ... Or does anyone have a .asp script that will ... Thank you for choosing FormToEmail by ...