If i have a page with a web link like ‘www.blah.com’ is there a way I can make it into a link automatically by setting something in the website instead of putting in a <a href… each time?
@hastxDec 13.2007 — #I've seen pre-built javascripts that will search for any string beginning with "http://" and convert it to a link, but that wont help anybody with JS disabled.
On the server side, it depends how you are getting your "www..." string, for example if you have these strings within a database, you could always append the string with the query to include the "<a href..."
@tefnutauthorDec 13.2007 — #Can it work for both dynamic and non-dynamic content, perhaps something I could put in the top of the page. Im sure I have seen this elsewhere
@SyCoDec 14.2007 — #A good way to do this is using ereg_replace (or preg_replace) to recognize a link and add the HTML to make it a link. The hard part is getting the regular expression right however there are lots of libraries out there that should help.
Here's a function by Iasmin Balaj originall posted on PHP.net
return $text; } ?> [/code] Of course this will only work for dynamic pages I'm not sure it's possible with non dynamic content. Probably with javascript interpreting the output and doing a similar thing before writing it to the page. I've always treated this as a dynamic requirement.
@SyCoDec 19.2007 — #Don't just copy and paste. Go learn how to use it, read the multiple tutorials. Regular expressions are tough to understand but if you want to use them you'll need to learn them. e/preg_replace will do what you want in a dynamic page and you have an example to start you off.
Also what does this tell us other than you have a problem.
"thanks, but it didnt do anything, i put it in the page"
I suppose I could just respond with the same amount of information. >well you've got an error somewhere.
Not much help huh. If you want help, you'll get it if you post a reasonable request for information. If you want people to write your code for you then I hear good things about the people in Pune, India. Prices are reasonable too.