Sinisterly
PHP code - Printable Version

+- Sinisterly (https://sinister.ly)
+-- Forum: Coding (https://sinister.ly/Forum-Coding)
+--- Forum: PHP (https://sinister.ly/Forum-PHP)
+--- Thread: PHP code (/Thread-PHP-code)



PHP code - 1llusion - 02-11-2011

Hi!!!

Well, recently I found this little php, I'm trying one little project with it. Well... If somebody can help me,

I need this code:
Code:
if ($action == "write"){ $open = fopen("log.txt", 'a'); fwrite($open, $data); fclose($open); }

to write the data on a new line Smile

Thanks!


RE: PHP code - Hidden_mybb_import5983 - 02-20-2011

Cant you just save that code as .php?


RE: PHP code - 1llusion - 02-20-2011

(02-20-2011, 01:13 PM)The 7th Sage Wrote: if i'm not mistaken php has escape sequences. Use "\n"
darkscorpion solved it, but I deleted the pm by mistake... anyway I managed to solve it yesterday Biggrin but thanks Smile

here is the edited part:

PHP Code:
if ($action == "write"){ $open = fopen("log.txt", 'a'); fwrite($open, $data."\n"); fclose($open); }

Smile thanks!


RE: PHP code - Rottweiler7 - 03-08-2011

thanks dude very much and cheers