PHP New Window Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
expediant
Forum Newbie
Posts: 4
Joined: Fri Oct 16, 2009 5:53 am

PHP New Window Problem

Post by expediant »

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
_______
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: PHP New Window Problem

Post by Mark Baker »

So you've tried <A href="url" target="_blank">xyz</A>


But that shouldn't give database errors
expediant
Forum Newbie
Posts: 4
Joined: Fri Oct 16, 2009 5:53 am

Re: PHP New Window Problem

Post by expediant »

Thanks.

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

Post by Mark Baker »

expediant wrote:Where abouts in th code should i put it? and should i replace the xyz ??
It's your line of code... you quoted it in your original post, so you really should be able to do this for yourself

Code: Select all

if($row['LinkText'] != '' && $row['LinkUrl'] != '') {$Url[]="<br><br><a href=\"$row[LinkUrl]\" target=\"_blank\">$row[LinkText]</a><br><br>";}else{$Url[]='';}
expediant
Forum Newbie
Posts: 4
Joined: Fri Oct 16, 2009 5:53 am

Re: PHP New Window Problem

Post by expediant »

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.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: PHP New Window Problem

Post by Mark Baker »

I'd seriously suggest learning the rudiments of html first before moving onto PHP coding.
w3schools is always a good place to start
expediant
Forum Newbie
Posts: 4
Joined: Fri Oct 16, 2009 5:53 am

Re: PHP New Window Problem

Post by expediant »

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.
Post Reply