Page 1 of 1
php compatibility
Posted: Thu Apr 08, 2004 1:13 am
by reverend_ink
I am working on a script
Code: Select all
<?php
if ($submit){
@mysql_connect($host, $loginname, $password) or die(mysql_error());
@mysql_select_db($data) or die('Could not select database'.mysql_error());
$id = mysql_insert_id();
$lsql = "INSERT INTO $table
VALUES ( '$id' , '$sec' , '$user' , '$pass' , '$post')";
mysql_query($lsql);
echo "<br>!!USER ADDED!!";
}
?>
And in IE it posts fine to mysql, but in mozilla and firebird it doesn't...
What is happening? I have never seen this before... am I missing something?
Posted: Thu Apr 08, 2004 2:36 am
by kettle_drum
PHP is serverside and so it doesnt matter what browser your using. Dont know what could be happening.
Posted: Fri Apr 09, 2004 2:35 am
by reverend_ink
Its the wierdest thing... I didnt think it was possible but sure enough, there is it... nothing....
Posted: Fri Apr 09, 2004 6:07 am
by redmonkey
Mozzila based browsers do not pass the value of the form submit unless the submit button is physically clicked on. So I would guess that you are filling in your form and pressing return/enter and not clicking the submit button?
Posted: Fri Apr 09, 2004 3:51 pm
by twigletmac
Might be a plan to check for the existance of a hidden field rather than the submit button, since, as redmonkey indicated, there are browser inconsistencies. Also ensure that you use isset() (or empty() depending on need) to check whether a variable is set rather than doing $submit or !$submit which should only be used to check for true or false values.
Mac
Posted: Fri Apr 09, 2004 8:11 pm
by d3ad1ysp0rk
redmonkey wrote:Mozzila based browsers do not pass the value of the form submit unless the submit button is physically clicked on. So I would guess that you are filling in your form and pressing return/enter and not clicking the submit button?
That's odd, I just coded up a little test and it did the opposite for me.
Posted: Sat Apr 10, 2004 12:37 pm
by werlop
Hey, this is nothing to do with your problem, but it looks like you've got register globals on (you proably know this already, as you would have to have turned it on). This really should be off, as it promotes sloppy coding.