Stripped out anchors in PHP forum

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
twoshedsmcginty
Forum Newbie
Posts: 3
Joined: Thu Sep 01, 2005 1:36 pm

Stripped out anchors in PHP forum

Post by twoshedsmcginty »

I'm developing an online forum with DWMX2004/MySql/PHP where if you create a post, you can surround a word with right and left arrows so that that word becomes a hyperlink when the post is displayed.

I won't go into the rationale, or the regex script that does this; I know the script works, because when I create a variable that is hard-coded on the page, such as...

"In September 1847 Zeiss moved to a larger facility at >Wagnergasse< 32 and hired his first apprentice."

...then 'Wagnergasse' becomes a pertinent hyperlink.

Trouble is, when I substitute the hard-coded variable content with EXACTLY THE SAME TEXT from a MySql database via DreamWeaver's standard recordset feature, the regexp throws an error telling me that there are no instances of the right or left arrows. So presumably DW is 'helpfully' tryiing to interpret these out-of-place half-tags and they do not end up in the variable.

I'd rather use unique characters as my anchor-pair, rather than '>' and '<', but every possible keystroke seems to already have been appropriated by PHP or MySql.

Can anyone suggest a solution? Perhaps there is an entity-parser in PHP that I am not aware of, where the whole text of the MySql content can be loaded in to a variable without any cleaning or interpretation?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

A standard fetch will get the information without any added parsing. Read thought mysql_fetch_assoc().

As you may hear: get out of using Dreamweaver.

As to your comment about keystrokes taken by php and mysql, I'm not understanding that well. You could use WikiWiki url link syntax, which is to surround the text in brackets: [...]


Moved to PHP - Code.
twoshedsmcginty
Forum Newbie
Posts: 3
Joined: Thu Sep 01, 2005 1:36 pm

Post by twoshedsmcginty »

Thanks for taking the time to reply; I did check your guidelines before posting something DreamWeaver-related, to see if it was frowned-upon.

Your guidelines (viewtopic.php?t=8815) also do recommend to those answering posts to explain their answers, so 'avoid Dreamweaver' isn't a helpful comment compared to 'Dreamweaver handles [this sort of thing] badly, as you'll read in other posts here'. I'm afraid it just comes across as shoot-the-newbie elitism, irritating and unnecessary. For all I know DW *is* a risible solution to my problem, but if you haven't got time to tell me why, I can appreciate that, everyone's busy, but please keep off-hand comments to yourself.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

twoshedsmcginty wrote:Thanks for taking the time to reply; I did check your guidelines before posting something DreamWeaver-related, to see if it was frowned-upon.

Your guidelines (viewtopic.php?t=8815) also do recommend to those answering posts to explain their answers, so 'avoid Dreamweaver' isn't a helpful comment compared to 'Dreamweaver handles [this sort of thing] badly, as you'll read in other posts here'. I'm afraid it just comes across as shoot-the-newbie elitism, irritating and unnecessary. For all I know DW *is* a risible solution to my problem, but if you haven't got time to tell me why, I can appreciate that, everyone's busy, but please keep off-hand comments to yourself.
hi twoshedsmcginty,
I have seen feyd answer your question.
The 'dreamweaver issue' is not wot your main subject is all about so he just gave you an extra word about the usage of dreamweaver.
yet, nobody forbids you from using or posting dreamweaver code here.
you are new here, thanks for coming here but do understand all the people here are trying to help each other.
if you see anything unexplained here, you can request for an explanation. most things are not explained cos they are meant to be known but if you can not understand something you are more than welcome to ask any number of times until you get your doubts clarified.
do give respect the seniors and you dont know about feyd; he is the best, highest volunteer at all times. you would see his work as you work with us.
so keep cool!!!nobody wants to initimidate others and dont be in a hurry to come to conclusions.
cheers and welcome to devnetwork.net!!!
twoshedsmcginty
Forum Newbie
Posts: 3
Joined: Thu Sep 01, 2005 1:36 pm

Post by twoshedsmcginty »

I appreciate the effort of people who reply to posts, particularly from dumb newcomers like myself. But it does take effort and time to really help someone out, and I've been to too many forums by now where there is an 'uberposter' resting on a fantastic reputation, who gets addicted to superficially answering *all* posts, both for the kudos and the post-count, even where the problem either eludes them or bores them. I have yet to find a forum free of such a character, so forgive me if I mistook feyd for one, I'm sure he is an excellent contributor.
Post Reply