Hi, I have setup WAMP and have created a very simple form: <?php if (isset($_POST['submit'])) { $firstname = $_POST['firstname']; $surname = $_POST['surname']; if ($firstname == ''){ print 'Enter a first name'; } else{ if ($surname == ''){ print 'Enter a surname'; } else{ die('You filled out the form'); } } } ?> <form action="test.php" method="post"> First Name: <input name="firstname" type="text" value="<?php print $_POST['firstname']; ?>"><br> Surname: <input name="surname" type="text" value="<?php print $_POST['surname']; ?>"> <input name="submit" type="submit" value="Submit"> </form> Code (markup): I get an error message in the text boxes on wamp, but not if I uploadt the file to a webserver. Is there a setting on wamp that is wrong? Thanks in advance.
I get: <br /><b>Notice</b>: Undefined index: surname in <b>C:\wamp\www\eurogrant - PHP\test.php</b> on line <b>24</b><br /> etc...
Thanks Bohra, Could someone else test it in WAMP and maby tell me what settings I may need to change. Cheers.
Well, see it gives that error when you havn't submitted the form.. in that case it cant enter a default "value" in the surname field since there is nothing. try changing that to It prolly doesn't show you the error on your hosting, prolly saves it in an error_log file