Welcome to WebmasterWorld Guest from 54.166.82.161

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Displaying URLS from MySQL Database

     
2:37 am on Jan 13, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:49
votes: 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.

2:57 am on Jan 13, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 14, 2004
posts:49
votes: 0


I now have it sorted.

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

4:33 am on Jan 13, 2005 (gmt 0)

Moderator

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8437
votes: 208


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members