exelGram Posted May 13, 2009 Share Posted May 13, 2009 Hello, The home page of my current project uses 2 image input buttons for styling purposes: 1 'Login' button and 1 'Sign Up' button. Currently the buttons don't work in Internet Explorer 6 and 7, seemingly because they aren't recognizing the "value" attribute. When the user attempts to login, he is simply redirected to the index page. After seemingly trying everything and googling the problem for 2 days, I am unable to come up with a solution. Any help is greatly appreciated! Code follows: PHP Code <?php // *** Validate request to login to this site. if (!isset($_SESSION)) { session_start(); } $loginFormAction = $_SERVER['PHP_SELF']; if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck']; } if (array_key_exists('doLogin', $_POST)) { if (isset($_POST['username'])) { $loginUsername=$_POST['username']; $password=$_POST['password']; $MM_fldUserAuthorization = ""; $MM_redirectLoginSuccess = "USERprofile.php"; $MM_redirectLoginFailed = "indexfailed.php"; $MM_redirecttoReferrer = false; mysql_select_db($database_connUser, $connUser); $LoginRS__query=sprintf("SELECT username, password, activationkey FROM userTable WHERE username=%s AND password=%s AND status='activated'", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"), GetSQLValueString($status, "text")); $LoginRS = mysql_query($LoginRS__query, $connUser) or die(mysql_error()); $loginFoundUser = mysql_num_rows($LoginRS); if ($loginFoundUser) { if (isset($_POST['remember'])) { setcookie("cookname", $loginUsername, time() + 9999999, "/"); } $loginStrGroup = ""; //declare two session variables and assign them $_SESSION['MM_Username'] = $loginUsername; $_SESSION['MM_UserGroup'] = $loginStrGroup; if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl']; } header("Location: " . $MM_redirectLoginSuccess ); } else { header("Location: ". $MM_redirectLoginFailed ); } } } header("content-type: text/html; charset=UTF-8"); ?> The image input buttons are coded as follows: <input name="doLogin" type="image" value="Login" src="Images/buttonLogin.png"/> <input name="signUp" type="image" value="Sign Up" src="Images/buttonSignUp.png" /> Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 13, 2009 Share Posted May 13, 2009 http://www.phpfreaks.com/forums/index.php/topic,251696.msg1181697.html#msg1181697 http://www.phpfreaks.com/forums/index.php/topic,251696.msg1182620.html#msg1182620 Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/#findComment-832910 Share on other sites More sharing options...
MadTechie Posted May 13, 2009 Share Posted May 13, 2009 IE doesn't use the image values the same as FF, it append the XY positions a simple option would be to use GET ie <a href="blar.php?doLogin=Login"><img boader="0" src="Images/buttonLogin.png" /></a> if (array_key_exists('doLogin', $_POST)) { to if (array_key_exists('doLogin', $_GET)) { Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/#findComment-832914 Share on other sites More sharing options...
Andy-H Posted May 13, 2009 Share Posted May 13, 2009 Can be solved using if ( isSet($_POST['doLogin_X']) ) { //login } Although it will not submit if the user presses the enter key as the x/y value is returned on mouse click... Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/#findComment-832916 Share on other sites More sharing options...
MadTechie Posted May 13, 2009 Share Posted May 13, 2009 Not solved.. it will fail in FireFox! Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/#findComment-833537 Share on other sites More sharing options...
PFMaBiSmAd Posted May 13, 2009 Share Posted May 13, 2009 FF does send the x,y coordinates like the w3.org specification states. Once your code tests for the name_x or name_y variable, it will work in all browsers that are following the specification. mage Creates a graphical submit button. The value of the src attribute specifies the URI of the image that will decorate the button. For accessibility reasons, authors should provide alternate text for the image via the alt attribute. When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively. Quote Link to comment https://forums.phpfreaks.com/topic/157895-input-image-buttons-not-working-internet-explorer/#findComment-833633 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.