i want to redirect a page after a checking.
for e.g
if (a == a)
// redirect to http://www.abc.com
else
//redirect to http://www.bbb.com
regards,
redirect url
Moderator: General Moderators
Code: Select all
<?
if ($a == $a)
{
header("location: thispage.php");
exit;
}
else
{
header("location: thisotherpage.php");
exit;
}- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
i have seen the post. but, i have no idea to solve my problem. i think it is better to post my code and let expert solve the problem for me.
plz help me.
Code: Select all
if (isset($_REQUEST['action']) && $_REQUEST['action']=='submitted')
{
if (isset($_REQUEST['memberid']))
{
$link = mysql_connect('mydatabase','myuser','mypassword');
if (!$link)
echo 'Can\'t open the database';
else
{
$db = mysql_select_db('mydbase');
if (!$db)
{
echo 'DataBase Error : ' . mysql_error();
}
$sql = "SELECT * FROM member WHERE memberID=" . $_REQUEST['memberid'];
$query = mysql_query($sql);
$num_row = mysql_num_rows($query);
if ($num_row >0 )
{
header("Location: thispage.php");
}
else
echo 'get out of here';
}plz help me.