/    Sign up×
Community /Pin to ProfileBookmark

Form with euro € symbol

I have a form with a text box having a euro input prompt, thus
<INPUT class=”forms” NAME=”minval” TYPE=”text” VALUE=”Euros ” SIZE=”25″>
I want to replace the “Euros ” part with the euro symbol using &amp;euro; but in the PHP which services the form, I want to reject user html input. Will it reject my input prompt also ? (if it does I will have to put the symbol outside the text area and then add it back in with the php script)

to post a comment
PHP

11 Comments(s)

Copy linkTweet thisAlerts:
@pyroSep 25.2003 — I'm not sure exactly what it is that you are asking. Could you please re-iterate?

[edit - After reading your thread in the HTML forums, I think I know what you are after, and will respond [URL=http://forums.webdeveloper.com/showthread.php?s=&threadid=18208]there[/URL]].
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 25.2003 — What exactly do you mean? Are you using the strip_tags() function? If so, just replace Euros after you strip the HTML.
Copy linkTweet thisAlerts:
@gizmoauthorSep 25.2003 — I have a text box tor users to enter a price. At present I use value="Euros" to prompt for the currency and have it appear in the result when the form is e-mailed to me. What I want to do is to put in the text box the Euro symbol € by using &amp;euro;, but when I have worked out how, I also want to prevent the user entering anything html which may break the webpage, e.g if the user enters </form> or similar. I also want the symbol in the result that is e-mailed to me.
Copy linkTweet thisAlerts:
@pyroSep 25.2003 — My post from the other thread might shed some light:

[i]Originally posted by pyro [/i]

[B]It depends how you are removing the HTML input. If you use [URL=http://us4.php.net/manual/en/function.htmlspecialchars.php]htmlspecialchars[/URL], it will indeed format it to &amp;amp;euro; which will cause it to display as &amp;euro; rather than &euro; on your pages.... [/B][/QUOTE]
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 25.2003 — If you want to remove all HTML from the user's input, you can use [URL=http://us4.php.net/manual/en/function.strip-tags.php]strip_tags()[/URL]. When you display the input, just add the euro symbol then.
Copy linkTweet thisAlerts:
@pyroSep 25.2003 — strip_tags will not remove &amp;amp;euro; -- it will still display as &euro; after being passed through that. Basically, strip_tags just changes the < to &amp;lt; and the > to &amp;gt; (with a few differences, obviously)
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 25.2003 — [i]Originally posted by pyro [/i]

[B] Basically, strip_tags just changes the < to &amp;lt; and the > to &amp;gt; (with a few differences, obviously) [/B][/QUOTE]


Oh, I didn't know that. Anyways, though, why would someone be entering HTML in the text box?
Copy linkTweet thisAlerts:
@gizmoauthorSep 25.2003 — A malicious user could enter some javascript which may do nasty things.
Copy linkTweet thisAlerts:
@PunkSktBrdr01Sep 25.2003 — That's a possibility, but very unlikely. What type of site is this for? If it's an online store, it's probable that the majority of your users will not know any HTML or JavaScript.
Copy linkTweet thisAlerts:
@gizmoauthorSep 25.2003 — Maybe I'm being paranoid, but if it's possible, then better safe than sorry.?
Copy linkTweet thisAlerts:
@pyroSep 25.2003 — If users can do damage to your applications, that means you need to keep working on them. gizmo has the right idea by disallowing users to have the chance to enter possibly malicious code. JavaScript wouldn't be nearly as big of a problem as a PHP (other server-side language) savvy user entering some server-side code. They could eaisly bring your site to a crashing halt, with very few lines of code being entered... As gizmo stated, better safe than sorry.
×

Success!

Help @gizmo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...