Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.