Browswer problems

thenewprogrammer

New Member
Messages
45
Reaction score
0
Points
0
Wondering how to fix browser problems. Using a login, which works fine for my computer and internet explorerer but not in mozilla or my friends computer doesnt work the same. The login box is there but he cannot type anything in there. Wondering if this is common browser problem and what would cause it. If i need to post code or if you know from experience.
 

Mr. DOS

Member
Messages
230
Reaction score
5
Points
18
We'll need to see the HTML of the form, as well as any associated JavaScript.

--- Mr. DOS
 

playminigames

New Member
Messages
216
Reaction score
6
Points
0
yea, its really hard to try and fix something without seeing some code, or something similar. Hope you can help us help you!
 

thenewprogrammer

New Member
Messages
45
Reaction score
0
Points
0
Its in php tags and echo'd out. I know i can use only one echo but this made it easier to read for me.
Code:
<?php 
if(!$session->logged_in){
echo "<form action=\"loginsystem/process.php\" method=\"post\" ><table align=\"left\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
 <tr><td>&nbsp; &nbsp; &nbsp;Username:</td><td><input type=\"text\" name=\"user\" size=\"13\" maxlength=\"30\" value=\"";
echo $form->value("user"); 
echo "\" /></td><td>";
echo $form->error("user"); 
echo "</td></tr><tr><td>&nbsp; &nbsp; &nbsp;Password:</td><td><input type=\"password\" name=\"pass\" size=\"13\"maxlength=\"30\" value='";
echo $form->value("pass"); 
echo "' /></td><td>";
echo $form->error("pass"); 
echo "</td></tr><tr><td colspan=\"2\" align=\"left\">&nbsp; &nbsp;<input type=\"checkbox\" name='remember' /";
if($form->value("remember") != ""){ 
 echo "checked"; };
  echo ">&nbsp; Remember me next time <br /><input type=\"hidden\" name=\"sublogin\" value=\"1\" />
   &nbsp; &nbsp; &nbsp;<input type=\"submit\" value=\"Login\" /></td></tr><tr><td colspan=\"2\" align=\"left\"><br />
   <font size=\"2\">&nbsp; &nbsp; &nbsp;[<a href=\"loginsystem/forgotpass.php\" >Forgot Password?</a>]</font></td><td align=\"right\">
   </td></tr><tr><td colspan=\"2\" align=\"left\">&nbsp; &nbsp; &nbsp; Not registered? <a href=\"loginsystem/register.php\" >Sign-Up!</a>
   </td></tr></table></form>";
  }?>
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Would you also post a link to a live page, and a more explicit description of the expected and actual behaviors?

Edit:
The first problem I notice is in the line:
PHP:
echo "</td></tr><tr><td colspan=\"2\" align=\"left\">&nbsp; &nbsp;<input type=\"checkbox\" name='remember' /";
The last "/" is for a self closing tag. If $form->value("remember") != "", then the "checked" attribute you later print is coming after the "/", resulting in invalid HTML.

You can also write the code with no echos, which you may find more readable:
HTML:
<?php 
if(!$session->logged_in){ ?>
    <form action="loginsystem/process.php" method="post" >
        <table align="left" border="0" cellspacing="0" cellpadding="3">
        <tr><td>&nbsp; &nbsp; &nbsp;Username:</td>
            <td><input type="text" name="user" size="13" maxlength="30" value="<?php echo $form->value("user"); ?>" /></td>
            <td><?php echo $form->error("user"); ?></td></tr>
        <tr><td>&nbsp; &nbsp; &nbsp;Password:</td>
            <td><input type="password" name="pass" size="13"maxlength="30" value="<?php echo $form->value("pass"); ?>" /></td>
            <td><?php echo $form->error("pass"); ?></td></tr>
        <tr><td colspan="2" align="left">&nbsp; &nbsp;<input type="checkbox" name='remember' 
    <?php
    if ($form->value("remember") != "") { 
        echo "checked"; 
    }
    ?>>&nbsp; Remember me next time <br /><input type="hidden" name="sublogin" value="1" />
   &nbsp; &nbsp; &nbsp;<input type="submit" value="Login" />
            </td></tr>
        <tr><td colspan="2" align="left"><br />
                <font size="2">&nbsp; &nbsp; &nbsp;[<a href="loginsystem/forgotpass.php" >Forgot Password?</a>]</font></td>
            <td align="right"> </td></tr>
        <tr><td colspan="2" align="left">&nbsp; &nbsp; &nbsp; Not registered? <a href="loginsystem/register.php" >Sign-Up!</a></td></tr>
        </table>
    </form>
<?php } ?>

Don't use a table based layout, nor should you use "&nbsp;" for layout. You can usually find a better way than using <br />.
 
Last edited:

thenewprogrammer

New Member
Messages
45
Reaction score
0
Points
0
Your way for code makes it much easier to read, thanks :) but problem is still there. In internet explorer 8 i can type text in the input field however in mozilla firefox its completly locked. The input boxes are there but i cannot type anything in.
 

thenewprogrammer

New Member
Messages
45
Reaction score
0
Points
0
Just found the problem :). It was z-index: -1 in css. The div was inside another div which caused the problem to overlap or something like that. Thanks for the advice on how to post form without echoing.
 
Top