Page 1 of 1
Read/write to files in PHP
Posted: Thu Jul 22, 2004 7:12 pm
by yasiraq
Hi,
I am a newbie. Just trying to figure out the power of PHP and that's why I am here.
I have managed to got my answers now I am interested in how to read textfiles in PHP and writing to them as well.
Thanks
Posted: Thu Jul 22, 2004 7:29 pm
by John Cartwright
All of those are possible and if you do a quick google you will find them in a sec.
Better yet search these forums! They have all been discussed several times.
Posted: Thu Jul 22, 2004 9:09 pm
by Joe
Im sure I saw a request for this on RAC, mabey im wrong, anyway go with Phenom's idea...
Posted: Thu Jul 22, 2004 9:10 pm
by tim
look at your phpinfo, $_SERVER global is what you should draw your attention too.
for example, $_SERVER['REMOTE_ADDR']; is the ip.
I suggest if you have access to a MySQL db, make a table to store the information and you can easily compare and contrast information.
Good luck
Posted: Thu Jul 22, 2004 11:43 pm
by ol4pr0
1. Date & time of the request
2. Name of file requested
3. IP Address of the visitor
4. User Agent name of the visitor
5. And if possible, the site from which the visitor was referred.
Code: Select all
#date
date("F j, Y, g:i a");
#file no idea at this moment.
#ip as Tim said
#broser used
$_SEVER['HTTP_USER_AGENT'] ;
#site referer
$_SERVER['REFER'];
Can all be found on
php.net
Posted: Thu Jul 22, 2004 11:48 pm
by feyd
* $_SERVER['HTTP_REFERER']
Posted: Thu Jul 22, 2004 11:49 pm
by ol4pr0
i actually used both feyd...
Posted: Thu Jul 22, 2004 11:54 pm
by feyd

what?
$_SERVER['REFER'] doesn't exist, I was correcting that..
Posted: Fri Jul 23, 2004 12:00 am
by ol4pr0
Yea i know you was i am trying to get some of my old files to recall that statement..
cant find it .. $_SERVER['HTTP_REFERER'] doesnt seem to work with my php5, weird. neither does the any of the other ones.