Forum Moderators: coopster
Code to detect the submit button:
if($submit) //If submit is hit
{
$result=MYSQL_QUERY("INSERT INTO user_mail (id,name,email,url,message)".
And heres the submit button #1 that worked:
<input type="submit" name="submit">
And heres the second one that didnt work:
<input type="submit" name="submit" style="background-image: url(images/sendmail.gif); border: 0; width: 51px; height: 23px; background-color: transparent;" value="" onMouseOver="this.style.cursor='hand';">
Thx
As I understand the if conditional operator in PHP it will evaluate whatever to its Boolean value. In this case $submit will evaluate to false because you have set value="" in your submit button. An empty string will evaluate to the Boolean false.
To fix the problem either specify a value other than an empty string in your submit button code or use if(isset ($submit)) as the conditional test.
@all:
i can only confirm to that the isset($submit) function is able to check wether the submit button has been pressed or not. this will even prevent the display of warning messages if submit is not pressed at all.