Jump to content

Form command problems..


toasterthegamer

Recommended Posts

I've got a problem with the form command on my website it's really killing me and I need to know why this code wont work!!This version wont work in IE or Firefox as you can see here on my website:http://nanotech.pcriot.comJust type random stuff you should get a error message saying wrong user name and password but it just takes you to the login screen for the forum....

<?phpif( !$userdata['session_logged_in'] ) // Is the user NOT logged in?   {	  ?>					<h2 class="login"><em>user</em>login</h2>					<form action="forum/login.php" method="post" id="login">						<div id="login-username">							<div><label for="username">username</label>: <input type="text" id="username" /></div>							<div><label for="password">password</label>: <input type="password" id="password" /></div>						</div>						<div id="login-button">							<input type="hidden" name="redirect" value="../index.php" />							<input type="image" src="images/btn_login.gif" value="login" />						</div>						<div class="clear">							<div class="reg">								New User? <a href="http://nanotech.pcriot.com/forum/profile.php?mode=register">REGISTER for FREE</a>							</div>						</div>					</form>	  <?php   }if( $userdata['session_logged_in'] ) // Is the user logged in?   {	$appendLogout = $u_login_logout = $phpbb_root_path.'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; // Add the session ID to the logout link	echo "<center>Welcome back, <a href=\"forum/profile.php?mode=viewprofile&u=".$userdata['user_id']."\" title=\"".$userdata['username']."\">".$userdata['username']."</a>!<br />"; // Show a welcome message	echo "<a href=\"forum/privmsg.php?folder=inbox\" title=\"You have ".$userdata['user_unread_privmsg']." new messages\">(".$userdata['user_unread_privmsg'].") New Messages</a><br />"; // Any new PMs?	echo "<a href=\"forum/profile.php?mode=editprofile\" title=\"My Profile\">My Profile</a><br />"; // Edit your profile link	echo "<a href=\"".$appendLogout."\" title=\"Logout\">Logout</a><br />"; // Logout link   } // end if, if you want you could add a login form in an else statement below?>

This one works in Firefox and IE!!

<?phpif( !$userdata['session_logged_in'] ) // Is the user NOT logged in?   {	  ?><form action="forums/login.php" method="post" name="login"> <!-- Show a simple login form --><input type="text" name="username"><br /><input type="password" name="password"><br /><input type="hidden" name="redirect" value="../index.php"> <!-- Redirect the user to a page different than the PHPBB2 index page. You can delete this if you want. The path must be relative from the PHPBB2 login file. --><input type="submit" value="login" name="login"></form>	  <?php   }if( $userdata['session_logged_in'] ) // Is the user logged in?   {	$appendLogout = $u_login_logout = $phpbb_root_path.'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; // Add the session ID to the logout link	echo "<center>Welcome back, <a href=\"forum/profile.php?mode=viewprofile&u=".$userdata['user_id']."\" title=\"".$userdata['username']."\">".$userdata['username']."</a>!<br />"; // Show a welcome message	echo "<a href=\"forum/privmsg.php?folder=inbox\" title=\"You have ".$userdata['user_unread_privmsg']." new messages\">(".$userdata['user_unread_privmsg'].") New Messages</a><br />"; // Any new PMs?	echo "<a href=\"forum/profile.php?mode=editprofile\" title=\"My Profile\">My Profile</a><br />"; // Edit your profile link	echo "<a href=\"".$appendLogout."\" title=\"Logout\">Logout</a><br />"; // Logout link   } // end if, if you want you could add a login form in an else statement below?>

I found out that this is the problem<input type="image" src="images/btn_login.gif" value="login" /> So how do I make it so that I can have a image button in IE and firefox???Thanks for any help!!

Link to comment
Share on other sites

Here is the button that works:<input type="submit" value="login" name="login">Here is the one that doesn't:<input type="image" src="images/btn_login.gif" value="login" />Let me guess. In login.php you're checking if $_POST['login'] is set, aren't you? You'll find out that this doesn't have anything to do with which browser you use or which type of submit button you use.

Link to comment
Share on other sites

Here is the button that works:<input type="submit" value="login" name="login">Here is the one that doesn't:<input type="image" src="images/btn_login.gif" value="login" />Let me guess. In login.php you're checking if $_POST['login'] is set, aren't you? You'll find out that this doesn't have anything to do with which browser you use or which type of submit button you use.
Hmm honestly I dont know what is in login.php it's a phpBB board login system but the problem here is with that stupid <input> command I found a way to make it work in both IE and firefox with the <button> command but it looks ugly!! :) sigh.. I am going to look over the HTML <form> commands again see if theres something I missed..
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...