OpenCrypt - Membership Software
Username:
Password:
Register / My Account / Forgotten Password?
 Home  Features and Benefits  Online Demonstration  Purchase  Our Services  Help and Support  my.OpenCrypt 
 Welcome  New Visitor  Latest NewsRSS Feed Company Information  Press/Testimonials  Frequently Asked Questions  BlogNew Content
Integrating OpenCrypt's PHP Login Interface
Friday 4th September 2009

If you wish to use OpenCrypt's PHP Login Interface to manage your logins, rather than the standard .htaccess pop-up login prompt, you must include login.php in the pages that you want to secure. The login.php file is found in your OpenCrypt 'php' directory.
 
Including login.php also enables OpenCrypt's logging and tracking to be used on each page, and enables you to access user and account details as PHP variables for use in your pages. It is recommended you include login.php in all of your pages, even those that aren't secured.
 
For guidance setting up OpenCrypt's PHP Login Interface, please see: http://www.opencrypt.com/faq.php?q=186
 
Details that can be included in your pages

To include details about the current user in your page, the following variables should be used:
    Username: $dbusername
    Email: $dbemail
    First Name: $dbfname
    Last Name: $dblname
    Subscription ID: $dbsub_id
    Account Active: $dbactive
    Account Created: $dbdate_opened
    Account Expires: $dbdate_expire
    Current Points Balance: $dbpoints
    Click here for further information.

If you are using custom form fields during the registration process, the data from these is available in an array, the key being 'field1' to 'field50', e.g. $dbfield['field1'] or $dbfield['field25'].
 
There will always be an up-to date list available in the OpenCrypt FAQ, which includes variables and details of how to add these fields to the standard OpenCrypt templates.
 
For future versions of OpenCrypt, simply browse the FAQ for the 'PHP Login Interface' category and select the latest revision.
 
Search Engines

If you wish to allow search engines to crawl your secure content, you can enable the SEO functionality of the PHP Login interface. This will enable crawler bots from all the major search engines (including Google, Searchme, Yahoo, Live and MSN) to access your secure content.
 
Firstly, setup an account in OpenCrypt called 'googlebot'. This will enable you to track the traffic from the bots directly from the OpenCrypt administration panel, enabling you to get a more detailed understanding of the traffic passing through your site.
 
To enable the search engine features of login.php, the following variable must be set before login.php is included in your page.
 
$login_seo = "1";
require "/path/to/login.php";
 
We recommend also printing the $header_html variable in your headers, as this prevents the bots from archiving your secure content (for example Google's cache feature) and therefore making it available to anyone. Alternatively, simply place the following tag in your HTML header:
 
<meta name="googlebot" content="noarchive">
 
Using login.php and the .htaccess login prompt simultaneously

If you are using both PHP and .htaccess options for user logins to the OpenCrypt system, then it is possible to setup login.php within a .htaccess member's area so the standard features of login.php are available even when it's not being used to manage user login. To do this, the following variable must be set before login.php is included in your page.
 
$login_popup = "1";
require "/path/to/login.php";
 
Shopping Basket

The shopping basket is another handy function provided by the OpenCrypt PHP Interface. The basic shopping basket is called from header.php with the following code:
 
if ($shopping_basket) {

print <<<END
<form action="$url_php/basket.php" method="get"
style="margin:0px">
<table cellpadding="8" cellspacing="0" border="0"><tr><td nowrap>
<span class="span_font_note">&nbsp;$shopping_basket&nbsp;</span>
</td></tr></table>
</form>
END;

}
 
The code for the shopping basket itself is located in the OpenCrypt /php/ directory, at the tail of the shopping.php file. Note the main shopping cart variables are included in this file.
 
$shopping_basket =<<<END
<b><a href="$url_php/basket.php" class="span_font_note">
Shopping Basket:</a></b>
$total_quantity item$print_s ($currency$total_price)&nbsp;&nbsp;
<input type="submit" value="Buy" name="submit"
class="cartbuybutton">
END;
 
A-Z-Animals.com Shopping Basket Amending these files, and the appropriate CSS for the class 'cartbuybutton' (in header.php) enables you to redesign the shopping basket as you require, to suit the look of your site. Some examples of this include OpenCrypt.com's shopping basket which uses a curved-edge and A-Z-Animals.com which uses an integrated shopping basket with an AJAX system to enable you to increase and decrease cart quantity interactively while you are shopping.
 
We hope these examples give you a few useful tips if you plan to, or are already using OpenCrypt's PHP Login Interface.
 
Share this article:
Delicious Stumble It!
Stumble It!
 
<- Developing Mobile Web Sites
 
IP Location API ->
Articles
Subscribe to RSS Feed
OpenCrypt Version 1.9
New Product: myRepono Website Backup Service
Website Pre-Launch Checklist
ionix in 2010
PHP Security Tips - Part 1
OpenCrypt 1.8 New Feature Highlights
Video Conversion API
We're on Twitter!
IP Location API
Integrating OpenCrypt's PHP Login Interface
Developing Mobile Web Sites
Service Recovery
Building relationships with your customers
Doing the unexpected
PHP/JavaScript World Map with Continent and Ocean Selection
We've Moved!
Customer Showcase: A-Z-Animals.com
Optimising your secure content for Google
Membership business models
AJAX Calendar with PHP and mySQL
PHP Function for Reciprocal Linkback Checking
AJAX Tree Menu with PHP - Revisited
What is membership software?
Login form designs and inspiration
PHP subscriber counter with Addicted to Feedburner class and Feedburner Awareness API
AJAX Tree Menu with PHP
AJAX data listings engine with PHP and mySQL (BETA)
Join the ionix Team!
Press Release: OpenCrypt 2.0 in Development!
PHP: Basic functions for quickstart PHP framework
Welcome to the OpenCrypt Blog!
Visitor Comments
Average Rating: 9.80 out of 10 (55 Votes)
Space Holder
Submit Comment
Space Holder
Article Rating:
Space Holder
Your Name:
Space Holder
Your Comment/Response:
Space Holder
Space Holder
Space Holder

Follow us on Twitter

Copyright © 1999 - 2011 ionix Limited. Affiliates, Contact Us

Powered by OpenCrypt Membership Software, Backups by myRepono Website Backup