homepage Welcome to WebmasterWorld Guest from 54.211.113.223
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Displaying URLS from MySQL Database
tongpo

10+ Year Member



 
Msg#: 6479 posted 2:37 am on Jan 13, 2005 (gmt 0)

I am currently creating my first data base driven web site and Im suprised at how easy it is once you get the hang of it. Anyway I have a list of URLS I would like to display on my pages but they are not displaying correctly.

I query my data base and get the results, I have the following url in the database: [externalsite.com...]

Thing is when it gets displayed on the page, the URL to my site is attached to the beginning of the external one. So I get the following link on my page:
[mysite.com...] instead of just the [externalsite.com...] which is what i need.

Here is my code:

echo '<p><strong>', $row['title'], '</strong><br />';
echo $row['description'], '<br />';
echo '<a href=">', $row['url'], '" target="_blank">boooooo</a>';

If anybody can point me in the right direction id be very grateful.

 

tongpo

10+ Year Member



 
Msg#: 6479 posted 2:57 am on Jan 13, 2005 (gmt 0)

I now have it sorted.

echo '<a target=new href=', $row['url'], '>', $row['url'], '</a>';

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 6479 posted 4:33 am on Jan 13, 2005 (gmt 0)

Welcome the WebmasterWorld Tongpo!

As a general rule, whenever you see that sort of thing, it's because the browser thinks that what you have there is a relative URL that is relative to your current page. Usually THAT happens because it doesn't recognize that there is a protocol prefix at the front (http), which is exactly the case here.

Glad you got it sorted.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved