hello i need a simple code to save url into file.txt

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tadmeer
Forum Newbie
Posts: 1
Joined: Sat Sep 01, 2012 1:23 pm

hello i need a simple code to save url into file.txt

Post by tadmeer »

helloi need to log referrer for visitors the links like: http://localhost/hello.php?session=aGVs ... bHBvaW50==


i want to log the url and the (decodded) base64 code: aGVsbG8gZGlnaXRhbHBvaW50== to file.txt or something


so the file.txt will have:


url: http://localhost/hello.php?session=aGVs ... bHBvaW50==
session: aGVsbG8gZGlnaXRhbHBvaW50==
decodded_session: hello digitalpoint


thanks for help me
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: hello i need a simple code to save url into file.txt

Post by Christopher »

The simplest function to write to a file is file_put_contents(). If you want to append to a file, use the FILE_APPEND flag. See the manual: http://us.php.net/manual/en/function.fi ... ntents.php
(#10850)
Post Reply