Pi_Mastuh Posted December 3, 2006 Share Posted December 3, 2006 How do you make the forms that already have data in them? I'm making a change user info page and I'd like the form to have their current info already so it's easier to change. Quote Link to comment Share on other sites More sharing options...
chiprivers Posted December 3, 2006 Share Posted December 3, 2006 you can specify default text in a form field by using value="blah"ie.[code]<input type="text" name="username" value="JoeBloggs">[/code] Quote Link to comment Share on other sites More sharing options...
Pi_Mastuh Posted December 3, 2006 Author Share Posted December 3, 2006 But if it's in an html page it will just end up saying Name: $name Quote Link to comment Share on other sites More sharing options...
papaface Posted December 3, 2006 Share Posted December 3, 2006 You would put the form in php:[code]<?phpecho "<form action=\"". $_SERVER["PHP_SELF"] ."\" method=\"post\" enctype=\"multipart/form-data\"> <input type=\"text\" name=\"username\" value=\"".$variable."\"> <input name=\"submit\" type=\"submit\" /> </form>";?>[/code]Where $variable, would be the place you would want your user data to show. Quote Link to comment 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.