Ok it saved a file named text.txt but there is no info in the document. Also the page generated this error message:
Warning: file_get_contents(http://www.domain.com/engr/servlet/s...092&num5=84117) [function.file-get-contents]: failed to open stream: HTTP request failed! in /home/ootaclan/public_html/engr/servlet/scripts/printouts/newuser/printout.php on line 79
It requires some kind of trigger to be set on your localhost when page is submited. If that was on the same server it wouldn't be problem (i guess), but sending HTTP request to far away server and dynamicly uploading it is possible only with Ajax, or some super cool cgi or similar script which i would really like to see if anyone is following me, please answer what could it be possible to use instead of lousy javascript
$return = file_put_contents('text.txt', $content); // or change to file_put_contents('text.txt', $content, FILE_APPEND); if you want to append the file
if($return == false) die('Failed to write file!');
Ok i have it saving and loading properly. I tried to change the name of the file it saves but couldn't get it to work. I'm trying to set it equal to a variable.
it will not save in file with file_put_contents if file doesn't egzist.
This is wrong. The whole purpose of file_put_contents() is to have an easy method of writing to a text file without the worry of modes/existing files/etc.
Are you displaying errors? Are you sure the $uic variable contains a value?
yep just double checked by doing an echo $uic; it shows up with the correct info. just the file ain't saving anymore
just wondering if this could be it: Is there a max length for the name of a saved file. Because the variable $uic stands for user identification code which is a 25 digit number.
Edit:Apparantly not because i just tried it with a shorter variable length and still got no file saved