Hi All,

 

I'm a little confused by a problem I'm experiencing with a form that is
being processed differently between IE and FireFox.

 

For some reason, when a new record on my form is submitted to the code
below, it gets processed as though it were an edit operation when executed
via Internet Explorer, but executes as an insert when via FireFox. 

 

On the form, 'recid' is a hidden field that is populated from the query
string. If recid has a value, the assumption is made that the operation is
an edit. If recid has no value, then the assumption is made that the
operation is an insert.

 

However, the same form, submitted with what should be a blank recid hidden
field value, is being treated differently - in IE it's being treated as
though it's an edit, while in FireFox it's being treated as I expect it to,
as an insert.

 

Can anyone help me understand what I'm doing wrong?

 

<quote>

 

<?

            ob_start();

            $dbh=mysql_connect ("localhost", "user", "password") or die ('I
cannot connect to the database because: ' . mysql_error());

            mysql_select_db ("tiarawea_mt");

            $edrecid = (isset($_POST["recid"]) ? $_POST["recid"] : "");

            $edquote = (isset($_POST["quoteval"]) ?
addslashes($_POST["quoteval"]) : "");

            $eddisp = (isset($_POST["disprec"]) ? $_POST["disprec"] : "");

            if (!empty($edrecid)){

                        $q = "UPDATE tblquotes set quote = '$edquote',
disprec = '$eddisp' where recid = $edrecid";

                        mysql_query($q);

                        $action = 'edit';

            } else {

                        

                        $q = "INSERT INTO tblquotes (quote, disprec) VALUES
('$edquote', '$eddisp')";

                        mysql_query($q);

                        $edrecid = mysql_insert_id();

                        $action = 'new';

            }

            header("Location:
/admin/admin_quotes.php?quote=$edrecid&action=$action");

            exit;

            

?>

 

</quote>

 

 

Much warmth,

 

Murray

 <http://www.planetthoughtful.org/> http://www.planetthoughtful.org

Building a thoughtful planet,

One quirky comment at a time.

 

Reply via email to