Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Site redirection

Status
Not open for further replies.

Phutie

Programmer
Jul 31, 2000
29
PH
Hi,

This is the scenario..... WebsiteA has a link for WebsiteB but WebsiteA has nothing to do anymore with WebsiteB so WebsiteB wants users who click on the WebsiteA redirect to a site that tells "This company has no relation to this company." Then redirects to WebsiteB.

I need to do this without touching any code on WebsiteA.It'll be all on WebsiteB.

Is it possible? Please answer for any ideas.

Thanks,

Phutie
 
I think that this can get quite complicated. The way that I would approach this would be to have the main page of WebsiteB done in PHP. I would have a variable called $action that is either passed from the link on WebsiteA or not. In this case, not.

Therefore, when the user clicks on WebsiteA, the link takes him to WebsiteB. Ok, thats easy.

On WebsiteB, you can have the following code:

[tt]
if ($action == "") { #$action is undefined or equals nothing
print &quot;<html><head><title>Redirection in Process</title>\n&quot;;
print &quot;<meta http-equiv=\&quot;Refresh\&quot; content=\&quot;1; URL=place.php\&quot;>\n&quot;;
print &quot;</head><body>you are being redirected</body></html>\n&quot;;
} else {
header(&quot;Location: }

[/tt]

That should do it.

Hope this helps.

-Vic vic cherubini
vikter@epicsoftware.com
====
Knows: Perl, HTML, JavScript, C/C++, PHP, Flash, Director
====
 
Another thing you can do it test the $HTTP_REFERER(I think?) variable on Website B - if that says you came from the specific place on Website A, then 1st display the &quot;This company has no relation to this company.&quot; message and then redirect to the correct page - you might have to make a new page for the &quot;This company has no relation to this company&quot; message and have a button or a link on that page take you to the correct page. I'm not sure if/how you can display the message for 5(?) seconds, and then redirect without the user hitting anything - you must be able to do it 'cause I've seen it done - I just don't know how.

HTH.
Hardy Merrill
Mission Critical Linux, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top