# Help storing to a Txt file PHP

**URL:** <https://forum.kirupa.com/t/help-storing-to-a-txt-file-php/279097>\
**Category:** Uncategorized\
**Created:** [January 9, 2009, 11:48am UTC](https://forum.kirupa.com/t/help-storing-to-a-txt-file-php/279097 "2009-01-09T11:48:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simononestop](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@simononestop](https://forum.kirupa.com/u/simononestop)\
**Post date:** [January 9, 2009, 11:48am UTC](https://forum.kirupa.com/t/help-storing-to-a-txt-file-php/279097/1 "2009-01-09T11:48:23Z")

</div>

Hi can any one help

i have 4 txt boxes which load 4 prices from a txt file that works ok.  
if the user then changes the price in the box and hits a button:-

on (release) {  
time = new Date();  
url = “./store.php?time=”+time.getTime()+"&post="+escape(post)+"&post2="+escape(post2)+"&post3="+escape(post3)+"&post4="+escape(post4);  
loadVariablesNum (url, 0);  
}

i want it to save the text to the txt file

store.php has this code in it:-

\<?  
// store the variables passed by POST  
$fp = fopen(“data.txt”, “w”);  
if (!$fp) die (“cannot open the file”);  
fputs($fp, “&post1=”.$post1, 4096);  
fputs($fp, “&post2=”.$post2, 4096);  
fputs($fp, “&post3=”.$post3, 4096);  
fputs($fp, “&post4=”.$post4, 4096);  
fclose($fp);  
?\>

i cant get it to work?? any ideas
