Jump to content


Troubles.


3 replies to this topic

#1 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 30 May 2005 - 10:39 PM

I have this script i found to display how many unique visitors I get.
  <?php
if ( is_readable( 'scripts/unique.php' ) ) include_once "scripts/unique.php";

// Use only one of the following:

unique_log( $_SERVER['REMOTE_ADDR'], TRUE); // Will print # of hits
?>
And when i change the
is_readable ( 'scripts/unique.php' ) ) include_once "scripts/unique.php";
to
is_readable ( 'http://www.hyprkookeez.com/v4/scripts/unique.php' ) ) include_once "http://www.hyprkookeez.com/v4/scripts/unique.php";

It shows
Fatal error: Call to undefined function: unique_log() in /home/kentr/public_html/v4/left.php on line 70

I need it to be with the hyprkookeez.com/v4/ for php includes to work correctly with it.
Anyone suggest a fix?
Or do you need the unique.php script?

#2 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 30 May 2005 - 11:20 PM

you are getting that error because you need to define the function... but it looks like you are just trying to find the number of hits from a user based on the ip. there are easier ways to do that.

if that isn't what you are trying to do then try to explain what it is you are trying to accomplish. :D

#3 MaRmAR

    Young Padawan

  • Members
  • Pip
  • 18 posts
  • Location:Slovakia

Posted 31 May 2005 - 02:09 AM

Try making a condition before calling a function:

if (is_callable("unique_log")) {
  //call the function
}

and watch-out the manual for function include() and include_once() why you are getting Fatal Error when including: http://www.php.net/m...ion.include.php
http://www.php.net/m...nclude-once.php

Edit: Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled. - maybe this is your problem.

#4 Hyprkookeez

    Young Padawan

  • Members
  • Pip
  • 49 posts
  • Location:Edmonton AB CA
  • Interests:Photoshop, HTML

Posted 31 May 2005 - 04:58 PM

I tried a different script, and adding the http:// still doesn't work.
If i leave it out it does. Any suggestions for a better one? I'm going to look for a mysql based one.

:lol: None on pixel2life... I should just learn how to create my own. Then i could post it ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users