Hello,
I'm getting that CGI error: "CGI Error: The specified CGI application misbehaved by not returning a complete set of HTTP headers."
I've created a test php form I'm testing on my intranet. I'm somewhat new to using PHP. Below is the exact code I'm using:
WEB PAGE:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<form action="process.php" method="post">
First Name: <input type="text" name="first" size="30"><br>
Last Name: <input type="text" name="last" size="30"><br>
Department: <select name="department">
<option value="[email protected]" >Department 1</option>
<option value="[email protected]">Department 2</option>
</select><p><br>
<input type="reset" value="reset">
<input type="submit" value="Submit" name="Submit" /> </p>
</form>
</body>
</html>
PHP FILE:
<?php
$to = $_POST['department'];
$firstname = $_REQUEST['first'];
$lastname = $_REQUEST['last'];
$subject = "Test";
$message = "Message Test";
$headers = "HEADERZ";
$sent = mail($to, $firstname, $lastname, $subject, $message, $headers);
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
I'm getting that CGI error: "CGI Error: The specified CGI application misbehaved by not returning a complete set of HTTP headers."
I've created a test php form I'm testing on my intranet. I'm somewhat new to using PHP. Below is the exact code I'm using:
WEB PAGE:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<form action="process.php" method="post">
First Name: <input type="text" name="first" size="30"><br>
Last Name: <input type="text" name="last" size="30"><br>
Department: <select name="department">
<option value="[email protected]" >Department 1</option>
<option value="[email protected]">Department 2</option>
</select><p><br>
<input type="reset" value="reset">
<input type="submit" value="Submit" name="Submit" /> </p>
</form>
</body>
</html>
PHP FILE:
<?php
$to = $_POST['department'];
$firstname = $_REQUEST['first'];
$lastname = $_REQUEST['last'];
$subject = "Test";
$message = "Message Test";
$headers = "HEADERZ";
$sent = mail($to, $firstname, $lastname, $subject, $message, $headers);
if($sent)
{print "Your mail was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>