phaltu420
01-27-2009, 03:28 PM
dear readers,
the code below belongs to a form where users can input their username and password to login to their webmail service.
it uses target="_blank" to open the new window for the logged in users. it also opens a new window even if the login information is incorrect. whereas it should be remaining in the current window displaying an error msg "Your login attempt failed!" without opening a new window.
As you can guess, I am not very good in this.
i posted it here cause maybe javascript may be introduced to solve this.
help me out please.
regards,
karim
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center><table width="200" border="0" cellspacing="2" cellpadding="0"><tr><td bgcolor="000000" width="100%" align=center><span class="grey"><font face=arial size=4><b>WebMail</b></span></font></tr></td></table></center><br>
<br><br><br><center>
<form action="Login.php" method="POST" target="_blank">
<?php
// Show an error if the login failed
if(($_GET['failed'] == "1") or ($error == 1)){
echo '<font color="#FF0000">Your login attempt failed!</font><br />';
}
?>
<input type="hidden" name="domain" value="domain.com" size="20" /><br />
<font face=arial size=2><b>Username: </b></font><input type="text" name="username" value="" size="20" /><br />
<font face=arial size=2><b>Password: </b></font><input type="password" name="pass" value="" size="20" /><br />
<?php
echo '<input type="hidden" name="failurl" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?failed=1">';
?>
<select name="port" style="display:none;">
<option value="2095">Webmail</option>
<option value="2096">Secure Webmail</option>
</select><br />
<input type="submit" value="Login" />
</form>
<br><br><br></center>
</body>
</html>
the code below belongs to a form where users can input their username and password to login to their webmail service.
it uses target="_blank" to open the new window for the logged in users. it also opens a new window even if the login information is incorrect. whereas it should be remaining in the current window displaying an error msg "Your login attempt failed!" without opening a new window.
As you can guess, I am not very good in this.
i posted it here cause maybe javascript may be introduced to solve this.
help me out please.
regards,
karim
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<center><table width="200" border="0" cellspacing="2" cellpadding="0"><tr><td bgcolor="000000" width="100%" align=center><span class="grey"><font face=arial size=4><b>WebMail</b></span></font></tr></td></table></center><br>
<br><br><br><center>
<form action="Login.php" method="POST" target="_blank">
<?php
// Show an error if the login failed
if(($_GET['failed'] == "1") or ($error == 1)){
echo '<font color="#FF0000">Your login attempt failed!</font><br />';
}
?>
<input type="hidden" name="domain" value="domain.com" size="20" /><br />
<font face=arial size=2><b>Username: </b></font><input type="text" name="username" value="" size="20" /><br />
<font face=arial size=2><b>Password: </b></font><input type="password" name="pass" value="" size="20" /><br />
<?php
echo '<input type="hidden" name="failurl" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?failed=1">';
?>
<select name="port" style="display:none;">
<option value="2095">Webmail</option>
<option value="2096">Secure Webmail</option>
</select><br />
<input type="submit" value="Login" />
</form>
<br><br><br></center>
</body>
</html>