Jump to content

Checking HTML form input


bpops

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
Link to comment
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]
Link to comment
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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.