A few centering issues and "onfocus" problem in PHP, particularly with IE

Discussion in 'Customization & add-ons' started by phoenix, Sep 5, 2006.

  1. phoenix

    phoenix New Member

    Joined:
    Aug 22, 2006
    Messages:
    2
    Hey guys, I just added the login script to the top of my template so customers can login from any page at any given time.

    Take a look: http://www.phoenixstyles.com

    Okay, so basically I'm having a problem positioning this so the login fields and the button align better inside the table below the "Customer Login" picture and above the "Navbar Shine" thing. Basically, where the fields are, if you view it in Internet Explorer, you'll notice the form fields are at the top of the table, which I don't want, and using valign and margin-top doesn't work because it pushes the login down too far and the background which is set to 39 pixels I believe can't be doubled...and at the same time, the latest news frame is supposed to fit in that position, again it can't be pushed down for that as well.

    Here's the PHP I'm currently using for the login. I'm not PHP guru by any means, so bare with me if I've gone and done something extremely noobish...perhaps you can take a look, bceause on IE I am also receiving a "Done, but with errors on page"

    Code:
    <?php
    session_start();
    if ($au=$_SESSION['_amember_user']){ 
      print "<center><font face='verdana' size='1' color='#CCCCCC'>Hello <b>$au[name_f] $au[name_l]</b></font></center>";
      print "<center><font face='verdana' size='1' color='#CCCCCC'><a href='/members/member.php'>Customer Page</a> <a href='/members/logout.php'>Logout</a></center>";
    } else { // user is not logged-in
      print "<center><form method=post action='/members/login.php'>
      <table width='240' border='0' cellspacing='0' cellpadding='0'>
        <tr>
          <td valign='middle'><div align='center'>
            <input type=text name=amember_login size=14 value='Username' style='font-family: Verdana; font-size: 10px; color: #CCCCCC; background-color: #282828; border: 1px solid #777777; overflow: hidden;' onfocus='this.value=''' />
          </div></td>
          <td valign='middle'><div align='center'>
            <input type=password name=amember_pass size=14 value='Password' style='font-family: Verdana; font-size: 10px; color: #CCCCCC; background-color: #282828; border: 1px solid #777777; overflow: hidden;' onfocus='this.value=''' />
          </div></td>
          <td valign='middle'><div align='right'>
            <input name='image' type=image value='Login' src='http://www.phoenixstyles.com/images/b_login.gif' />
          </div></td>
        </tr>
      </table>
    </form></center>";
    }
    ?>
    Another slight problem I get is where I have the "onfocus" tag in the input for the buttons. What this is for those unfamiliar with it, is when the user clicks the box, the value where it says "username" and all the little ****'s are removed on one click so they can simply type their login information without manually clearing anything. However, using PHP, because I can't have the use of a double quote ( " ), when I use the following tag, it doesn't seem to work (using all single quotes ( ' ))

    Code:
    onfocus='this.value='''
    Not using PHP, it would look like this and it works: (I made the double quotes red so they're easy to distinguish)

    Code:
    onfocus=[COLOR="Red"]"[/COLOR]this.value=''[COLOR="Red"]"[/COLOR]
    I hope you guys can help me out, at least with a few of my problems...I'm not sure the cause of the "Done, but with errors on page" in IE, I can't seem to figure out the problem...there isn't one technically, because it logs in fine and stuff, it just looks really bad having that error at the bottom of the page.

    Thanks,

    Alex

Share This Page