hmvrulz Posted October 23, 2008 Share Posted October 23, 2008 Values in the text filed <br /> <b>Notice</b>: Undefined index: fname in <b>C:\Program Files\wamp\www\fw\views\users\registration.html</b> on line <b>4</b><br /> heres the form registration.html <form action="./register/" method="post" name="registration"> <div>First Name:</div> <div> <input type="text" name="fname" size="25" maxlength="25" value="<?php echo $_POST['fname']; ?>" /> </div> <div>Last Name:</div> <div> <input type="text" name="lname" size="25" maxlength="25" value="<?php echo $_POST['lname']; ?>" /> </div> <div>Username:</div> <div> <input type="text" name="username" size="25" maxlength="25" value="<?php echo $_POST['username']; ?>" /> </div> <div>Password:</div> <div> <input type="password" name="password1" size="25" maxlength="50" value="<?php echo $_POST['password1']; ?>" /> </div> <div>Retype Password:</div> <div> <input type="password" name="password2" size="25" maxlength="50" value="<?php echo $_POST['password2']; ?>" /> </div> <div>Email:</div> <div> <input type="text" name="email" size="25" maxlength="50" value="<?php echo $_POST['email']; ?>" /> </div><br/> <div><input name="submit" type="submit" value="Register"><input name="reset" type="reset" value="Reset"></div> </form> When ppl go to http://localhost/fw/users/new/ then the registration.html form is included. and as values am getting the above content. When ppl go to http://localhost/fw/users/register/ the same page is loaded if there are errors in the fill up or the user is present already with username or same email. Link to comment https://forums.phpfreaks.com/topic/129755-php-forum-value/ Share on other sites More sharing options...
Orio Posted October 23, 2008 Share Posted October 23, 2008 The problem is that these values don't exist unless a form submission was made. You have to make sure that what you're echoing exists, IE: <?php if(isset($_POST['fname'])) echo $_POST['fname']; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/129755-php-forum-value/#findComment-672731 Share on other sites More sharing options...
hmvrulz Posted October 23, 2008 Author Share Posted October 23, 2008 Thanks GUYS.... Any other way to write my html form ? Link to comment https://forums.phpfreaks.com/topic/129755-php-forum-value/#findComment-672766 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.