• Login to Protected Secure Areas

  • PHP-SecureArea

    PHP-SecureArea allows you to create portected areas of a web site using PayPal recuring payments.

    To enable the customer to login to the secure area, an email is send with a url which you enter into the email template in the Global Set Up admin page. The customer will receive this url when they purchase the subscription.

    This url is usually the index page within the secure area. So on my web site this would be:


    Entering this into the web browser will give a standard Basic Authentication pop up window where they enter the username / password.

    If you wish to have a better looking log in box then you may use the pages in the folder /logincustomer/.

    The sample page login.html uses Javascript to add an html form interface for the protected area.

    You can see that the page contains a javascript file httpauth.js. You place an href link to the secure area in the body of the page.

    In my example this is :

    <a class="httpauth" id="basic" href="https://www.withinweb.com/phpsecureareav295/logincustomer/login.html">Log in by clicking here</a>

    Make sure that you have a class of "httpauth" and in the href you must place your own url of course.

    When the page is loaded, it checks the browser type and displays a username / password form on the page. Authentication with an html form does not work for Safari and Opera browsers, so in those cases the normal href link is displayed. Also, if Javascript is not enabled in the browser, the normal href link is displayed.

    Click here for an example html form on my web site

    Incorporate the javascript file and the href link into any of your web pages giving you a better looking log in box.

  • PHP-SecureArea

    Customer admin pages

    The administration pages for the customer allow viewing of current subscription details, changing password and recovering a lost password.

    The customer admin pages are located at /login/index.php

    An example of the front page of the customer admin pages can be seen at:


  • PHP-SecureArea

    Language file

    The customer administration pages incorporate a language file (signup/lang/file.php) where each displayed item such as button names, error messages, email subject and body text and other descriptive text may be modified. This provides a means to easily change the language of the pages.

  • PHP-SecureArea


    The login contains a captcha facility where the subscriber has to enter letters before they subscribe. This is configured at the top of signup/lang/file.php. To stop using captcha, set the variable to false.

    Note that to use captcha, you need GD Graphics Library compiled with your PHP.

  • PHP-SecureArea


    Each of the customer administration pages has a header and a footer (login/includes/header.php and login/includes/footer.php) which can be modified to customize the display.

    Also, you may change the css styles in header.php to further customize the displays.

  • Customer registration pages

    The customer registration pages located in the /signup/ folder can be modified to make certain entries optional or to remove them all together. You can also change the text on the sign up by changing the language file located at /lang/file.php. So for example you may want the age of the person instead of the mobile phone number, just change the text in /lang/file.php

    Each label has a class which can be class="required" meaning that the entry box is required. Remove that class and it becomes optional.

    You can also have a label of class="nocontent"

    The switch(obj.name) defines the error mask to be displayed.

    Note that the Javascript code is client side validation and so it is necessary to have server side validation as well. Server side validation is done in the script /scripts/server_side_validation.php. The server side validation consists of a set of data that is passed in followed by a set of flags to identify if validation is required or not. This validation script must match the validation that you require.