#Validate the Pan Card field
<!--Code snippets for validating PAN number.-->
1) In HTML 5
<input type="text" name="pan" id="pan" pattern="^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$">
2) In JavaScript
<input type="text" name="pan" id="pan" onkeyup="return ValidatePan(this.value)">
<script>
function ValidatePan(pan){
var regpan = /^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$/;
if(regpan.test(pan) == false)
{
alert("Permanent Account Number is not yet valid.");
return false;
}
else
{
alert("You have entered a valid Permanent Account Number !");
return true;
}
}
</script>
PHP mail function and mail configuration in XAMPP and sending mail is done from sendmail through localhost. I hope it will help you. mail() function <? php $to = 'dubeynitish22@hotmail.com' ; $subject = 'Test' ; $message = 'Hello' ; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion (); if (! mail ( $to , $subject , $message , $headers )){ echo "Error !!" ; } else { echo "Email Sent !!" ; } ?> 2. php.ini configuration (For SEND-MAIL) [ mail function ] ; For Win32 only . ; http : //php.net/smtp ; SMTP = localhost ; http : //php.net/smtp-port ; smtp_port = 25 ; For Win32 only . ; http : //php.net/sendmail-from ; sendmail_from = me@example . com ; For Unix only . You may supply arguments as well ( default : "sendmail -t -i...
Comments
Post a Comment