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. 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? 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 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. 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? 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
Archived
This topic is now archived and is closed to further replies.