Jump to content

Java/PHP Login Form In Popup Window


Antec

Recommended Posts

I am having trouble getting this code to work correctly. What I am trying to do is on my site i will have a button that will open this popup window with a login form and what i would like it to do is when the form is submitted i want the window to close and the main page to redirect to whatever page i would like it sent to. And if the login information is wrong i would like the popup window to stay open and say that it is wrong in red letters at the top.

 

Here is the code for the popup window:

 

<?php
if($target == "LogIn") {

if($view == "Form") {
echo '
<script language="JavaScript" src="window.js">
</SCRIPT>
<style type="text/css">
<!--
body {
background-color: #000000;
}
-->
</style>
<FORM action="index.php?act=Login&CODE=50" onSubmit="javascript:login();" method="post" name="mlogin">
  <p>
    <font face="verdana" color="#76a5d5" size="1"><B> Username: </b></font><INPUT class="textInput1" style="border: 1px solid #76A5D5; font-family: verdana, helvetica, sans-serif; font-size: 11px; padding: 2px; vertical-align: middle; margin: 0; width: 80px" type="username" size="25" name="username" value="Username"/>
    <br>    
    <FONT face="verdana" color="#76a5d5" size="1"><B> Password:  </b></font><INPUT class="textInput1" style="border: 1px solid #76A5D5; font-family: verdana, helvetica, sans-serif; font-size: 11px; padding: 2px; vertical-align: middle; margin: 0; width: 80px" type="password" size="25" name="password" value="*******"/> <INPUT type="image" src="images/login.jpg" ALT="Click Here to Login!" BORDER="0" ALIGN="middle" value="submit" name="submit">
  </p>
</form>';
}
}
?>

 

Code for the javascript:

 

//Open up a new window with specific dimensions
function info(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=300,height=100,left = 300,top = 500');");
}

<!--
function login() {
	setTimeout('window.close()',2000);
	opener.location.href='/main/index.php';
}
//-->

 

Any help would be greatly appreciated

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.