We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,355 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Textfield empty after submitting the form

i am a new to php.i am having a trouble that whenever i typed a wrong username in the textfield the field goes blank after its submission...I need the field values there such i need not want to insert the textfield value again.so how can i avoid such problem...i appreciate any help...

2
Contributors
3
Replies
1 Week
Discussion Span
1 Year Ago
Last Updated
4
Views
Question
Answered
bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: 4
Solved Threads: 1
Skill Endorsements: 0

In the value of each form field you need to echo the posted data, for example

<input type="text" name="username" value="<?php if (isset($_POST['username'])) { echo $_POST['username']; } ?>">
simplypixie
Practically a Master Poster
642 posts since Oct 2010
Reputation Points: 157
Solved Threads: 118
Skill Endorsements: 5

i am a new to php.i am having a trouble that whenever i typed a wrong username in the textfield the field goes blank after its submission...I need the field values there such i need not want to insert the textfield value again.so how can i avoid such problem...i appreciate any help...

thanks for the help...it really helped me a lot...it solved ma problem

bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: 4
Solved Threads: 1
Skill Endorsements: 0
Question Answered as of 1 Year Ago by simplypixie

thanks for the help...it really helped me a lot...it solved ma problem

i got the answer
<?php
if(isset($_get))&&($_get==' ')
{
echo 'userfield is blank';
}
?>

bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: 4
Solved Threads: 1
Skill Endorsements: 0

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0859 seconds using 2.69MB