Go Back   Novahq.net Forum > phphq.Net > phphq.Net Forums
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-15-2009, 05:29 PM
bmxdirect is offline bmxdirect
Registered User

Join Date: Apr 2009
Posts: 1

un-required? phMailer

Thanks for the awesome script.

Im looking to change the name, email and message parts so that they are NOT required fields. Some help changing this option please?!
Reply With Quote
  #2  
Old 04-26-2009, 10:01 PM
IcIshoot is offline IcIshoot

Join Date: Mar 2004
Location: Farmington Hills, MI
Posts: 1,473

Send a message via AIM to IcIshoot Send a message via MSN to IcIshoot Send a message via Yahoo to IcIshoot
Open up phMailer.php in an editor, such as notepad.

(note -this is based on my copy that I just downloaded)

To disable the requirement for name:

look for

Code:
If(trim($yourname)=="") { 
			$error.="You did not enter your name!<br />";
		}
Replace it with

Code:
/*
If(trim($yourname)=="") { 
			$error.="You did not enter your name!<br />";
		}
*/
- this starts at line 223

For email:

Code:
If(trim($youremail)=="") { 
			$error.="You did not enter your email!<br />";
		} Elseif(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$",$youremail)) {
			$error.="Invalid email address.<br />";
		}
replace with:

Code:
/*
If(trim($youremail)=="") { 
			$error.="You did not enter your email!<br />";
		} Elseif(!eregi("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$",$youremail)) {
			$error.="Invalid email address.<br />";
		}
*/
This starts at line 227


For message:

Code:
If(trim($yourmessage)=="") { 
			$error.="You did not enter a message!<br />";
		}
replace with:

Code:
/*
If(trim($yourmessage)=="") { 
			$error.="You did not enter a message!<br />";
		}
*/


you don't have to do the replacement part if you are comfortable just commenting it out. If you look at the replacement code all we are doing is adding a /* at the of the code, and a */ at the end, or instead of replacing you could just delete the code - I prefer commenting it out though so that it can easily be undone

IcI
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'Invisibilty' Volunteers Required... MERMITE General Chat 5 11-02-2010 03:18 PM
gaming program(NO CODING REQUIRED) --BulletMagnet-- Web design and Programming 3 02-04-2006 02:05 PM
SOS:ARMED AMAZONS: CO REQUIRED!!!!!! Sharon Gaming Talk 0 04-26-2004 05:23 PM
error message, “A required .DLL, DINPUT8.DLL, was not found.” Steve Delta Force 0 01-08-2004 08:25 PM
Required for hosting? WhiteMike Delta Force 5 05-20-2003 05:00 PM


All times are GMT -5. The time now is 08:01 AM.




Powered by vBulletin®