PhP and Java login trouble
| From: | Brad Sumrall | Date: | Wed, 09 May 2007 01:55:34 +0000 |
| Subject: | PhP and Java login trouble | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-254621@lists.php.net to get a copy of this message | ||
I am trying to create a commonlogin.php which would perform a duel login for
phpbb and a java based FCKEditor combined
I have working code for each as an individual but not a clue how to combine
them.
Does anyone have any suggestion on where I can go for information about
this?
Brad
Working phpbb code:
<?php
if(!isset($_SESSION["userid"]))
{
?>
<form action="/phpbb/login.php" method="post" target="_top">
<input type="text" class="post" name="username" size="25"
maxlength="40"
value="" />
<input type="password" class="post" name="password"
size="25" maxlength="32"
/>
:</span></td>
<input type="hidden" name="redirect" value="" /><input
type="submit"
name="login" class="mainoption value="Log in" />
Working Java code
<form name="frmlogin" method="post" onsubmit="return
validatelogin()">
<input type="hidden" name="login" value="">
<input name="txtusername" type="text" size="25"
class="textfield" />
<input name="txtpwd" type="password" size="25"
class="textfield" />
<input type="image" src="images/login_btn.jpg" title="Login"
name="login">
<script language="javascript">
function validatelogin()
{
if(document.frmlogin.txtusername.value=="")
{
alert("Please Enter Username.");
document.frmlogin.txtusername.focus();
return false;
}
if(document.frmlogin.txtpwd.value=="")
{
alert("Please Enter Password.");
document.frmlogin.txtpwd.focus();
return false;
}
document.frmlogin.login.value="Success";
document.frmlogin.action="operation.php?mode=login";
return true;
}
function logout()
{
if(window.confirm("Are you sure you want to log
out."))
{
window.location.href="operation.php?mode=logout";
}
}
</script>