Jump to content

INSERT INTO dosn't work with IE, Opera or Maxthon.


loozah

Recommended Posts

Well there goes the rest of my hair...

can someone please shed some light on this, the following code works fine in Firefox, Safari and Chrome but not in MSIE, Opera or Maxthon.

$rand_key = generateRandomKey(30);
$name     = $_POST['name'];
$email    = $_POST['email'];
$country  = $_POST['country'];
$terms    = $_POST['terms'];
$ip       = $_SERVER['REMOTE_ADDR'];

mysql_query("INSERT INTO cath5388_users (fullname, password, email, country, rand_key, terms, ip_addr) 
VALUES ('$name', '$password', '$email', '$country', '$rand_key', '$terms', '$ip')") or die(mysql_error());

 

I've googled every query I can think of but found nothing.

 

Thanks in advance.

First of... INSERT INTO, which is a query, is not the reason if it does not run on other browsers, SQL has no idea what browser you use and never will (I suppose). Better check first if all those values are being passed properly to your server from the client during that POST. Something must have gone wrong beforehand.

 

bluejay,

Thanks for the input guys, yes it would appear to be an issue with the form html, I tried echoing out form by setting the action to a separate page and it worked so I tried creating a new form and it worked so after being up all night with this one I think I'll go grab some rest,  Thanks again I'll let you know if I get it working.

:PDoh! now I feel stooopid! I had a similar problem once before... I simply forgot not to use images instead of buttons in forms, just changed them back and everything is working find sorry for the trouble but thanks for the help I would have been going at it for another night if not for you guys explaining that the problem wasn't in the query but in the html.

 

Cheers!

 

You can use images as submit buttons in forms so that they will work in all browsers, you must simply use the _x or _y variables that the HTML specification states are to be submitted - http://us3.php.net/manual/en/faq.html.php#faq.html.form-image

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.