Jump to content


Photo

Checking HTML form input


  • Please log in to reply
2 replies to this topic

#1 bpops

bpops
  • Members
  • PipPipPip
  • Advanced Member
  • 232 posts

Posted 20 April 2006 - 02:55 AM

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

#2 twome

twome
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 20 April 2006 - 06:23 AM

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) View Post[/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=auto:0]

#3 bpops

bpops
  • Members
  • PipPipPip
  • Advanced Member
  • 232 posts

Posted 20 April 2006 - 09:28 PM

[!--quoteo(post=366720:date=Apr 20 2006, 01:23 AM:name=twome)--][div class=\'quotetop\']QUOTE(twome @ Apr 20 2006, 01:23 AM) View Post[/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=auto:0]
[/quote]

Thanks, twome, this should help :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users