Zubrag.com
September 19, 2019, 09:19:02 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: PHP password_protect.php  (Read 14659 times)
tdeebulling
Newbie
*
Posts: 3


« on: April 01, 2007, 10:09:34 PM »

First of all I want to say thank you for this script.  I have spent close to a week trying to code my own php password check and could not get it to work properly.  I downloaded this script and had it working in under 15 minutes.  Now I would like to know if there is a way to make the page that contains the form for entering the password a little smaller.  It is a huge page and the form just shows up in the upper left hand corner.  I'd like for a page that is just slightly larger than the form to open in or near the center of the current web page.  I know that that is probably a JavaScript thing, but I don't know JavaScript very well yet.  I have a script that I used on another page that opens a 300 x 300 window, but when I tried pasting it into the php code it made the password protection stop working.  I'm sure it probably has something to do with not closing the php tags properly.  But, I just couldn't get it to work.  Can you help me with that?
Thanks,
tdeebulling

Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #1 on: April 02, 2007, 03:31:38 AM »

It is not fully clear to me what you are trying to achieve. Could you attach a picture (its Attach field below the message entry area when you are posting message) with example of how you want it to be?
Logged
tdeebulling
Newbie
*
Posts: 3


« Reply #2 on: April 02, 2007, 09:05:05 PM »

I just want the broswer window to be smaller.  As it is now, the login form looks lost in a huge expanse of white page.  I would like the browser window that contains the login form to be just slightly larger than the form. For example, my browser window is 760+ pixels wide and the form is only maybe 300 pixels wide.  I would like the browser window to be 300 x 300 pixels instead of 760+ x 500 or something like that.  I know that it can be done in JavaScript - you can specify the size of the window you want to open.  I just can't figure out how to combine the javaScript with the php.  I also can't figure out how to attach an image or I would. 
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #3 on: April 03, 2007, 04:46:55 AM »

Are you opening login form in separate window? If yes then use following javascript to open window:
window.open ("http://www.yoursite.com/path/to/page", "mywindow","location=1,status=1,scrollbars=1,width=100,height=100");

Above javascript code will open 100x100 window. Remember to change domain/path.

If you want to resize already opened window then add following javascript code in password_protect.php, just before the </head>:

<script language="JavaScript">
<!--
w = 100; // width
h = 100; // height
window.resizeTo(w,h);
//-->
</script>
Logged
tdeebulling
Newbie
*
Posts: 3


« Reply #4 on: April 03, 2007, 09:12:37 PM »

Thank you so much.  That is exactly what I needed.  I used the first script to resize the new window that I was opening to make it smaller.  Then I had to add the same script again once the protected page opened, because it was opening at the same small size as the login page.  So I just added the script to the password protected file and gave it a new, larger size. 
This is perfect!!!  Thank you, thank you, thank you!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC