==================================================
SQL QuickRegister - June 6, 2006
==================================================
Configuring the redirect URLs and/or HTML Files
-----------------------------------------------
QuickRegister allows you to redirect to either an HTML page on your server
or virtual host account, or to a URL. You can also have the redirect script
download digital files.
There are 2 steps to configure the URL or HTML Page
Step A.
---------
1. Configure an HTML Page
a. The HTML page must be put into the directory:
/cgi-bin/quickregister/templates/mypages
b. All Links and Image tag paths need to be set to an absolute path
and not a relative one since the page is created dynamically from a
script in the cgi-bin.
Example of an Image tag: img
CHANGE
<img src="images/logo.jpg" border="0">
TO
<img src="/images/logo.jpg" border="0">
Example of an HREF Link
CHANGE
<a href="home.html">
TO
<a href="/home.html">
In both tags a forward slash was added to the path. This creates
the path absolute.
c. The redirect information is store in a file called redirect.txt
You can maintian the records from the Adminstrative Interface or
manually with a text editor.
Add a record to the file redirect.txt found in
/cgi-bin/quickregister/data with a code and the name of the file
located in ../templates/mypages.
Set the code equal to the actual filename with its file extention
faq=faq.html
As long as the file is in ../templates/mypages the redirect script will
find the HTML file.
2. Configure a URL
1. Add a record to the file redirect.txt found in
/cgi-bin/quickregister/data with a text description used
for the redirect.
Example: textdesc=http://www.yourexample.com
3. redirect.txt that comes with the program
bytesinteractive=http://www.bytesinteractive.com
faq=faq.htm
Step B:
-------
To redirect to an HTML page or a URL the HREF link is setup as follows:
Example 1: faq.html
<href="/cgi-bin/quickregister/scripts/redirect.cgi?redirect=faq">
The parameter redirect is set equal to the descriptive code used in
redirect.txt for the HTML page.
Example 2: http://www.bytesinteractive.com
<a href="/cgi-bin/quickregister/scripts/redirect.cgi?redirect=bytesinteractive"> Bytes Interactive </a>
Prevent Pages From Being Bookmarked
-----------------------------------
The prime motive for using this kind of application is to prevent your
members from bookmarking the pages they have access to.
Only by creating an HTML page dynamically with the Redirect Script can
one prevent bookmarking.
Limitations
-----------
Its important to note that you cannot configure SQL QuickRegister for
secure access to other applications such as a chat or bulletin board; unless you customize
the other application to read the login cookie created by our application.
If you need more information on how to do this feel free to contact us.
Protecting your Pages Using a PHP Template
------------------------------------------
This is a simple method to protect any page on your web site.
1. Determine the location of your cgi-bin. Usually its under or parallel
to Document Root.
2. To protect a file using php one needs to incorporate a php include file at
the top of each file then rename as a .php file.
To see how this is done open the file demo.php located in /cgi-bin/templates/php.
One needs to set the path to the php program pageprotect.php. It can be
absolute, relative or a full path. pageprotect.php is located in
/cgi-bin/quickregister/scripts
Example 1 cgi-bin is below Document Root
eg. /htdocs/cgi-bin (Document Root is usually htdocs, public_html, web etc ..)
The path to pageprotect.php is absolute and the php include is defined as follows:
<?php
include($_SERVER['DOCUMENT_ROOT']."/cgi-bin/quickregister/scripts/pageprotect.php");
?>
Example 2: cgi-bin is parallel to Document Root
|------ htdocs
------|
|------ cgi-bin
Solution 1: All the files one wants to protect are in one folder.
For this example lets call it members located under document root.
|------ htdocs/members
------|
|------ cgi-bin
The path to pageprotect is relative and the php include is defined as follows:
<?php
include '../../cgi-bin/quickregister/scripts/pageprotect.php';
?>
Note that the number ../ is determined by the number folders below document root.
If the folder was /htdocs/members/private then the relative path is defined as follows:
<?php
include '../../../cgi-bin/quickregister/scripts/pageprotect.php';
?>
Solution 2: One wants to protect files in Document Root or any subfolder
The path to pageprotect.php is a full path and the php include is defined as follows:
<?php
include '/YourFullPathToTheCgi-bin/cgi-bin/quickregister/scripts/pageprotect.php';
?>
3. Open the file pageprotect.php and set the MySQL credentials and
set the paths to the /cgi-bin/quickregister/data and /cgi-bin/quickregister/templates
in the same manner as you did in Step 2.
4. Set the file permissions on
/cgi-bin/quickregister/data/messages.txt as 644 rw_r__r__
/cgi-bin/quickregister/data/login.htm as 644 rw_r__r__
5. Upload demo.php to the folder one has decided to protect the files and
click on the url http://www.yourdomain.com/demo.php before you log in.
The login.htm page should display.
If it doens't work then one needs to make sure the paths are correctly defined.
6. Log in then click on http://www.yourdomain.com/demo.php again and
the contents of this page should appear: Hello World.
7. Once its working one can protects their pages as follows:
At the top of each HTML file add the php code defined in demo.php
then save the file as a PHP file that is rename the extention to .php