my current code is this:
if($page=="SSL")
{header( "Location: https://www.e-junkie.com/ecom/gb.php?c= ... 8831&ejc=2" );}
else if ($page=="SSXL")
{header( "Location: https://www.e-junkie.com/ecom/gb.php?c= ... 8831&ejc=2"); }
else
{header( "Location: https://www.e-junkie.com/ecom/gb.php?c= ... 8831&ejc=2"); }
everything works, but i want to make it so the links open in a new window (target="_blank") not sure how i would do that, could anyone help??
probably an easy question, how do i link someone in php?
Moderator: General Moderators
- xpgeek
- Forum Contributor
- Posts: 146
- Joined: Mon May 22, 2006 1:45 am
- Location: Kyiv, Ukraine
- Contact:
Re: probably an easy question, how do i link someone in php?
You need to rethink you app structure first.
To open link in new window you can use javascript window.open function and simple <a href="/some/link" target="_blank">link</a>
Location: do only redirect, it do not open any links.
To open link in new window you can use javascript window.open function and simple <a href="/some/link" target="_blank">link</a>
Location: do only redirect, it do not open any links.
Re: probably an easy question, how do i link someone in php?
sorry i am really green on some of this, but are you saying i should just ditch the php all together and go with JS? or keep the php and write JS under the if statements?
-
Schneider707
- Forum Newbie
- Posts: 9
- Joined: Mon Dec 29, 2008 10:53 am
Re: probably an easy question, how do i link someone in php?
Did you want to redirect people or to list the proper link? If its the latter, this would be the easiest way:
That will print out whichever link is necessary. I might have messed up escaping the quotation marks but you'll get it.
Code: Select all
if($page=="SSL"){
echo "<a href=/"http://google.com/" target=/"_blank/">Google.com</a>" }
elseif ($page=="SSXL")
{echo "<a href=/"http://google.com/" target=/"_blank/">Google.com</a>" }
else
{echo "<a href=/"http://google.com/" target=/"_blank/">Google.com</a>" }
Re: probably an easy question, how do i link someone in php?
i wanted to redirect people there
thanks anyway, i figured it out using js
thanks anyway, i figured it out using js