Re: redirect location
| From: | gstrein andreas | Date: | Wed, 16 Aug 2000 18:08:41 +0000 |
| Subject: | Re: redirect location | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-12081@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Bartosz Aninowski" <bart@sonik.pl>
To: <php-general@lists.php.net>
Sent: Thursday, August 17, 2000 7:54 PM
Subject: [PHP] redirect location
Is there any possibilities to redirect users to another site.
Yes I can use location but I want to redirect after fg providing a password.
So code check if password is ok and then redirect user to diffrent adress
Bartosz
hi,
yeah try something like
<?
$host = "localhost";
$user = "blahblah";
$pass = "123456";
$dbase = "mydb";
$table = "mytbl";
if($myName && $myCode) {
mysql_connect($host,$user,$pass);
mysql_select_db($dbase);
$result = mysql_query("SELECT user,pass FROM $table WHERE id = 0");
$myRow = mysql_fetch_row($result);
if (($myName == $myRow[0]) AND ($myCode == $myRow[1])) {
setcookie("myTicket","valuable");
echo "<html><head><title>Your Title</title>";
echo "<meta http-equiv=\"refresh\"
content=\"0;URL=intego.htm\">";
echo "</head>";
echo "<body bgcolor=\"#FFFFFF\" >";
}
else {
echo "<html><title>Title youd like</title>";
echo "<body bgcolor=\"#FFFFFF\" >";
include("no_login.tpl"); // this shows again the login form
}
} else {
echo "<html><title>Title youd like</title>";
echo "<body bgcolor=\"#FFFFFF\" >";
include ("login.tpl"); // this shows the login form
}
echo "</body></html>";
?>
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/_/ viva technologies
_/ gstrein andreas
"Always listen to the experts; they'll tell you what can't be done and why.
Then do it."
- Robert A. Heinlein
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net