Avatar of themitch2004
themitch2004

asked on 

Submt variable not set in IE

I have a form which seems to work fine in Firefox but not so fine in IE6/7.

The form submits, via the POST method to itself. When I reload the page I check to see using the following code:

         if ( $_POST['Submit'] == 'submit' ) {

Lower down the page I have the submit button defined as follows:

        <input name="Submit" type="submit" src="images/savebtn.jpg" value="submit">

Originally I had the type set to image (hence the src attribute) but have just changed it to a submit type to see if it works better - as i say, it doesn't,

Before the button I have the form defined as ...

          <form name="budget" method="post" action="mybudget.php">

I am using PHPED to write this code and when I run it with the debugger and look at the variables, the $_POST['Submit'] variable isn't there. There is, however, a $_POST['Submit.x'] and $_POST['Submit.y'] variable.

Any idea why this isn't working.

Website is at www.jwedding.co.uk

Thanks
M

PHPHTML

Avatar of undefined
Last Comment
Computer101
Avatar of gamebits
gamebits
Flag of Canada image

$_POST['Submit.x'] and $_POST['Submit.y'] are the coordinate of the image in the src attribut
Avatar of themitch2004
themitch2004

ASKER

Thanks. But what has happened to $_POST['Submit']?
Avatar of gamebits
gamebits
Flag of Canada image

try $_POST['submit'] using the value instead of the name.
Avatar of themitch2004
themitch2004

ASKER

Thanks, but doesn't make a difference.
ASKER CERTIFIED SOLUTION
Avatar of gamebits
gamebits
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Just try this

if($_POST[])
 {
}

or

if($_POST)
{
}

one of these should work fine, i dont remember which one.

kiranvj
try this

echo($_POST['Submit'])

what is it echoing

kiranvj
Avatar of Computer101
Computer101
Flag of United States of America image

Forced accept.

Computer101
EE Admin
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo