PHP - Password Protect Extension
Posted: Wed Dec 05, 2007 5:43 pm
Hi There,
This little tweak allows you to edit the Password Protect code displayed on the page: http://www.wysiwygwebbuilder.com/password_protect.html
This tweak allows you to view some text. It would say you are not logged in if you aren't logged in and if you are logged in, it would say welcome so and so.
To tweak the password protect sample, follow the instructions below.
1. On the pages you want, type this code in the start of page section.
Now insert this bit in the area where you want the text to be displayed.
If there are any problems with the above code, please say so!
Note that this extension will not work if you have edited the main section in the verify page.
Extension gathered by Jamie.[/code]
This little tweak allows you to edit the Password Protect code displayed on the page: http://www.wysiwygwebbuilder.com/password_protect.html
This tweak allows you to view some text. It would say you are not logged in if you aren't logged in and if you are logged in, it would say welcome so and so.
To tweak the password protect sample, follow the instructions below.
1. On the pages you want, type this code in the start of page section.
Code: Select all
<?php
$notloggedin_text = "You are currently not logged in.";
$loggedin_text = "Welcome ".$_SESSION["username"]"! <a href=logout.php>Logout.</a>";
# No edits beyond this line
// This code is an extension of the password protect sample
// The above text is not credit, it is help!
// No edits beyond this line
if($_SESSION["username"])
{
$specification = "MD EXTENSION: 0837_log";
}
if($_SESSION["username"] == "guest")
{
$specification = "MD EXTENSION: 9276_log";
$specification = "MD EXTENSION:";
}
?>
Code: Select all
<?php
if($_SESSION["username"])
{
echo $loggedin_text;
}
else
{
echo $notloggedin_text;
}
echo '<font face="arial" size=1>';
echo $specification;
echo '</font>'
?>

Note that this extension will not work if you have edited the main section in the verify page.
Extension gathered by Jamie.[/code]