Jump to content

Archived

This topic is now archived and is closed to further replies.

bpops

Checking HTML form input

Recommended Posts

Hi all,
Sorry if this question has been asked before, but I'm not really sure if there is an official name for what I'm trying to do.
I'm creating a site in which a user enters a bunch of data into a form. But some fields I want people to be able to enter only numbers, some fields text is allowed, all fields I want to prohibit from HTML codes, and all fields will have a specific character number limit. My question is the best way to implement these rules. I'm guess there's a way to parse strings in php and check for certain things...

Can someone please refer me to a php tutorial that would suit this? or even php code that I could take a look at and take what I need from?

Or if there are easier ways to do this please let me know.

Thanks in advance to all helpful replies!

Bpops

Share this post


Link to post
Share on other sites
Form Validation - If you are using Dreamweaver MX you can install a checkForm extension by going to www.yaromat.com. This can help with checking your fields for the right type of data before processing.

PHP Query String - I came across this same problem on how to parse strings in php. Look at the following...

//(parses the query string)
//URL: [a href=\"http://www.php.net/manual/en/function.parse-str.php\" target=\"_blank\"]http://www.php.net/manual/en/function.parse-str.php[/a]
$getID = parse_str($_SERVER['QUERY_STRING']);


[!--quoteo(post=366703:date=Apr 19 2006, 09:55 PM:name=bpops)--][div class=\'quotetop\']QUOTE(bpops @ Apr 19 2006, 09:55 PM) [snapback]366703[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi all,
Sorry if this question has been asked before, but I'm not really sure if there is an official name for what I'm trying to do.
I'm creating a site in which a user enters a bunch of data into a form. But some fields I want people to be able to enter only numbers, some fields text is allowed, all fields I want to prohibit from HTML codes, and all fields will have a specific character number limit. My question is the best way to implement these rules. I'm guess there's a way to parse strings in php and check for certain things...

Can someone please refer me to a php tutorial that would suit this? or even php code that I could take a look at and take what I need from?

Or if there are easier ways to do this please let me know.

Thanks in advance to all helpful replies!

Bpops
[/quote]
[code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=366720:date=Apr 20 2006, 01:23 AM:name=twome)--][div class=\'quotetop\']QUOTE(twome @ Apr 20 2006, 01:23 AM) [snapback]366720[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Form Validation - If you are using Dreamweaver MX you can install a checkForm extension by going to www.yaromat.com. This can help with checking your fields for the right type of data before processing.

PHP Query String - I came across this same problem on how to parse strings in php. Look at the following...

//(parses the query string)
//URL: [a href=\"http://www.php.net/manual/en/function.parse-str.php\" target=\"_blank\"]http://www.php.net/manual/en/function.parse-str.php[/a]
$getID = parse_str($_SERVER['QUERY_STRING']);
[code]
[/quote]

Thanks, twome, this should help :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.