what I want to do is strip post data and write into a text file. I think I have a working script but its not working correctly. <?php if (isset($_POST['Data1']) && (isset($_POST['Data2']))) { $Data1 = trim(strip_tags($_POST['Data1'])); $Data2 = trim(strip_tags($_POST['Data2'])); $master = fopen('textfile.txt', 'a+', 1); $text="$Data1:$Data2:"; fwrite($master, strip_tags(stripslashes($text))); fclose($master); echo'<script type="text/javascript">document.location.href=\'http://google.com'</script>\'">'; } ?> PHP: and everytime i send something through the text file, it will strip the data1 and data2 information and write it on the next line, as so Data1ata2 Data1ata2 Data1ata2 and i also forgot to mention, the google is there because I want it to go to a website afterwards.
i'm also having another problem. when using the code php header("Location: http://www.google.com") it will go to there. what i need is for it is to go to a frame titled I1. using html it would be <a href="index.html" target="I1"> using the php header location or some header, how can I just make it go to index.html , confusing I know sorry. basically i have a website in a frame. and inside one of the pages is a form, whicfh you type something in and submit, the data is written into a text file, and afterward it redirects you to a webpage. i need a way to go to that new webpage, but inside the frame still. thank you.
Use these parameters for fopen $master = fopen('textfile.txt', 'a'); PHP: You are not reading it, why make it read and write?