Jump to content

Submit form works with internet explorer but not with firefox 7 or chrome


jaa312

Recommended Posts

I have been banging my head for quite a number of hours on this.........I am getting the below error with firefox 7 or chrome but NOT with IE

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unlockth/public_html/motorola/insertmoto.php on line 35

 

Here is the code.......pls can anyone help me?

 

<?php

  $userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];

  $name = $_POST['name'] ;

  $email = $_POST['email'] ;

  $phone = $_POST['phone'] ;

  $operator = $_POST['operator'] ;

  $imei = $_POST['imei'] ;

  $todayis = date("l, F j, Y, g:i a") ;

 

  @mail( "xxx@xxx.com", "ORDER SUBMISSION",

  $message = " $userip

  $message = $todayis

  Name: $name

  Email: $email

  Phone Model: $phone

  Phone Operator: $operator

  Phone Imei: $imei",

    "From: MOTOROLA SUBMISSION>");

?>

 

<?

$id = $_POST['id'];

 

include "/home/unlockth/password.php";

mysql_select_db("unlockth_unlocking",$db);

 

mysql_query("INSERT INTO custdetails VALUES ('','$name','$email','$phone','$operator','$imei')");

$insertid = mysql_insert_id();

 

include "/home/unlockth/password.php";

mysql_select_db("unlockth_unlocking",$db);

 

  $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db);

 

  $row = mysql_fetch_array($getdata);

 

              $title = $row["title"];

              $price_1 = $row["price_1"];

              $price_2 = $row["price_2"];

              $price_3 = $row["price_3"];

              $imageaddr = $row["imageaddr"];

              $description = $row["description"];

              $keywords = $row["keywords"];

              $time = $row["time"];

 

include '/home/unlockth/public_html/motorola/outputmotocode.php';?>

Link to comment
Share on other sites

I'm betting you have an error in your html form.  Since IE is so loose on errors it may be slipping through.  I bet that "$id" is not even set or being passed in.  You need to do better error checking too after you get your results from the query.

 

Do this..

$getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db);

if (!$getdata)
echo "There are no results
else
{
  $row = mysql_fetch_array($getdata);

               $title = $row["title"];
               $price_1 = $row["price_1"];
               $price_2 = $row["price_2"];
               $price_3 = $row["price_3"];
               $imageaddr = $row["imageaddr"];
               $description = $row["description"];
               $keywords = $row["keywords"];
               $time = $row["time"];
}

Link to comment
Share on other sites

Your form isn't submitting the $_POST['id'] field and probably none of the other $_POST variables.

 

You would need to post your form to get help with what is wrong with it.

 

I don't agree with you that the  form isn't submitting the $_POST['id'] field because if i do echo $id; under $id = $_POST['id']; the id will come in IE and again not in firefox or chrome.

 

It must be something else.........:( :( :(

 

cunoodle2.....i followed your suggestion and received the below error:

Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/unlockth/public_html/motorola/insertmoto.php on line 41

 

The form i can post but it is huge........Can i send it via personal message? I would appreciate all your help. Tahnk you guysss

 

 

Link to comment
Share on other sites

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.