podja Posted January 2, 2008 Share Posted January 2, 2008 Hi, This is the code I am using but it doesn't seem to be working: <input name="name" type="text" value="<?php if(isset($name)) { echo $name; } ?>" /> Please correct me. Quote Link to comment https://forums.phpfreaks.com/topic/84117-solved-if-there-is-an-error-in-the-form-echo-the-correct-data-into-the-input-boxes/ Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 And you verified $name has some type of value or data in it? Quote Link to comment https://forums.phpfreaks.com/topic/84117-solved-if-there-is-an-error-in-the-form-echo-the-correct-data-into-the-input-boxes/#findComment-428170 Share on other sites More sharing options...
podja Posted January 2, 2008 Author Share Posted January 2, 2008 yes Quote Link to comment https://forums.phpfreaks.com/topic/84117-solved-if-there-is-an-error-in-the-form-echo-the-correct-data-into-the-input-boxes/#findComment-428176 Share on other sites More sharing options...
revraz Posted January 2, 2008 Share Posted January 2, 2008 That line should work and so should this <input name="name" type="text" value="<?php echo $name; ?>" /> So the problem must be where you assign $name from $_POST['name'] Are you doing it before the form? Post the whole code if you want. Quote Link to comment https://forums.phpfreaks.com/topic/84117-solved-if-there-is-an-error-in-the-form-echo-the-correct-data-into-the-input-boxes/#findComment-428177 Share on other sites More sharing options...
trq Posted January 2, 2008 Share Posted January 2, 2008 What does doesn't seem to be working actually mean? No output? Can we see where $name is defined? Quote Link to comment https://forums.phpfreaks.com/topic/84117-solved-if-there-is-an-error-in-the-form-echo-the-correct-data-into-the-input-boxes/#findComment-428181 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.