Jump to content

[SOLVED] Input type="image" Doesn't Work in Opera to Submit Data to PHP?


Recommended Posts

Ok so I have probably the most annoying problem on my hands I have ever run into in my PHP scripting!! I am making a website and the login submit button is a simple <input type="image" etc.> that submits the login form and logs you in! It works in EVERY browser except Opera!!! Well atleast I've tried Safari, Firefox, and Internet Explorer and it worked in all of them just fine...

 

Anyway, the exact code of my input button is:

<input type="image" value="Login" name="submit" src="images/login.jpg">

 

Then at the top of the page is the whole login which includes the "if (isset($_POST['submit']))" and all that good stuff that sets the cookies and logs you in.... So it works in ALL browsers except Opera! WHY?!?! I would post the URL for the website here but since it's not done I really can't....

 

The problem I am getting in Opera: The page basically just refreshes. Nothing is submitted and no cookies are set. The only reason the page refreshes is because the form action tells it to.

Oh sorry! guess i forgot to mention that.. It's basically just refreshing the page... Nothing seems to be submitted and no cookies are set. The only reason the page refreshes is because the form action tells it to.

OMG YES IT WORKS!! thank you so much!!!!

 

There was however a slight error with your code. You were missing 2 ('s Heres the fixed version for anyone who copies and pastes that:

if(isset($_POST['submit']) || (isset($_POST['submit_x']) && (isset($_POST['submit_y'])))) {
    //your code
}

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.