5 Replies - 1697 Views - Last Post: 13 January 2010 - 02:37 AM

#1 fig79   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 75
  • Joined: 25-February 09

Not working in IE browser!

Post icon  Posted 10 January 2010 - 07:52 AM

<?php if ($_POST['submit']=='login') { 
	echo "Hi";
	}
?>
<form name="form1" method="post" action="">

<input type="image" src="button_ok.gif" name="submit" value="login" onclick="submit()" />
</form>


How to make this script work in IE browser?
In Firefox It is working.

Is This A Good Question/Topic? 0
  • +

Replies To: Not working in IE browser!

#2 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3839
  • View blog
  • Posts: 14,005
  • Joined: 08-August 08

Re: Not working in IE browser!

Posted 10 January 2010 - 12:31 PM

Are you saying it doesn't ever output "Hi"? That's the only php you have there, so if the problem is with the form then this belongs in html & css or possibly Javascript if your submit function isn't working.
Was This Post Helpful? 0
  • +
  • -

#3 przemass   User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 166
  • Joined: 18-July 09

Re: Not working in IE browser!

Posted 11 January 2010 - 04:00 AM

Try:
onclick="this.submit()"


Was This Post Helpful? 0
  • +
  • -

#4 it_1   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 15
  • Joined: 10-August 09

Re: Not working in IE browser!

Posted 13 January 2010 - 01:26 AM

it save as test.php:


<?php if (isset($_POST['submit']))
{
echo "Hi";
}
?>
<form name="form1" method="post" action="test.php">

<input type="image" src="button_ok.gif" name="submit"value="login" />
</form>
Was This Post Helpful? 0
  • +
  • -

#5 thinspirit   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 43
  • Joined: 12-January 10

Re: Not working in IE browser!

Posted 13 January 2010 - 01:31 AM

If it's not working in one browser but working fine in another, it's not a PHP issue. Should be moved to javascript and/or HTML and CSS sections.

My bet is on javascript.
Was This Post Helpful? 0
  • +
  • -

#6 przemass   User is offline

  • D.I.C Head

Reputation: 30
  • View blog
  • Posts: 166
  • Joined: 18-July 09

Re: Not working in IE browser!

Posted 13 January 2010 - 02:37 AM

Try this:
<?php if ($_POST['submit']=='login') { 
	echo "Hi";
	}
?>
<form name="form1" method="post" action="">
<input type="hidden" name="submit" value="login"/>
<input type="image" src="button_ok.gif"/>
</form>


I dodn't tested but should work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1