Database problem


I have a problem. I have been working on a DB on my computer for a while (suing EasyPHP as server) Everything work fine. It’s a “simple” Database that act like a form that collect info, so nothing really fancy.

Now I want to put it on my server.

  • I uploaded every file on my server
  • I changed the setting of my connection files
  • I made the database
  • I imported the .sql to the database with success

When I access the php page, I can see the data that I had in the .sql file but I can’t add or edit anything.

When I try to add new data, the page only refresh itself and nothing is put in the DB. no error, no nothing. Same for editing.

Everythign work offline on my computer (with easyphp/mysql) but online, It’s like read only.

I’m a noob in php/mysql stuff and I’m lost. If you have any idea…

Post the code you use to add data here, it’s possible that there was some error connecting to the database. BTW, did you change the setting you use to connect to database so that you can connect to your dreamhost database?

I think you’re experiencing an annoying, but very common problem due to the PHP version you’re using. Dreamhost has disabled the register_globals directive for it’s PHP5 installations, to increase security. This means that a very common scripting technique to check for form variables will stop working. In pages that submit to themselves, like yours sounds, this will result in what looks like the page just refreshing itself.

I’ve pasted a link to a thread that describes symptoms exactly like yours. You must either find a newer version of your script that supports disabled register_globals, or you can retrofit the existing script yourself.

This thread also includes a post explaining how to fix the problem, but I’ll sum it up for you.

It means that global variables are not automatically being created from superglobal variables like $_POST and $_GET. You need to create the global variables yourself. In the script you posted, you need to create the two $_POST variables like this:

$submit = $_POST[‘submit’];
$lname = $_POST[‘lname’];

BC Tech
Team Shocker