Can anyone help with this script
Posted: Wed May 17, 2006 7:51 am
Pimptastic | Please use
So far it succesfully writes to 'file2.txt' but it doesnt append the entry in 'file1.txt'
Any help would be greatly appreciated cos ive hit a massive brick wall with another one waiting close behind it
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Im trying to pass data entered into a form to a file 'file2.txt' and append that data in 'form1'.
[b]CODE FOLLOWS[/b]Code: Select all
<?php
$name=$_POST['data'];
$file_name = "file2.txt";
$fp = fopen($file_name, "a");
//write to the file
fwrite($fp, "$name");
fclose($fp);
$file_name2 = "file1.txt";
$fp2 = fopen($file_name2, "a");
$name = str_replace("$name","***");
?>Any help would be greatly appreciated cos ive hit a massive brick wall with another one waiting close behind it
Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]