Advertisement

09.26.2008 at 09:37AM PDT, ID: 23766642
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.1

Contact Form in php error messages

Asked by cathyc77 in PHP and Databases

Tags:

Hello, this contact form was created for my website. (please see snippet)
However I am getting an error message everytime I submit this form. Here is the error message:

Notice: Undefined variable: monthnameactual in /home/potters/public_html/houseofhorrors/nvform.php on line 142

Notice: Undefined index: required in /home/potters/public_html/houseofhorrors/nvform.php on line 147

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 222

Notice: Undefined index: sort in /home/potters/public_html/houseofhorrors/nvform.php on line 240

Warning: Cannot modify header information - headers already sent by (output started at /home/potters/public_html/houseofhorrors/nvform.php:142) in /home/potters/public_html/houseofhorrors/nvform.php on line 278

Could someone please give me detailed and (newbie friendly) steps to correct these errors?

Thanks so much!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
<?php
 
/*
##########################################################################################
##  FILE: nvform.php                                                                    ##
##                                                                                      ##
##  Novice Form                                   Version 1.1                           ##
##  © Copyright 2000-2003 Seth Michael Knorr      mail@sethknorr.com                    ##
##                                                                                      ##
##                       http://www.noviceform.com/                                     ##
##         Please contact me with any bugs found, or any bug fixes.                     ##
##                                                                                      ##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##  There is no email support provided for this script, the only support can be         ##
##  found at our web site: http://www.noviceform.com/                                   ##
##                                                                                      ##
##                                                                                      ##
##  ANY PERSON(S) MAY USE AND MODIFY THESE SCRIPT(S) FREE OF CHARGE FOR EITHER BUSINESS ##
##  OR PERSONAL, HOWEVER AT ALL TIMES HEADERS AND COPYRIGHT MUST ALWAYS REMAIN IN TACT. ##
##                                                                                      ##
##  REDISTRIBUTION FOR PROFIT IS PROHIBITED WITH OUT THE CONSENT OF SETH KNORR.         ##
##                                                                                      ##
##  By using this code you agree to indemnify Seth M. Knorr from any liability that     ##
##  might arise from its use.                                                           ##
##                                                                                      ##
##                                                                                      ##
##########################################################################################
*/
 
 
/* $sendto is the email where form results are sent to */
   $sendto = "potterfn@telus.net,cathy@webgarden.ca, Rob@CamelotComputers.com";
 
/* $ccto is the email where form results can be carbon copied to */
   $ccto = "";
 
/*
         O P T I O N A L   V A R I A B L E S 
*/
 
 
/*
TO POST PHP ERRORS TO PAGE FOR DEBUGING SET:
	$report_errors = "ALL";
 
 
TO REMOVE PHP ERRORS FROM POSTING TO THE PAGE FOR USE SET:
	$report_errors = "NONE";
 
*/
$report_errors = "ALL";
 
 
$setokurl = "0";
 
$okurls = "http://www.house-of-horrors.com,http://house-of-horrors.com";
 
/*
 
        N O   N E E D   T O   E D I T   A N Y   V A R I A B L E S   B E L O W
 
*/
 
 
$footer = "<br><br><br><br><br><center><font face=\"Arial\"><a href=\"http://www.noviceform.com/\" target=\"_blank\"><font color=\"#ff0000\">Form processing script provided by Novice Form</font></a> </center></font>";
 
$backbutton = "<br><br><b>Hit your browsers back button and resubmit the form.</b>";
 
 
if ($report_errors == "NONE") {
error_reporting(0);
}else{
error_reporting(E_ALL);
}
 
 
/* --- I F   S E T   O K   U R L   = 1  ----- */
 
	if ($setokurl == "1"){
 
  $found_url = "0";
  $referer =$_SERVER["HTTP_REFERER"];
  $referer = str_replace("://", "[CS]", $referer);
  $referer_sp = explode("/", $referer);
  $referer = "$referer_sp[0]";
  $referer .= "/";
  $referer = str_replace("[CS]", "://", $referer);
  $referer = strtolower($referer);
 
  $okurls = split(",", $okurls);
 
foreach ($okurls as $myokurls) {
 
$myokurls = strtolower($myokurls);
 
     if ($referer == strtolower($myokurls)) { 
      $found_url = "1"; 
      }
 
  }
 
  if ($found_url == "0") {
  $ERROR_action = "bad_okurl";
  include("$PATH_error$PAGE_error");
  }
 
	}
/* --- E N D   I F   S E T   O K   U R L   = 1  --- */
 
 
 
/* check to see if posted */
if ($_GET || ! $_POST) {
include("/home/bass/public_html/nverror1.php");
no_pst();
 
}else{
 
 
 /* IF OLDER VERSION OF PHP CONVERT TO NEWER VARIABLES */
//	if (! $_POST) {
//	$_POST = "$HTTP_POST_VARS";
//	}
 
//	if (! $_SERVER) {
//	$_SERVER = "$HTTP_SERVER_VARS";
//	}
 
 
$year = date("Y");
$month = date("m");
$day = date("d");
$hour = date("h");
$min = date("i");
$tod = date("a");
 
 
$ip=$_SERVER["REMOTE_ADDR"];
 
$SEND_prnt = "The form below was submited by " . $_POST{"email"} . " from Ip address: $ip on $monthnameactual $month/$day/$year at $hour:$min $tod \n";
$SEND_prnt .= "-------------------------------------------------------------------------\n\n";
 
 
/* CHECK TO SEE IF $_POST{"required"} IS SET */
if ($_POST{"required"}){
 
 
  $post_required = $_POST{"required"};
  $required = split(",", $post_required);
  $reqnum = count($required);
 
	for ($req=0; $req < $reqnum; $req++) {
 
	$REQ_name = $required[$req];
	$REQ_value = $POST{"$REQ_name"};
 
 
  if ($REQ_name == "email") {
     $goodem = ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $_POST{"email"}, $trashed);
 
        if (! $goodem) {
	include("nverror.php");
	msng_email();
        }  /* end ! $goodem */
 
  }
  elseif (! $_POST{"$REQ_name"}) {
 		 $isreqe = "1";
 		 $REQ_error .= "<li> $REQ_name ";
  		 } /* end ! req val */
 
 
          } /* end REQ for loop  */
 
 
                /* IF THERE ARE ANY REQUIRED FIELDS NOT FILLED IN */
 
		if ($isreqe == "1") {
		include("nverror.php");
		msng_required();
		}
 
 
} /* END CHECK TO SEE IF $_POST{"required"} IS SET */
 
 
/* END IF THERE ARE ANY REQUIRED FIELDS NOT FILLED IN */
 
 
/* GET POSTED VARIABLES */
 
 
foreach ($_POST as $NVPOST_name => $NVPOST_value) {
 
$NVPOST_value = str_replace("\n", "", $NVPOST_value);
$NVPOST_value = str_replace("\r", "", $NVPOST_value);
 
$NVPOST_value = preg_replace("'\cc:'si", "Cc ", $NVPOST_value);
$NVPOST_value = preg_replace("'\bcc:'si", "bcc ", $NVPOST_value);
$NVPOST_value = preg_replace("'\to:'si", "to ", $NVPOST_value);
$NVPOST_value = preg_replace("'\bc:'si", "bc ", $NVPOST_value);
 
 
 
	if (strtolower($NVPOST_name) == "subject") {
 
	$NVPOST_value = str_replace(":", ";", $NVPOST_value);
	}
 
 
            /* G E T   E M A I L */
       
            if (strtolower($NVPOST_name) == "email") {
            $SEND_email = "$NVPOST_value";
	    $SEND_email = str_replace(":", "", $SEND_email);
	    $SEND_email = str_replace(" ", "", $SEND_email);
            }
 
            /* END GET LEADS EMAIL */
 
   if (! $_POST{"sort"}) {
 
 
                            /* CHECK TO SEE IF CONFIG FIELD */
                            if ($NVPOST_name == "subject" || $NVPOST_name == "sort" || $NVPOST_name == "required" || $NVPOST_name == "success_page"){}else{
                            $SEND_prnt .= "$NVPOST_name;  $NVPOST_value \n";
                            }
   } /* end ! sort */
  
 
} /* end foreach */
 
 
  /* END GET POSTED VARIABLES */
 
 
 
 
  if ($_POST{"sort"}) {
 
  /* SORT VARIABLES */
 
	$sortvars = split(",", $_POST{"sort"});
	$sortnum = count($sortvars);
 
               for ($num=0; $num < $sortnum; $num++) {
	       $SEND_prnt .= "$sortvars[$num]: " . $_POST{"$sortvars[$num]"} . " \n";
	       }
 
  }   /* END SORT VARIABLES */
 
 
 
 
/* send mail */
 
 
if (! $ccto) {
$header = "From: $SEND_email\r\nReply-to: $SEND_email";
}else{
$header = "From: $SEND_email\r\nReply-to: $SEND_email\r\nCc: $ccto";
}
 
 
mail($sendto, $_POST{"subject"}, $SEND_prnt, $header);
 
/* END sendmail */
 
     /* CHECK TO SEE IF FORM SPECIFYS A SUCCESS PAGE */
     if (! $_POST{"success_page"}) {
 
include("nverror.php");
default_success();
 
     }else{
     $successpage=$_POST{"success_page"};
     header("Location: $successpage");  /* redirect */  
     exit;
     }
 
 
 
} /* END IF POSTED */
 
 
?>
 
Loading Advertisement...
 
[+][-]09.26.2008 at 10:29AM PDT, ID: 22581769

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: PHP and Databases
Tags: PHP
Sign Up Now!
Solution Provided By: cedlinx
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628