简体   繁体   中英

PHP Contact Form with Validatation Script?

I'd like to add a PHP Contact Form with Validation to my website. I can't seem to find an easy to set-up form.

I have a few other desired features I hope would be in some tpye of script out there!

First, I found a script that processes the form without page refresh. Plugin can be found here// http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/

Second, Name validation, if the name is shorter than 3 characters than the error text says something similar to "name can not be shorter than 3 characters"

and

Third, Check for a VALID E-mail. So a fake E-mail is not accepted.

Is there any type of plug-in out there that have these features?

Sounds like you are ready to graduate to a Model/View/Controller environment. Give Kohana a look. http://kohanaframework.org .

Using Kohana, you can specify rules for validation like so:

$extra_validation = Validation::factory($this->request->post())
    ->rule('password', 'min_length', array(':value', 8))
    ->rule('password_confirm', 'not_empty')
    ->rule('home_city', 'not_empty');

// Create the user using form values
$user = ORM::factory('user')->values($this->request->post(), array(
    'password',
    'home_city',
))->create($extra_validation);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM