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...

happygeek commented: and you posted a PHP tech help question in a forum that has nothing to do with PHP and doesn't answer support questions why? +0

Recommended Answers

All 3 Replies

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']; } ?>">

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

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';
}
?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.