|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Log visited URL to file¿
I need a php script that will log a visited URL to a file.
For example, if someone visits http://www.mysite.com/user.php?UserName Then "UserName" is logged to the text file. I'm completly new to php so I don't even know the term to search for regarding the question mark in the URL (if that makes sense). Any help on this would be much appreciated Cheers |
|
#2
|
|||
|
|||
|
RE: Log visited URL to file¿
im not totally sure on this one, but pretty sure that you cant just have www.mysite.com/user.php?userName i think you have to have www.mysite.com/user.php?something=userName
but then logging it into a database, you go like this: <?php mysql_connect(host, user, pass) or die("Couldnt connect to database"); mysql_select_db(database) or die("Couldnt select database"); mysql_query("INSERT INTO table SET field = '{$_GET['something']}") or die(mysql_error()); // the $_GET['something'] finds the value that something equals in the URL ?> hope that was of some assistance |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Log visited URL to file¿ |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|