Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Web Technology Web Design Tools Photoshop,Dreamweaver,Flash,Etc.Tutorials , References , Examples.

Web Technology Thread, Turning MySql table info into hyperlinks in Programming , WebDesign & Development; Hi, I am trying to complete a product search page for a friends website. I am using a MySql table ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=17973


Reply
LinkBack Thread Tools Display Modes
Turning MySql table info into hyperlinks
 
 
Senior Member

Reply With Quote
 
Join Date: Dec 2008
Posts: 18,122
17-01-2009, 02:50 AM
 
Hi, I am trying to complete a product search page for a friends website. I am using a MySql table which contains 3 fields. Product ID, Product Name, Product Link. My search page works fine and brings up the relevant products when entered. The...

Hi,

I am trying to complete a product search page for a friends website. I am using a MySql table which contains 3 fields. Product ID, Product Name, Product Link. My search page works fine and brings up the relevant products when entered.

The data stored in the Product Link field is as follows - http://www.url.com/product.html - when the search is complete this line of data displays correctly, however it is not linked. I did a quick shufty through help forums and found that to get it to link the ereg_replace might be a possible solution. After using this function the first part of my url is linked but not the extension O.o The php code I used is pasted below;

**$linkdesc variable contains the retrieved data that needs to be turned into a link.

PHP Code:
$text = $linkdesc;
$text = ereg_replace("[[:alpha:]]+://[^[:space:]]+[[:alnum:]/]","\\0",$text);


I'm kind of thinking my regex pattern isn't accomodating the /page.html part of my link, but im not 100% And I confess this is one of my first outings into PhP_World so it's a bit muddled in the ol' brain box.

Anyone have any ideas ?
 
 
 
Reply

Web Technology Thread, Turning MySql table info into hyperlinks in Programming , WebDesign & Development; Hi, I am trying to complete a product search page for a friends website. I am using a MySql table ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=17973


Bookmarks

Tags
hyperlinks, info, mysql, table, turning


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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump