This is a discussion on Problems with PHP and forms within the PHP General forums, part of the PHP Programming Forums category; I'm trying to pass data from an HTML form to PHP. Later, I write the data to a database. ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm trying to pass data from an HTML form to PHP. Later, I write the
data to a database. Please look at this simple html form, php code, and the output and tell me what I'm doing wrong. Thanks in advance: <!-- Sample.html --> <html> <body> <form action="simple.php" method="POST" > Name: <input type="text" name="wName" size="20"><br> Email: <input type="text" name="wEmail" size="20"><br> <input type="submit" value="submit" name="submit"> </form> </body> </html> <!-- simple.php --> <HTML> <body> <?php if (!$wName || !$wEmail ) { echo "You have not entered all the required details.<br>" ."Please go back and enter data in all fields.<br>"; echo ".$wName., .$wEmail."; exit; } ?> </body> </HTML> <!-- here is the output from the above code --> You have not entered all the required details. Please go back and enter data in all fields. ..., .. |