Re: [PHP] Re: form validation
On 12/20/2012 10:36 AM, Daniel Brown wrote: On Thu, Dec 20, 2012 at 10:34 AM, Jim Giner wrote: If you are using mysql for a db, then you should already be using mysql_real_escape_string in place of addslashes. Actually, you should start moving toward MySQLi, as mysql_*() is deprecated. true dat. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: form validation
On Thu, Dec 20, 2012 at 9:34 AM, Jim Giner wrote: > If you are using mysql for a db, then you should already be using > mysql_real_escape_string in place of addslashes. You should not be using mysql_real_escape_string going forward as it will be deprecated in php 5.5.0. http://php.net/manual/en/function.mysql-real-escape-string.php. You should be looking to use either mysqli functions or the PDO class.
Re: [PHP] Re: form validation
On Thu, Dec 20, 2012 at 10:34 AM, Jim Giner wrote: > > If you are using > mysql for a db, then you should already be using mysql_real_escape_string in > place of addslashes. Actually, you should start moving toward MySQLi, as mysql_*() is deprecated. -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation
may I ask what JS list u are using? ""Micheleh Davis"" wrote in message news:003901ca1b6b$dd103d00$9730b7...@com... > Yep, I'm sorry, sent to the wrong one. Thanks all! > > > -Original Message- > From: Ralph Deffke [mailto:ralph_def...@yahoo.de] > Sent: Wednesday, August 12, 2009 12:29 PM > To: php-general@lists.php.net > Subject: [PHP] Re: Form Validation > > this is a PHP mailing list, may be u ask this on a js mailinglist > > ralph_def...@yahoo.de > > > ""Micheleh Davis"" wrote in message > news:002901ca1b68$fc6b0020$f54100...@com... > > Please help. My form validation worked fine until I added the terms check > > at the bottom. Any ideas? > > > > > > > > //form validation step one > > > > function validateStep1(myForm){ > > > > // list of required fields > > > > with (myForm) { > > > > var requiredFields = new Array ( > > > > firstName, > > > > lastName, > > > > phone, > > > > email, > > > > terms) > > > > } > > > > // check for missing required fields > > > > for (var i = 0; i < requiredFields.length; i++){ > > > > if (requiredFields[i].value == ""){ > > > > alert ("You left a > required > > field blank. Please enter the required information."); > > > > requiredFields[i].focus(); > > > > return false; > > > > } > > > > } > > > > // check for valid email address format > > > > var eaddress= myForm.email.value; > > > > var validaddress= > > /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})$/; > > > > //var validaddress= /^((\w+).?(\w+))+...@\w+/i; > > > > var result= eaddress.match(validaddress); > > > > if (result == null) { > > > > alert ("Please enter your complete email > > address."); > > > > myForm.email.focus(); > > > > return false; > > > > } > > > > // check for valid phone format > > > > var check= myForm.phone.value; > > > > check= check.replace(/[^0-9]/g,""); > > > > if (check.length < 10) { > > > >alert ("please enter your complete phone number."); > > > >return false; > > > > }//end if > > > > > > > > return true; > > > > > > > > //begin terms and conditions check > > > > var termsCheck= myForm.terms.value; > > > > if (bcForm1.checked == false) > > > > { > > > > alert ('Please read and select I Agree to > > the Terms and Conditions of Service.'); > > > > return false; > > > > } > > > > else > > > > { > > > > return true; > > > > } > > > >//end terms check > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Form Validation
Yep, I'm sorry, sent to the wrong one. Thanks all! -Original Message- From: Ralph Deffke [mailto:ralph_def...@yahoo.de] Sent: Wednesday, August 12, 2009 12:29 PM To: php-general@lists.php.net Subject: [PHP] Re: Form Validation this is a PHP mailing list, may be u ask this on a js mailinglist ralph_def...@yahoo.de ""Micheleh Davis"" wrote in message news:002901ca1b68$fc6b0020$f54100...@com... > Please help. My form validation worked fine until I added the terms check > at the bottom. Any ideas? > > > > //form validation step one > > function validateStep1(myForm){ > > // list of required fields > > with (myForm) { > > var requiredFields = new Array ( > > firstName, > > lastName, > > phone, > > email, > > terms) > > } > > // check for missing required fields > > for (var i = 0; i < requiredFields.length; i++){ > > if (requiredFields[i].value == ""){ > > alert ("You left a required > field blank. Please enter the required information."); > > requiredFields[i].focus(); > > return false; > > } > > } > > // check for valid email address format > > var eaddress= myForm.email.value; > > var validaddress= > /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})$/; > > //var validaddress= /^((\w+).?(\w+))+...@\w+/i; > > var result= eaddress.match(validaddress); > > if (result == null) { > > alert ("Please enter your complete email > address."); > > myForm.email.focus(); > > return false; > > } > > // check for valid phone format > > var check= myForm.phone.value; > > check= check.replace(/[^0-9]/g,""); > > if (check.length < 10) { > >alert ("please enter your complete phone number."); > >return false; > > }//end if > > > > return true; > > > > //begin terms and conditions check > > var termsCheck= myForm.terms.value; > > if (bcForm1.checked == false) > > { > > alert ('Please read and select I Agree to > the Terms and Conditions of Service.'); > > return false; > > } > > else > > { > > return true; > > } > >//end terms check > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation Issues
On 5/23/07, Crayon Shin Chan <[EMAIL PROTECTED]> wrote: On Thursday 24 May 2007 00:51, Greg Donald wrote: > As I watch PHP de-evolve into Java, I find myself wanting something > lighter weight and with a smaller syntax. PHP has long since spawned into something uncontrollable. Compare the number of functions (and its aliases) to eg Ruby. The string functions in particular are absolutely bloated, eg ltrim, trim & rtrim - WTF. Why not just have trim() and have the option of specifying whether left/right/both? The same goes for the case-sensitive and case-insensitive versions of functions. -- Crayon Yeah, for case-insensitive functions would a bool be a lot better, like the strstr function, the current syntax is (also for the case-insensitive function stristr): string strstr ( string $haystack, string $needle ) It would be a lot better to have it like this: string strstr ( string $haystack, string $needle, bool $case_sensitive ) The trim functions are fine for me.. Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation Issues
On Thursday 24 May 2007 00:51, Greg Donald wrote: > As I watch PHP de-evolve into Java, I find myself wanting something > lighter weight and with a smaller syntax. PHP has long since spawned into something uncontrollable. Compare the number of functions (and its aliases) to eg Ruby. The string functions in particular are absolutely bloated, eg ltrim, trim & rtrim - WTF. Why not just have trim() and have the option of specifying whether left/right/both? The same goes for the case-sensitive and case-insensitive versions of functions. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation Issues
On 5/23/07, Robert Cummings <[EMAIL PROTECTED]> wrote: Robert Cummings: "if every problem can be described as a nail, then all you need is a hammer." Don't you ever get the urge to swing a different hammer? I sure do. As I watch PHP de-evolve into Java, I find myself wanting something lighter weight and with a smaller syntax. PHP seems fine for most web development projects, but if PHP's SPL and the Zend Framework are a sign of things to come from the core PHP developers, my interest in using other hammers is only going to increase. Possibly to the point of putting my PHP hammer down. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation Issues
On Wed, 2007-05-23 at 11:16 -0500, Jared Farrish wrote: > > Abraham Maslow: "If the only tool you have is a hammer, you tend to see > every problem as a nail." $$ Robert Cummings: "if every problem can be described as a nail, then all you need is a hammer." Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Form Validation class
Hello Chris, Thursday, January 03, 2002, 10:41:34 AM, you wrote: CL> Ive seen em on zend.com, I wrote my own. I would recommend you take a look CL> at the ones on zend.com and modify it to taste. CL> -- CL> Chris Lee CL> [EMAIL PROTECTED] CL> "Daniel Harik" <[EMAIL PROTECTED]> wrote in message CL> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Hello guys, >> >> at moment i'm reading "Hack Proofing your web apps" book, but it makes >> me scared, i have seen a class from newbienetwork.net(can't find it >> now), that validates >> user input, things like telephone number, state, country , email, and >> also can check if only letters or numbers are in text field, my >> question is this are there classes of this kind around? I would really >> need it. >> >> Thank You very much >> >> >> >> -- >> Best regards, >> Daniel mailto:[EMAIL PROTECTED] >> Thank You for your reply That's the reason i've posted, can't find what i'm looking for anywhere -- Best regards, Danielmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]