View Single Post

  #1 (permalink)  
Old 01-10-2004
L.Ray
 
Posts: n/a
Default Transferring variables from form to php

I'm trying to pass data from an HTML form to PHP. Later, I'll 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.
..., ..
Reply With Quote