Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Sun Jul 23, 2006 3:44 pm Reply with quote

If by chance you are running into the problem of NOT beng able to fully connect to the mysql database; Run this:


<?php
// Coded by DARKLORD From SCRATCH. There are other scripts that do this,
// but I did NOT use them as a template of any kind!!!
// No need to edit this, Just upload to the nuke root directory.
// Delete this file when finished!!!!!!!!!!!!!!!!!!!!!!!<--MUST



include_once ("config.php");
$dbi = @mysql_connect($dbhost, $dbuname, $dbpass, $dbname);
$db = @mysql_select_db ("$dbname");
if ($dbi AND $db){
Echo "Success, A connection could be established to your database";

}else{
$link= @mysql_connect($dbhost, $dbuname, $dbpass);
if ($link){
echo " Establish a connection to the server but not to the database, The database $dbname either is not the correct database name or not there at all, please edit it. Remember when using CPANEL it will most likely be username(cpanel)_database";
}else{
$link= @mysql_connect('localhost', $dbuname, $dbpass);
IF ($link){
echo "Your host is localhost, please change it to that and re-run this script if problems continue";
}else {
if ($dbhost!=localhost){
echo "Either your username or pass is wrong or your host isnt localhost or $dbhost, Please check with your host for further assistance.<BR> Also check to verify that this is a mysql database and not any other form!!";
}else{
echo "Check your username and password to the mysql Database. Either your username or pass is wrong or your host is not localhost, Please check with your host for further assistance.<BR> Also check to verify that this is a mysql database and not any other form!!";
}
}
}
}


?>

This was coded to help someone else with their connection problem and pin pointing the exact cause. Just upload this to the same directory as config.php

Remember to treat this as a debugger and NOT a complete error finding script .
This will only show one error at a time and I coded it as best I could to find them without problems but I cannot verify username and password seperately from the other variables.

So username and pass will be manually needed to be looked at

Hope this helps someone.

Edited for a little more security.
Dont forget to delete this out of your file system once Completed.

Kguske if youve tested this, any error? or miscompliance I might have missed?

Its simple enough but I have been known to miss a few things.

_________________
For those who stand shall NEVER fall and those who fall shall RISE once more!!

Last edited by gregexp on Sun Jul 23, 2006 6:08 pm; edited 1 time in total 
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Sun Jul 23, 2006 4:03 pm Reply with quote

You might want to put some security on that - I'm not sure I'd want to disclose my database info to anyone who happened to run that. Of course, they would have to get lucky and run it at the right time, but there's an old Cuban saying: "Dress me slowly, I'm in a hurry." It means that you tend to forget things when the pressure it on - the last time you'd want to do that...

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
gregexp
PostPosted: Sun Jul 23, 2006 4:11 pm Reply with quote

Hmmm, How bout telling em to delete after they finish using it?

I didnt intend on this to remain on the server. And if I had any clue how to envoke some form of you are.....

So I think I lax in that area.

Any sudjestions on how I could secure it?
 
kguske
PostPosted: Sun Jul 23, 2006 6:00 pm Reply with quote

Telling them to remove it would work - it's not a big deal, but information is power...

Since it's testing the database, it doesn't make sense to verify that the person is an admin. The only way I could think of is to hard-code a security code and validate that on entry. Then again, deleting it would work, too!
 
gregexp
PostPosted: Sun Jul 23, 2006 6:09 pm Reply with quote

Now edited so that they delete after they diagnose.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©