Here is the right code
 
<?php // Print a greeting if the form was submitted
if ($_POST['user']) {
    print "Hello, ";
    // Print what was submitted in the form parameter called 'user'
    print $_POST['user'];
    print "!";
} else {
    // Otherwise, print the form
    print "
<form method='post' actionfiltered='$_SERVER[PHP_SELF]'>
Your Name: <input type='text' name='user'>
<br/>
<input type='submit' value='Say Hello'>
</form>";
}
?>

aLT WiZard <[EMAIL PROTECTED]> wrote:
Hey,
Plz tell me whats wrong in this code.
<?php // Print a greeting if the form was submitted
if ($_POST['user']) {
    print "Hello, ";
    // Print what was submitted in the form parameter called 'user'
    print $_POST['user'];
    print "!";
} else {
    // Otherwise, print the form
    print <<<_HTML_
<form method="post" action="">
Your Name: <input type="text" name="user">
<br/>
<input type="submit" value="Say Hello">
</form>
_HTML_;
}
?>

I get a blank white page, Im guessing there is something wrong in the else statement, Is this the right way to put HTML and PHP together in a print statement ???

Thanks.


Find out what India is talking about on Yahoo! Answers India.
So, whatÂ’s NEW about the NEW Yahoo! Messenger? Find out. __._,_.___


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to