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); } Quote 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. Quote 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 Quote 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 Quote 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. Quote Link to comment https://forums.phpfreaks.com/topic/86910-log-script-parse-error/#findComment-445031 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.