PHP Issue

Posted by pluddies, 03-01-2010, 05:58 PM
I have recently switched from a HostGator.com reseller account, to a new VPS with FutureHosting.com, and when moving a couple of my websites i've come across some (hopefully) minor PHP issues. The problem is data submitted via a form used to be passed into a MySQL database, but it's no longer working. Here is the code which worked before: But now I get nothing. I'm by no means a PHP expert, as you can probably tell from the above code - but I get by. Could use some help on this though if anyone has any suggestions - thank you

Posted by pluddies, 03-01-2010, 06:01 PM
If it might help, a friend of mine managed to fix an issue on another website of mine by replacing this: With this: Perhaps it offers some suggestion of the root of my issues Last edited by pluddies; 03-01-2010 at 06:01 PM. Reason: typo

Posted by Shane Rutter, 03-01-2010, 06:17 PM
Hello, You might need to change the top line which is

Posted by pluddies, 03-01-2010, 06:23 PM
I have other sites on the same VPS and scripts using just

Posted by Shane Rutter, 03-01-2010, 06:32 PM
You could try run this, and see if it works. Then just delete the entered record after it it does. At least this way if it works you no its probebly the db connection or the variables being passed. When i have problems like this i do somthing like this just to limit the possabilitys even if it seems unlikly. Does your web server have php debuging error code turned on? well is it set to display errors on the browser output?

Posted by TheDandy, 03-01-2010, 07:57 PM
you shouldn't validate your code with addslashes function. You can still get a mysql injection. create a propper function to validate it.

Posted by mattle, 03-02-2010, 09:27 AM
Bunch of issues here: I know this has been brought up already, but you should make a habit of getting rid of all

Posted by HivelocityDD, 03-03-2010, 01:22 PM
Although the code might not be that perfect I cant see a reason for this one to not work. It looks okay to me at this code snippet. But in the first line I think you might not be having the proper DB configuration. If you were using the shared hosting... the DB name and Username will be preceded by the hostname. So make sure you have the right one there. You might be having some lines in connect.inc which is causing this issue Also check whether you had an .htaccess file for making this work in the old hosting. Thanks

Posted by strigata, 03-07-2010, 12:31 PM
TheDandy is only partially right. sql injection is still possible on multibyte charsets but you're not going to want to create your own function - instead just use php's built-in mysql_real_escape_string() function.

Posted by tim2718281, 03-07-2010, 01:03 PM
There are all manner of things that could be wrong as a result of the migration. For example, has the userid been granted access to the table? The first step is to check the web server logs; there may be a message there telling you exactly what is wrong.

Was this answer helpful?

 Print this Article

Also Read

Domains on a particular nameserver

Posted by realvaluehosting, 09-14-2007, 03:24 AMHi, Is it possible to get a list of the...

Compromised???

Posted by Chinese Democracy, 04-20-2009, 12:01 PMIt appears that one new sign-up on a shared...

Content not loading from cache in iframe / frameset

Posted by DevMonkey, 02-16-2011, 03:52 PMOk, trust me, I have a legit reason to be using iframes...

2mhost Reseller.

Posted by smartmlp, 09-07-2001, 11:04 AMHey, 2mhost is down right now, or is it just me? my...

looking for creditcard processing international

Posted by zhai, 09-05-2001, 07:36 PMi'm nearly decide to use service from revecom.com but after...