Jump to content

Is it possible 'if' or 'else'?


pjrobertson

Recommended Posts

New to this stuff, and I was wondering whether there was a wya to use the if / else command to open a link in a new window depending on the circumstances.
What I want to do is make a link open in a new window if a person has been refered from a particular address.

If you're familiar with hit sites, you'll know people browse through sites with a frame in the top of the screen connected to the hit site. What I want to do is make it possible for people to open my links in new windows if they are viewing it in a frame.

[a href=\"http://http://www.ts25.com/surf/surf.jsp?surfer=pjrobertson\" target=\"_blank\"]here's[/a] a link to a hit site, where you can see what I mean about surfing websites.

It might all sound a bit wierd, but I'm not sure if it's possible!

[a href=\"http://www.gangguevara.com\" target=\"_blank\"]Here's[/a] a link to my index page (the page where I want links to open in a new window) so you can see what I want to change.
It would be something like (I've just made the code up! Just to show you what I mean)
[code]<?php
if ( $refering_url = ['http://www.ts25.com/surf/surf.jsp'] )
{
'<a href=Home.html target=_blank>English</a>'
}
else
{
<a href=Home.html>English</a>
}
[/code]
No idea if that makes sense.

Thanks :)
Link to comment
https://forums.phpfreaks.com/topic/11178-is-it-possible-if-or-else/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.