snowman15 Posted June 22, 2007 Share Posted June 22, 2007 Basically I just want to have the default value of a text feild in a form to be whatever is in a .txt file. I have <form action="http://www.*******.com/text2.php" method="post"> words: <input name="words" type="text" /> <input type="submit" value="submit" name="submit"/> I just want the "value" (i think) to be whatever is inside testing.txt (same directory) I was thining i would do a $variable=fread() and then value=$variable BUT the form is inside of a .html file so how would i make a php variable? Any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/56771-solved-easy-form-question-please-help/ Share on other sites More sharing options...
chigley Posted June 22, 2007 Share Posted June 22, 2007 Well you may have to save the file as .php <form action="http://www.*******.com/text2.php" method="post"> words: <input name="words" type="text" value="<?php echo file_get_contents("text.txt"); ?>" /> <input type="submit" value="submit" name="submit"/> Quote Link to comment https://forums.phpfreaks.com/topic/56771-solved-easy-form-question-please-help/#findComment-280379 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.