Mail help

the mail() function

Moderators: egami, macek, gesf

Post Reply
rhender
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Mon Feb 06, 2012 12:26 pm

I imagine that this is a form validation issue.

I read a book by Charles Wyke Smith that included a function for validating simple forms.

I can send it to you - the function - , and possibly help you out.

Just let me know. Spam sucks.

rhender
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Wed Feb 08, 2012 2:53 pm

Hi there,

All of the code I'm referring to is actually in a few posts down, that I started a thread for.

It's called "designating who email is from" or something like that.

The last post in that thread is where I pasted the code that I am using, from the book I read by Charles Wyke Smith... I think that's his correct name. It has the code for validating the form submission.

And yes, I got your private message, but figured it was easier just to post here. Good luck,

pradeepcarya
New php-forum User
New php-forum User
Posts: 22
Joined: Mon Oct 24, 2011 10:10 am

Tue Feb 28, 2012 10:42 pm

hi..can u send me mail function to snd mail.

actually i need this for sending mails to users but not getting any mail function which actually works practically.also tell me if i need to change any settings for doing mail.

pradeepcarya
New php-forum User
New php-forum User
Posts: 22
Joined: Mon Oct 24, 2011 10:10 am

Tue Feb 28, 2012 10:42 pm

hi..can u send me mail function to snd mail.

actually i need this for sending mails to users but not getting any mail function which actually works practically.also tell me if i need to change any settings for doing mail.

rhender
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 01, 2011 11:36 am

Wed Feb 29, 2012 9:38 am

This is just the code for validating the form.

I called it form-validation.php, and I have it in an "_includes" folder... it came from the Charles Wyke Book I was talking about.

Let me know if you need more help.

Code: Select all

<?php

function verifyAlphaNum ($testString) {
	// Check for letters, numbers and dash, period, space and single quote only. 
	return (eregi ("^([[:alnum:]]|-|\.| |')+$", $testString));
}	

function verifyEmail ($testString) {
	// Check for a valid email address 
	return (eregi("^([[:alnum:]]|_|\.|-)+@([[:alnum:]]|\.|-)+(\.)([a-z]{2,4})$", $testString));
}

function verifyText ($testString) {
	// Check for letters, numbers and dash, period, ?, !, space and single and double quotes only. 
	return (eregi("^([[:alnum:]]|-|\.| |\n|,|\r|\?|\!|\"|\')+$",$testString));
}

function verifyPhone ($testString) {
	// Check for only numbers, dashes and spaces in the phone number 
	return (eregi('^([[:digit:]]| |-)+$', $testString));
}

?>

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests