How Convert Http:// Text To Real Hyperlink?
I have some texts in MySQL databases. When I show this texts in webpages using PHP, I need to convert every ocurrence of
http://blablabla.com
to
<a href='http://blablabla.com'>http://blablabla.com</a>
, so my text will really became 'active'. The people who wrote the texts don't know HTML tags so I can't ask them to write explicity <a...> </a> commands. The problem is the same with text that contains the @ charactere, as
name@mailserver.com
. I have to change this to
<a href='mailto:name@mailserver.com'>name@mailserver.com</a>.
Please, I don't know how to use regular expression. I think It can make this replacemments very easy..
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Real Audio Http Streaming Without .ram File
I wanted a way to (http) stream Real Audio files without the need to use ..ram files. In case there are others interested in this, the following is the solution that worked for me: <?php Header("Content-Type: audio/x-pn-realaudio"); echo "http://www.domain.com/audiofolder/track1.rm"; ?>
URL Text To Hyperlink
here is what i have $threadx = preg_replace("/((ht|f)tp://[^s&]+)/", "<a href="$1">$1[/url]", $threadx); $threadx = preg_replace("/(S+@S+.w+)/", "<a href="mailto:$1">$1[/url]", $threadx); can someone tell me how to make it better, this one completly screws up existing hyperlinks and <img src=""> tags... need to fix it somehow..
Extractng Text From Hyperlink
I need to extract the text within anchor tags for use in building another hyperlink. In other words, if I have something like this: <a href="http://www.something.php?id=12">Blah blah blah</a> I need to get the 'Blah blah blah' part. I'm thinking that a regular expression is the way to go, but I'm having difficulty seeing how to deal with the stuff in the href attribute.
Hyperlink In Text Area
I have a basic CMS system and the client would like to insert some links in the text area. What would you recommend the best way to do this in a textarea box? There may be several hyperlinks in 1 textarea and some may have none at all. I assume this would be some sort of javascript code or is there an easier way.
Dynamically Genetrate RAM (Real Media) Text Files
I am working on a record company's site. They offer a selection of track snippets for stream/download. I would like to be able to dynamically generate the RAM (text File) to save manual input in the DB. Currently each RAM file has to be uploaded everytime a new track is added....but I'd like to have this created on the fly when a user is browsing the site. user selects track...is forwarded to the dynamically generated RAM file...which in turn selects the appropriate media. I can't think how i'd get this to work as I am trying to create a text file that is parsed rather than a peice of HTML that is read by a user. Perhaps on the server I'd have to add PHP Parsing to the RAM mime type?
Conditional Email Text To Hyperlink
I am trying to write a content management section for a web site. I have managed so far to use htmlarea to give users a basic, but user friendly interface by which to edit the page content. The user can add emails by symply typing john@example.com - IE automatically converts this to a hyperlink. The trouble is sometimes the users use plain text. I have been using the following line to convert plain text to a hyperlink: $pagetext=ereg_replace('[A-Za-z0-9_]([-._]?[A-Za-z0-9])*@[A-Za-z0-9]([-.]?[A-Za-z0-9])*.[A-Za-z]+', '<a href="mailto: ?subject=Email%20from%20web%20site"> |