Hi frnds...

I m inserting some text(link+) into db table like :


Our PHP forum is the place for Q&A-style discussions related to this popular development language. LAMP programmers...

http://www.xxxxxxxx.com/gallery/gallery.php?gid=295&gcat=Heroines&gname=Bhumika%20Chawla's%20Hot%20....

Our PHP forum is the place for Q&A-style discussions related to this popular development language. LAMP programmers

When i am fecthing into user page it displays as normal text...
i need to change this as URLlink.,...plz tell me how can i do this....is there any php funtion to change this as url...

Thanks in advance...
hey, just check this great metatrader

Hi frnds...

I m inserting some text(link+) into db table like :


Our PHP forum is the place for Q&A-style discussions related to this popular development language. LAMP programmers...

http://www.xxxxxxxx.com/gallery/gallery.php?gid=295&gcat=Heroines&gname=Bhumika%20Chawla's%20Hot%20....

Our PHP forum is the place for Q&A-style discussions related to this popular development language. LAMP programmers

When i am fecthing into user page it displays as normal text...
i need to change this as URLlink.,...plz tell me how can i do this....is there any php funtion to change this as url...

Thanks in advance...
hey, just check this great metatrader

You May Use <a href> for Converting it to URL Link.
Use this tag: <a href='".$row['F_Name']."' title="Your Title Here">Your Fetching Link</a> The above convert your normal text into link.

You May Use <a href> for Converting it to URL Link.
Use this tag: <a href='".$row['F_Name']."' title="Your Title Here">Your Fetching Link</a> The above convert your normal text into link.

Hi hemgoyal..

$row...contains both text and url...not only url...that is my problem...how can i divide this url from text..

Well if for example say $row['F_Name']="http://example.com/gallery/gallery.php" then you would use the following:

echo '<a href="'.$row['F_Name'].'?variable='.$variable.'&id=2'.'">Link title</a>

Then in that page you linked to place the following code

echo $_GET['variable'];
echo '<br>';
echo $_GET['id'];
Member Avatar for diafol

OK if I get you right, the db field contains description or title text and the url itself. You need to search for the start of the url and then the end of the url to extract the info. Although I hate it with a vengeance, I'd use regex to determine the url.

See http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/
for some info.

If, on the other hand. you want to display the whole text but you're seeing the url tags instead of a clickable link, it may be that you've encoded the input to the db with htmlentities() and not reversed the function on output.

Hay..
Is There Your Problem Solved or Not?
If your Problem is solved Then Mark this Thread to Solved.

Member Avatar for diafol

@hemgoyal_1990 - let the guy respond first. Sheesh! Are you desperate for some merit points or what?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.