Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 02-04-2007, 12:04 PM   #1 (permalink)
Contributing Member
 
Join Date: 08-01-06
Posts: 913
iTrader: 0 / 0%
swiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the rough
How can i do this?

Hey guys,

on my website there is a page which pulls some articles from a database, and on that page it displays things like the article, author name, author link etc. the thing is right now the page displays the authors link like www.swiftmediauk.co.uk but we want it to say "View Website".

This is the code that pulls that link:

Code:
if($row['link . $i'] != null) { echo("<a href=\"http://" . $row['link$i'] . "\">" . $row['link$i'] . "</a><br />"); }
Can anybody tell me what that line should read to make the link appear as View Website please?
swiftmed is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-04-2007, 12:26 PM   #2 (permalink)
Contributing Member
 
exam's Avatar
 
Join Date: 04-20-06
Posts: 310
iTrader: 0 / 0%
Latest Blog:
None

exam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web pro
Change the echo line to:
PHP Code:
echo("<a href=\"http://" $row['link$i'] . "\">View Website</a><br />"); 
Is the rest of your script working fine? Some of that syntax looks painful...

"<a href=\"http://"
could very well be simplified to:
'<a href="http://'

and

$row['link$i']

doesn't look to healthy.
__________________
~exam~
exam is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-04-2007, 03:06 PM   #3 (permalink)
Contributing Member
 
Join Date: 08-01-06
Posts: 913
iTrader: 0 / 0%
swiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the rough
Hello mate,

thanks for doing that, it worked a treat. Im not sure about the script, it was done for my by a "professional", however i removed the "\" as you pointed out, and the page brought up an error, so im not too sure whether there is problems there or now. anyhow thanks for taking the time to help me.
swiftmed is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-04-2007, 03:17 PM   #4 (permalink)
Contributing Member
 
Join Date: 08-01-06
Posts: 913
iTrader: 0 / 0%
swiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the roughswiftmed is a jewel in the rough
Ive just looked at the articles page again and clicked on the "view website" link and for some reason the web address seems to be wrong on all. The url showing is "http:///"... any ideas mate?
swiftmed is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-04-2007, 05:55 PM   #5 (permalink)
Contributing Member
 
Join Date: 01-02-07
Location: PA, USA
Posts: 194
iTrader: 0 / 0%
Latest Blog:
None

Arenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebody
Send a message via ICQ to Arenlor Send a message via AIM to Arenlor Send a message via MSN to Arenlor Send a message via Yahoo to Arenlor
The way he used it he was using single quotes so you don't have to escape double quotes. I would suggest this for trouble shooting:
PHP Code:
echo $row['link$i']; 
escaping works fine, but if you want to simplify it use the following:
PHP Code:
echo('<a href="http://' $row['link$i'] . '">View Website</a><br />'); 
I'm not too sure if $row['link$i'] will work or not, but let me know what echoing it shows.
Arenlor is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sponsor Links
Webmaster Forum Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:51 AM.
© Copyright 2008 V7 Inc