defeating hmtl???

They have: 1,587 posts

Joined: Mar 1999

is there a way to stop html from working when someone submits form data with html in it? so if they put a hyperlink in the form data is want show up correctly.

------------------
Earn $1 + CPM NOW from bottom of the page banners! CLICK 4 CASH

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

You could disallow the characters when parsing the form, or replace them so that the information comes out, but the link isn't active (such as replacing < with &lt; and > with &gt; so that it looks like this:

<a href="...."> instead of being an active link.

Or you could program it so that if there is any HTML it returns an error stating such and redirecting the person to remove it from their form entry.

hth,

Suzanne

------------------
Zero Cattle
Suzanne
Tables DeMystified

[This message has been edited by Suzanne (edited 03 March 2000).]

They have: 1,587 posts

Joined: Mar 1999

ok so it should be something like:

$formdata =~ s/<.+?>//isg;

i guess that will take out the < or > in html?

------------------
Thumbs up or down ratings of the best and worst ways to make $$$ on the net. CLICK 4 CASH! from Affiliate Programs and Ad Networks

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 850 posts

Joined: Jul 1999

No, The regexp Patrick wrote would delete any <html> code found in the string.

If you wanted to delete all of the < and > out of a string you could do somthing like

$string =~ s/<|>//;

------------------
Recycling one glass jar, saves enough energy to watch T.V for 3 hours.

They have: 1,587 posts

Joined: Mar 1999

cool thx, looks like patrick's code might be what i need, hopefully.

------------------
Thumbs up or down ratings of the best and worst ways to make $$$ on the net. CLICK 4 CASH! from Affiliate Programs and Ad Networks

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.