PHP forward and return to anther website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bmannion
Forum Newbie
Posts: 1
Joined: Wed Sep 10, 2008 8:41 am

PHP forward and return to anther website

Post by bmannion »

We have an existing set of includes that are used on specific pages for allowing only "Members" to access the page. The includes perform security logins and SQL queries to our old database. I need to replace the includes to forward the user to the new system logon page and when they return allow them to see the page.

Now, I have not programmed in PHP in over 7 years. Not my fault. So I am attempting to remember how to do this. Can someone review this snip of code and tell me if it will work?

<?php

if ($_SERVER['REQUEST_URI'], 'https://my.globalhealth.org/ebusiness/login.aspx')
exit;
else
header("location:https://my.globalhealth.org/ebusiness/login.aspx");
exit;
End if
?>
marcth
Forum Contributor
Posts: 142
Joined: Mon Aug 25, 2008 8:16 am

Re: PHP forward and return to anther website

Post by marcth »

Code: Select all

<?php
if ($_SERVER['REQUEST_URI'] != 'https://my.globalhealth.org/ebusiness/login.aspx') {
  header("location:https://my.globalhealth.org/ebusiness/login.aspx");
}
exit(1);
?>
Post Reply