Lassie Posted January 20, 2008 Share Posted January 20, 2008 I am trying to use a simple log script which gives a parse error i cant see the cause of The error is enexpected':' on $country_file line. Any help is appreciated. Function logthishit($sessionid, $pagevisited, $ip, $browser, $refer) { $log = fopen("log.txt","a"); $countryfile = fopen(http://ip-to-country.com/gert-country/?ip=$ip&user=guest&password=guest,"r"); $country = fgets($countryfile,50); fclose($countryfile); $now = date("d F Y h:i:s A"); fwrite($log,"$now,$sessionid,$pagevisited,$ip,$country,$browser,$refer\n"); $log = fclose($log); } Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/ Share on other sites More sharing options...
interpim Posted January 20, 2008 Share Posted January 20, 2008 try putting the url in quotes. Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/#findComment-444320 Share on other sites More sharing options...
revraz Posted January 20, 2008 Share Posted January 20, 2008 Also, looks like you're missing the actual page name you want Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/#findComment-444321 Share on other sites More sharing options...
kenrbnsn Posted January 20, 2008 Share Posted January 20, 2008 When you have a url that looks like "http://some.domain.name/?xyx=1", the target defaults to the index script. Ken Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/#findComment-444326 Share on other sites More sharing options...
Lassie Posted January 21, 2008 Author Share Posted January 21, 2008 Thanks guys. I will work on that. Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/#findComment-445031 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.