Mysql Host Server Problem


#1

Hi,

When I signed up with dreamhost, I chose mydomain.dreamhosters.com as the first domain. I then registered a domain name with another company and changed the DNS settings. I then fully hosted the domain name with dreamhost. the domain name is oldtimegems.com I then proceeded to create a mysql hostname and database for the site. The hostname was data.oldtimegems.com

So I now have the following:

1 folder named mydomain.dreamhosters.com
1 folder named oldtimegems.com
1 mysql hostname data.oldtimegems.com

I used the mydomain.dreamhosters.com folder to host the site and I had no problems. After a few days, the DNS settings went into effect. I then decided to dump all the files from mydomain.dreamhosters.com to oldtimegems.com
This time the php scrpts that connect to and read tables from data.oldtimegems.com could no longer do so. For instance at the login prompt, if I tried to login, nothing would happen. However, when I go back to mydomain.dreamhosters.com folder and try out the scripts there it works fine.

What is going on here?

Thanks for the help…


#2

It’s pretty hard to tell what is going on here, as the PHP script(s) don’t generate any errors to the browser (good for security, but bad for debugging :wink: ), and I can’t see the code.

The HTML produced by the login.php file shows no “action” is assigned to the submission of the “login” form so I can’t tell what it is supposed to do. Without that, I can’t tell where the problems lies.

I suspect that there might be a configuration variable somewhere in the set of scripts that needs to be set-up with a path or url so that the package of scripts knows where to look for it’s various parts, and that this now needs to be changed to reflect the “new” domain in the path, or something similar. If the script was installed via an “installation script” of some kind, it is possible that it “setup” its configuration to reflect the original domain on which it was run; and now changes are required to account for the new domain.

That’s just a “best guess” based on what I can see from the site, and might not be the right answer. Is the script you are running open-source? If so, and you point me the script, I might can tell more :wink:

–rlparker


#3

Hi,

thanks for your reply.

I scripted the files myself and I made sure that the mysql queries were connecting to the right mysql server and tables.
I changed the host name in the script to data.oldtimegems.com and made the appropriate changes to the username and passwords, yet whenever I try loging in, it does not work. It just reloads the page.

To recap:

The scripts are in the oldtimegems.com rootfolder and appropriate changes to the original scripts have been made., yet no go. I even created a completely different mysql server and still no go.

Here is the script for the login page.

if(isset($submitit))
{

mysql_connect(“mysql.oldtimegems.com”, “username”, “password”) or die(“Cannot Connect to Database.”);
mysql_select_db(“sitedata”) or die(“Cannot Select Correct Table.”);

$rt=mysql_query(“select * from userinfo where username=’$username’”) or die(“could not retreive username!”);

$num=mysql_num_rows($rt);
$row=mysql_fetch_array($rt);

if ($num!=0 && $password==$row[3])

{
$_SESSION[‘userid’]=$row[‘userid’];
$_SESSION[‘username’]=$row[‘username’];
$_SESSION[‘firstname’]=$row[0];
header(“location:myshows.php”);
exit;
}

Thanks for your help.


#4

Just a thought:

Were the “temporary” dreamhosters.com and the newly propagated oldtimegems.com domains set up using the same version of PHP?(i’m wondering of the difference in register_globals variable passing could be involved in your problem)?

–rlparker


#5

That’s what I thought initialy but didnt think that was the problem.

I changed to the older version for the site and it works now.

Thanks for the help :slight_smile: