Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   phphq.Net Forums (https://novahq.net/forum/forumdisplay.php?f=277)
-   -   un-required? phMailer (https://novahq.net/forum/showthread.php?t=43008)

bmxdirect 04-15-2009 05:29 PM

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?!

IcIshoot 04-26-2009 10:01 PM

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


All times are GMT -5. The time now is 02:18 AM.

Powered by vBulletin®