Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.