: I just installed php 4 on apache 2 but I cant get this example to run. It gives the error
: Notice: Undefined variable: frmName in c:\program files\apache group\apache\htdocs\test.php on line 4
: Here's my code (test.php) I have no idea what could be wrong. Someone suggested looking at a config file but I dont know what to do with that.
:
: <html>
:
: <?php
: if(!$frmName)
: {
:
: // Switch to HTML mode to display form
: ?>
: <form action="test.php" method="post">
: Name:
: <input type="text" name="frmName" size="24">
: <input type="submit" value="Submit">
: <?php
: }else{
: ?>
: Hello <?php echo($frmName); ?>
: !
: <?php
: }
: ?>
:
: </html>
:
:
It should be something like this:
if (isset($_POST['frmName']))
But I still don't see the purpose or what you want to achieve with this code? You want the user to enter his/her name and then click the Submit button, right? And then display his/her name. Am I correct?