Jump to content

Recommended Posts

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" />

 

 

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)) {

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.

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.