Jump to content

[SOLVED] Easy Form Question!!! Please Help!


snowman15

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/56771-solved-easy-form-question-please-help/
Share on other sites

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"/>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.