0

Hi, I have this login form

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin login</title>
<link href="../css/submit.css" rel="stylesheet" type="text/css" />
<link href="../css/template.css" rel="stylesheet" type="text/css" />
<body>
   <img alt="full screen background image" src="../images/background.jpg" id="full-screen-background-image" /> 
   <a href='../php/index.php'><span class="adminlinks">Home</span></a>

   <form class="form" action="login.php" method="post" enctype="multipart/form-data" name="login_form" id="login_form" style="margin-bottom:0px;">
<h1 style="margin-bottom: 0px">Admin Login</h1>
<p><input type=text name="user" /> <b>User Name</b></p>
<p><input type=text name="pass" /> <b>Password</b></p>


<input type="submit" name="submit" value="Login" />
<input name="login_form" type="hidden" id="login_form" value="login_form" />
</form>

</body>
</html>

The form sends login details to login.php for proccesing.
My question is this, how can I get the form to be in a popup box when I type www.mysite/admin into the address bar?. At the minute the form is just held in a web page.

Thanks for looking..................

2
Contributors
3
Replies
8
Views
4 Years
Discussion Span
Last Post by GlenRogers
0

If you manually key in the URL in a browser window, the page will open as any other. If you call the login form from an existing page, one option is to use javascript to open a small browser window that's customized...

JavaScript Window.Open

window.open(url,name,features,history)

HTML Example - Popup

<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
  function openWindow() {
    myWin = window.open('', '', 'width=400,height=300');
    myWin.document.write("Hello!");
  }
</script>
</head>
<body>

<input type="button" value="Open Window!" 
    onclick="openWindow()" />

</body>
</html>

more info.. JavaScript Open Windows and Popups

Edited by JorgeM

0

Thanks for that.
After a search I decided to password protect my whole 'admin' dir.
I used a .htaccess file and a htpasswd file. I put both in my 'admin' dir.
But I keep getting this error when I try to loginin. (I'm using wampserver)
'Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.'

This is my htaccess file

AuthType Basic  
AuthName "Admin Login"  
AuthUserFile /localhost/website/admin/.htpasswd  
require valid-user

This is my htpasswd file (with user and password changed)

user:pass

Can anyone shed any light on this?

Thanks..

0

I finally got it, the path was wrong!
This now takes me to the dir listing, but is there any way i can get it to take me to a certain file within the dir. I would like it to open 'admin.php'

Thanks for looking.......................

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.