Help me with fwrite?

[SIZE=“3”]I can write a file test.txt with this code
<?php
$a=“Happy New Year”;
$file = fopen(“test.txt”,“w”);
echo fwrite($file,“$a”);
fclose($file);
?>

Resul is : Happy New Year

Now,I want to write like:
<img src=“#”></img>
Text line
<input type=“button” value=“Try” />

How to must write code ???
Help me!
Thanks Everyone!

[/SIZE]

We need more information, I think (sorry to use the Royal “we” there).

What do you want the form to do? Do you want to take the users text, capture it and store it to the file? Or do you want to compare what the user types with what is already in the file, to see if it’s correct?

So basically, exactly what should happen when the user presses the “Try” button?

I want to “Happy new year " will replaced by
“<img src=”#”></img>
Text line
<input type=“button” value=“Try” />" in file test.txt
Thanks you!

I see, so you want to write that code into the file? I’m no expert here but something like this might do it:

<?php
$a=“<img src=\”#\“></img>Text line<input type=\“button\” value=\“Try\”>”;
$file = fopen(“test.txt”,“w”);
fwrite($file,“$a”);
fclose($file);
?>

Oki, Thanks u very much !!! :slight_smile: