bpops Posted April 20, 2006 Share Posted April 20, 2006 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 Link to comment Share on other sites More sharing options...
twome Posted April 20, 2006 Share Posted April 20, 2006 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] Quote Link to comment Share on other sites More sharing options...
bpops Posted April 20, 2006 Author Share Posted April 20, 2006 [!--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 :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.