Variable into textfield

How do i pass a variable (like from a txt file) into a textarea in PHP? I’m a bit confused on how to do it…

thx in advance :smiley:

I think you might need some JavaScript to acheive this. Im not 100% though.

i think you have to open the file first… :stuck_out_tongue:

ie:


#read from file
<?
$file = '???.txt' ;
$fh = fopen($file,'r') or die ("couldnt open file to read");
$file_size =filesize($file);
$file_content = fread($fh,$file_size);
fclose ($fh);
echo '<TEXTAREA NAME="" ROWS="" COLS="">'.$file_content.'</TEXTAREA>';
?>

No need for java @ all.

woot woot thanks a lot man!

:smiley: