FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

create a page of access in PHP?

 


alskmaster
how I create a page of access in PHP?

Example:

To have access the content of a page it would be necessary to have a password, but the main page would open asking for this password.

Necessary to create a page.

But I do not know to use php.

And I do not know another good language that he makes this.


Somebody could help me?
dandelion
Please check the following links out.

HTTP authentication with PHP
PEAR::Auth
misterdimiz
You can add this code at the top of your page

Code:
<?

$url="http://www.yoursite.com";

if (($id!="your_id")or($pw!="your_pw")) {

header("Location: $url");

}

?>


or

Code:
<?

$url="http://www.yoursite.com";

if (($id!="your_id")or($pw!="your_pw")) {


}

?>

<script LANGUAGE="JavaScript">
location = "<?php echo $url; ?>";
</script>


your login page (index.php) must contain a form whit 2 textfield "id" and "pw"
to send with _GET method
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.