|
Posted by Adamski on 11/04/91 11:18
On Sat, 11 Jun 2005 20:54:33 +0200, J.O. Aho wrote:
>Dave Moore wrote:
>> Hi All,
>> I hope you can give me a few pointers on this issue.
>>
>> I'd like visitors to my website to be able to enter text to be viewed on the
>> site - a bit like a bulletin board or forum. I can do this for regular text
>> easily by simply populating a 'TEXT' field within my MySQL database and
>> grabbing it back when rendering the site using PHP. However, I'd also like
>> visitors to be able to put in URL links or email items that can be clicked.
>> How would I go about doing this?.I've seen this sort of thing on forums
>> where words can be selected and a URL applied, but I have no idea how to do
>> this and how this information (ie. the link and the associated text) would
>> be stored in the database field(s).
>> Any ideas?. Are there any PHP examples available for this sort of thing?.
>
>IMHO the easiest way is to allow users to use HTML-tags, that way they can set
>URLs.
Easy, certainly - but could also give you a few problems. You'd need
to watch out for links to *images*. I've seen a fair few bulletin
boards that have been "compromised" by people pasting HTML links to
rather unsavoury pics (that display inline) ;-)
You'd need to devise a search & replace for all HTML tags (look for
the < and > entities) - but allow <a href ....
Adam.
[Back to original message]
|