I recently moved my website from one host to another. I moved all the files and also the database.

Now when I try to log in, it just refreshes the page and nothing happens.

The data is being read from the database but the site just doesn't log me in.

What extra information do I need to give?

  • 1
    If you post your code it might be easier to answer. – Nicola Peluchetti Jun 13 '11 at 14:34
  • Do you have the same mySQL user credentials on this host as the previous? Do you have any PHP or mySQL errors? – Ryan Jun 13 '11 at 14:34
  • I agree, post your code. Also, did you have a database setup on the original hosting? If so, did you set up the new hosting with the exact same database and configs, login credentials, etc... – Drewdin Jun 13 '11 at 14:36
  • Without code it's not possible to answer. – red eyes dev Jun 13 '11 at 14:36
  • Only reason I didn't include code was because I thought it might be a common thing. There are no errors at all, the files and database is exactly the same, and as I said, the database is reading fine meaning it's accessing no problem. What code would be relevant? I have a feeling it must be a directory problem. – Luke Jun 13 '11 at 14:52

Possible reasons:

  • The version of PHP or MySQL has changed and code that is either obsolete or dependent on a side effect of a function that has been fixed and no longer occurs is now broken or disabled

  • The login credentials for MySQL are different and your code does not output errors so the page just reloads.

  • You use Register Globals and the new server does not support it

Recommendations for troubleshooting:

  • Turn error reporting on and output all errors

  • Put in simple checks for errors at all stages of the login process to see where it is failing particularly where the SQL queries are performed

| improve this answer | |