Zubrag.com :: Forum

zubrag.com => Password Protect => Topic started by: asirish on February 07, 2007, 11:59:43 AM



Title: inserting into my webpage design
Post by: asirish on February 07, 2007, 11:59:43 AM
is it possible to insert the password request page into my web page template? When i try to do this none of my images show up. my page is in html format, does this have something to do with it? thanks for your help.


Title: Re: inserting into my webpage design
Post by: zubrag on February 07, 2007, 12:14:20 PM
Yes, it is possible.

Look how password protector was implemented into site design:
Design Brand  - Product Design Consultancy in Wellington, New Zealand (http://designbrand.co.nz/password_protect.php)
Lives for Sale (http://www.livesforsale.com/partners.php)


Login form in the password_protect.php is:

Code:
<html>
<head>
  <title>Please enter password to access this page</title>
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
</head>
<body>
  <style>
    input { border: 1px solid black; }
  </style>
  <form method="post">
    <h3>Please enter password to access this page</h3>
    <font color="red"><?php echo $error_msg?></font><br />
<?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'?>
    <input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" />
  </form>
  <br />
  <a style="font-size:9px" href="http://www.zubrag.com/scripts/password-protect.php" title="Download Webpage Password Protect">Powered by Password Protect</a>
</body>
</html>


Instead of above code insert your custom html code, and insert following in the place where you want login form:

Code:
  <style>
    input { border: 1px solid black; }
  </style>
  <form method="post">
    <h3>Please enter password to access this page</h3>
    <font color="red"><?php echo $error_msg?></font><br />
<?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'?>
    <input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" />
  </form>
  <br />
  <a style="font-size:9px" href="http://www.zubrag.com/scripts/password-protect.php" title="Download Webpage Password Protect">Powered by Password Protect</a>

also insert following code somewhere between <head> and </head> tags:
Code:
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">


You may also need to add following tag if you have relative paths for images or urls in html code.
Code:
<BASE href="http://www.site-name-here.com/">


Title: Re: inserting into my webpage design
Post by: asirish on February 07, 2007, 06:28:50 PM
thank you so much...this is REALLY GREAT!!!!



Title: Re: inserting into my webpage design
Post by: Vikestart on November 24, 2007, 01:49:11 PM
Okey, I have seen tha the login form has comed, but how to add users with the passwords. And is it possible that the visitors can register without that the WebMaster have to write it up. When they register, the account comes auto...


Title: Re: inserting into my webpage design
Post by: zubrag on November 26, 2007, 04:59:09 AM
If you want user sign up then use advanced password protect (http://www.zubrag.com/scripts/password-protect-advanced.php) instead of this simple one.


Title: Re: inserting into my webpage design
Post by: themikeyd on December 15, 2007, 05:23:19 PM
Hi guys,
Awesome script, been using it for ages and passed it to many other (brown nose etc)

I saw this thread and had ago but can't get it to work.I have an home page with the sign up form on, but when I click on the protected page it still asks me for the user name and password from the original form. I have probably messed up or misinterpreted ur instructions, but I would love some advise.

Mike


Title: Re: inserting into my webpage design
Post by: okay on January 27, 2008, 02:51:57 PM
I'm trying to understand the example above for integrating the form into my web page but it doesn't make sense to me?? I've tried many different ways to get it to work but nothing seems to do it.

I have the (or want) the login form in my header. I have an includes calling the header into my pages.

Anyone who got it to work this way care to explain?


tnx


Title: Re: inserting into my webpage design
Post by: julianrob77 on February 01, 2008, 04:01:32 AM
hi guys

got all this working nicely as well but there is one thing missing.

ive integrated the login using iframe (i found its easier to control it that way) but all i want is a new window to open onsubmit of the login. thus far ive tried using java and HTML commands in the script at that point, and no new window opens with my members page. bit of a puzzle

if you can help that would be great. otherwise i will re-program the site as you have suggested and get rid of iframe, its just nice to have it there- on my old site, this means that the members area is integrated into the site the way we wanted, but now im after something different.

J


Title: Re: inserting into my webpage design
Post by: dsimk2002 on October 17, 2008, 02:57:59 PM
Use <form method="post" target="_new">.....</form>


Title: Re: inserting into my webpage design
Post by: andrewr on May 13, 2010, 08:22:14 PM
Has anyone else had formatting issues with internet explorer?  All other browsers look okay. 

I can't seem to figure out what is going on, it seems like there is an additional border around each of my graphics that I am unable to remove.  Also my centering div using margin-left: auto; margin-right: auto; isn't working.

Any help would be greatly appreciated.

here is the example page, it displays correctly in every browser except IE:

http://www.greatroofingcentral.com/test.php


Title: Re: inserting into my webpage design
Post by: camado on June 18, 2010, 03:35:08 PM
I got this to work by inserting the html from my login page into the password_protect.php file and using an external style sheet. My login page is very simple and has very little html. What is the recommended solution for a complex page with a login? Is there a way to call the password_protect file from the homepage so that I can insert the login form into my webpage?

An earlier post had mentioned having a login in the header of his page. Was a solution found for this?


Title: Re: inserting into my webpage design
Post by: mnkhaki on December 21, 2011, 12:28:10 AM
Hi Zubrag

I need to insert the form into the website I am creating - however, if I place the code you mention, where do I call the secure page or have it directed to the secure page(s)?

Thank you!

mnkhaki


Title: Re: inserting into my webpage design
Post by: zubrag on December 28, 2011, 04:08:44 AM
You don't have to call or redirect to secure page. The only thing you do is add protection line of code (the one you'll get when open script with help parameter, like password_protect.php?help=1) to all pages you'd like to protect.

When a user opens your protected page in a browser, the first thing it does is verifying login/password (because your protected page has protection code added at the top). At this point it either shows login form (if not logged in), or gives control back to your page (if already logged in).

So every page you'd like to be protected must have protection code at the top, and password_protect.php will either show your page or login form.


Title: Re: inserting into my webpage design
Post by: wedesignstudio on May 11, 2012, 02:57:59 PM
Zubrag,

Thanks you for the great script.

My question is does the above integration apply to the advanced script. I have set up the advanced the same way on my index page, when logged in with the user/password I am directed to a blank page, still on the index.

If I set an "action=" to the secured page, if the user clicks the submit button with blank user/pw it forwards to login.php. I would like to remain at the index page. If the user/pw are filled correctly it forwards to the secure page.

Could you let me know if I am missing something, let me know if you need more info... thanks


Title: Re: inserting into my webpage design
Post by: ragtech on August 13, 2012, 04:12:01 PM
When I input the above/below meta tags I receive validation errors (W3C Validation Service (http://validator.w3.org/)).

Code:
  <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
  <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">


Is there an HTML5 Equivalent?


Regards,
~ragtech
U.S. Website Creations (http://www.uswebsitecreations.com/)


Title: Re: inserting into my webpage design
Post by: twd on July 08, 2013, 10:06:52 AM
This code works great, except in IE and in Safari.
In IE after entering the correct password it jumps to the index page, not the protected page. If I then click the 'protected' page it appears normally. What needs to be done to stop it jumping to the index page?
In Safari after entering the correct password the screen goes blank and you have to re-enter the webaddress - the 'protected' page then appears !
Thanks for any help.


Title: Re: inserting into my webpage design
Post by: kalsi465 on July 11, 2016, 12:30:36 AM
good