Jump to content

Php & Forms


BigAl75

Recommended Posts

When people fill out information in the forms I have on my company's website and hit submit, the information is not being sent to our in-boxes like it should be. I'm confident that the php code I'm using is correct, but I was hoping someone here could look at it to make 100% certain it is before I get in another argument with our IT guy who claims it's my code that's the problem and not the mail server.Here's the code for the form:

<form action="scripts/feedback.php" method="post" name="Feedback-Form" id="Feedback-Form">							<input type="hidden" name="formname" value="Feedback-Form" />								<!-- Name Information -->			<div id="name">				Your Information:<br />				<div id="firstn">					Name:<br />					<input type="text" size="25" maxlength="100" name="name" />				</div>			</div>		<!-- End Name Info -->								<!-- Start Company Information Forms -->			<div class="company">				Company Name:<br />				<input type="text" size="25" maxlength="150" name="company" />			</div>			<div class="company">				Phone #:<br />				<input type="text" size="40" maxlength="100" name="phone" />			</div>			<div class="company">				Email:<br />				<input type="text" size="40" maxlength="100" name="email" />			</div>		<!-- End Company Information Forms -->		<!-- Begin More Info Options -->			<div class="company4">				Please add comments here:<br />				<textarea name="comments" rows="8" cols="47"></textarea>			</div>		<!-- End More Info Options -->								<!-- Submit/Reset buttons -->			<div class="company3">				<label>					<input name="Submit" type="submit" class="left" value="Submit" />				</label>				<label>					<input name="Reset" type="reset" class="right" value="Reset" />				</label>				<p class="clear">Please only press the Submit button once. It may take a moment or two to submit your information.</p>			 </div>		<!-- End Submit/Reset buttons --></form>

and here's the feedback script it's calling:

<?php$mailto = "marketingmanager@pmiapp.com" ;// $subject - set to the Subject line of the email, eg//$subject	= "Feedback Form" ;$subject = "Feedback from Website" ;$formurl = "http://www.pmiapp.com/feedback.php" ;$errorurl = "http://www.pmiapp.com/error.html" ;$thankyouurl = "http://www.pmiapp.com/thankyou.html" ;$uself = 1;// -------------------- END OF CONFIGURABLE SECTION ---------------$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;$name = $_POST['name'] ;$company = $_POST['company'] ;$phone = $_POST['phone'] ;$email = $_POST['email'] ;$comments = $_POST['comments'] ;$http_referrer = getenv( "HTTP_REFERER" );if (!isset($_POST['email'])) {	header( "Location: $formurl" );	exit ;}if (empty($name) || empty($email) || empty($comments)) {    header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" );    header( "Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT" );    header( "Cache-Control: no-cache, must-revalidate" );    header( "Pragma: no-cache" );	header( "Location: $errorurl" );	exit ;}if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {	header( "Location: $errorurl" );	exit ;}if (get_magic_quotes_gpc()) {	$comments = stripslashes( $comments );}$messageproper =	"This message was sent from:\n" .	"$http_referrer\n" .	"------------------------------------------------------------\n\n" .	"Name of sender: $name\n\n".	"Phone # of sender: $phone\n\n" .	"Email of sender: $email\n\n" .	"Company: $company\n\n" .	"------------------------- COMMENTS -------------------------\n\n" .	$comments .	"\n\n------------------------------------------------------------\n" ;mail($mailto, $subject, $messageproper,	"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.08" );header( "Location: $thankyouurl" );exit ;?>

I appreciate any help I can get with this.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...