Hi There, (first Time Poster)
I was hoping somebody could give me some advice on a line of code.
if($row['LinkText'] != '' && $row['LinkUrl'] != '') {$Url[]="<br><br><a href=\"$row[LinkUrl]\">$row[LinkText]</a><br><br>";}else{$Url[]='';}
Basically, I am trying to make the ['LinkUrl'] open in a new window rather than in the same window i have tried various HTML and JAVA techniques but it keeps causing errors in my database.
Not sure if anybody needs anymore of the code, so if you do then please let me know.
I know this is a tricky one, but hoping somebody can help.
Thanks
_______
PHP New Window Problem
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: PHP New Window Problem
So you've tried <A href="url" target="_blank">xyz</A>
But that shouldn't give database errors
But that shouldn't give database errors
Re: PHP New Window Problem
Thanks.
Where abouts in th code should i put it? and should i replace the xyz ??
Thanks Again
Where abouts in th code should i put it? and should i replace the xyz ??
Thanks Again
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: PHP New Window Problem
It's your line of code... you quoted it in your original post, so you really should be able to do this for yourselfexpediant wrote:Where abouts in th code should i put it? and should i replace the xyz ??
Code: Select all
if($row['LinkText'] != '' && $row['LinkUrl'] != '') {$Url[]="<br><br><a href=\"$row[LinkUrl]\" target=\"_blank\">$row[LinkText]</a><br><br>";}else{$Url[]='';}Re: PHP New Window Problem
Many Thanks for that.
I am actually very new to coding - Started on OSDate and now moving on from their hence my knowledge is moderate but not skilled.
MANY THANKS FOR THE HELP.
I am actually very new to coding - Started on OSDate and now moving on from their hence my knowledge is moderate but not skilled.
MANY THANKS FOR THE HELP.
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: PHP New Window Problem
I'd seriously suggest learning the rudiments of html first before moving onto PHP coding.
w3schools is always a good place to start
w3schools is always a good place to start
Re: PHP New Window Problem
Thanks for the advice, but i have learnt everything by just throwing myself in the deep end, and i havn't done bad so far and rarely need to ask any questions.
This one was just getting to me a bit. I actually knew what code to use, but was putting it in the wrong place.
Hence why i joind the forum for help and guidance and to hopefully offer my knowledge to others when i can.
Thanks again.
This one was just getting to me a bit. I actually knew what code to use, but was putting it in the wrong place.
Hence why i joind the forum for help and guidance and to hopefully offer my knowledge to others when i can.
Thanks again.