Log in

View Full Version : Sending form using php



sgt.virus
04-02-2007, 09:48 PM
Hey guys,
Ive just created a form to send the contents to my email account. But, instead, I want to send it to a textfile on the server, so I can view it at a later date. I got told php is the best way, but cant figure out how to do it. Can anyone help? Cheers

thetestingsite
04-03-2007, 12:18 AM
Try this as an example:



<?php

$var = "test Variable";

$filename = "text.txt";

$fp = fopen($filename, w); //open the file
fwrite($fp, $var); //write to the file
fclose($fp); //close the file
?>


This is just a basic framework for you, but should work with very little modification.

Hope this helps.