So I attempted to solve this on my own and this is as much as I got <!-- save query //--> <?php if($_POST['q']){ $file_name = "something.txt"; $file_open = fopen("something.txt","a+"); fwrite($file_open, $_POST['q']); fclose($file_open); } ?> <!-- end save query //--> <form class="url_form" method="post" action="/index.php"> <div id="surfcontainer"> <input type="text" id="surfbox" name="q" value="{DEFAULT_URL}" /> <input type="image" value="" src="{THEME_DIR}/imgs/surf_button.gif" style="float: left; border: 0px;" /> <!-- save query //--> <?php $datalines = file ("something.txt"); foreach ($datalines as $zz) { echo $zz; } ?> <!-- end save query //--> </form> </div> PHP: Using this I get undefined function for q and no info is written to the something file anyone have an idea how to make it to the inputted data is saved into the text file on separate lines.
Whats the error message? use this to write on seperate line <?php if ($_POST['q'] != '') { $file_name = "something.txt"; $file_open = fopen("something.txt","a+"); fwrite($file_open, "{$_POST['q']}\r\n"); fclose($file_open); } ?> PHP:
Buddy, i have tested the script and its working fine... have u CHMOD your something.txt(where data should be saved) to 666?
I get can see it running here I have it at 777 It is saving some of the urls but it doesnt save any that I put in I have tried 777 and 666 You can try and look at the searched page to see if it saved it