Jump to content

Archived

This topic is now archived and is closed to further replies.

cipriani

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

Recommended Posts

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: [url=http://www.phoenixstyles.com]http://www.phoenixstyles.com[/url]

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>";
}
?>[/code]

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='''[/code]

Not using PHP, it would look like this and it works:

[code]onfocus="this.value=''"[/code]

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 post


Link to post
Share on other sites

×

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.