andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Script Does NOT work. Help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> WWW Checkup
View previous topic :: View next topic  
Author Message
ps9958
Newbie


Joined: 20 Feb 2003
Posts: 2

PostPosted: Thu Feb 20, 2003 11:07 pm    Post subject: Script Does NOT work. Help Reply with quote

Hi,

I just came across your check update script. However, the script doesn't run. When I try to execute the test file it keeps saying cannot connect to localhost, and I know for a fact that the localhost is up and running, since I have at least 5 other scripts running off of it just fine.

Also, there doesn't see to be any installation instructions or anything for the script. Any help would be much appreciated.


Thanks - Pete
Back to top
View user's profile Send private message Send e-mail
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Sat Feb 22, 2003 10:52 am    Post subject: Reply with quote

Hi Pete,

Okay, first let me start by saying; yes, the script does work. I've tried it out and other people have too - I wouldn't (intentionally) put up the script if it didn't work! Smile

With that said, I haven't tried it with a 4.3.0+ version of PHP (maybe some mysql connection routines were changed?) or that the problem is something to do with the database connection strings being passed.

The line:

Code:
$cu = new WebsiteCheckup("demouser","demopass","websites","test");


requires the username, password, table name, database name, host name (respectively.) They all have defaults set, but in reality you should probably provide them all. (the example line above neglects to pass 'localhost' because this is set as default within the function.)

Recheck you user/pass strings.

You're right in that there should probably be some documentation with it. The test.wwwcheckup.php should provide you with a good idea of how to call the functions, though. However, if you need specific help setting it up then let me know what you're stuck on and I'll try to help.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ps9958
Newbie


Joined: 20 Feb 2003
Posts: 2

PostPosted: Sat Feb 22, 2003 5:52 pm    Post subject: Still having problems Reply with quote

Hi again,

First allow me to say that I admire the script you have written. I have written a few basic PHP scripts myself (nothing advanced, just basic stuff), so I do know the basics of what needs to go where.

I have already placed the username, database name and password in both the test script and the check script. But when I try to run the test script, I get the following message:

Unable to connect to mysql server: localhost

However, the MySQL database server is up and running when it gives me this message. I have tried it on two different servers with the same result. I am using PHP Version 4.1.1 and MySQL Version 3.23.41 with Apache Server Version 1.3.22 .

If you need any other information please let me know and I will be happy to provide it for you.


Thank You - Pete
Back to top
View user's profile Send private message Send e-mail
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Sun Feb 23, 2003 7:58 am    Post subject: Reply with quote

Hi Pete,

Hmm... Don't know what to suggest, then. I will try this script out again, but it won't be for a little bit yet. I'm soon to get a new monitor and broadband connection, so will be able to work on it then (rather than now with my dodgy monitor and sparodic net connection.) I'll let you know if I come up with anything, or have any other thoughts in the mean time.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
sssss
Newbie


Joined: 16 Sep 2003
Posts: 1

PostPosted: Tue Sep 16, 2003 7:29 pm    Post subject: Works fine Reply with quote

But the line $cu = new WebsiteCheckup("demouser","demopass","websites","test");

may be correctli filled...User=Your username
Demopass=Your password ... Demopass =websites (If you dont change it to somthing else from the sql file..websites is fine) test = Your Database name example
user555
Back to top
View user's profile Send private message
twisty
Newbie


Joined: 06 Oct 2004
Posts: 1

PostPosted: Wed Oct 06, 2004 11:12 am    Post subject: Re: Script Does NOT work. Help Reply with quote

ps9958 wrote:
Hi,

When I try to execute the test file it keeps saying cannot connect to localhost, and I know for a fact that the localhost is up and running,


In class.wwwcheckup.php...

CHANGE THIS:

Code:
      $this->id = @mysql_connect($this->host, $this->user, $this->pass) or
         die("Unable to connect to mysql server: {$this->host}");
      @mysql_select_db($this->db, $this->id) or
         die("Unable to select database: {$this->db}");



TO THIS:

Code:
      $this->id = mysql_pconnect($this->host,$this->user,$this->pass);
      if (!$this->dbh) {
        $this->not_right("Unable to connect to the database!");
      }
      @mysql_select_db($this->db,$this->id) or
         die("Unable to select database: {$this->db}");


Wink
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> WWW Checkup All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group