Hi, I get a blank page instead of my thankyou page after the form is processed. Any idea what the problem could be? Here's what my process.php file looks like:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','fname');
pt_register('POST','lname');
pt_register('POST','city');
pt_register('POST','email');
pt_register('POST','category');
pt_register('POST','request');
$request=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $request);pt_register('POST','realanswer');
$realanswer=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $realanswer);pt_register('POST','wishanswer');
$wishanswer=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $wishanswer);pt_register('POST','credits');
pt_register('POST','creditsdesc');
pt_register('POST','news');
pt_register('POST','comments');
if($city=="" || $category=="" || $request=="" || $wishanswer=="" || $credits=="" || $news=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="fname: ".$fname."
lname: ".$lname."
city: ".$city."
email: ".$email."
category: ".$category."
request: ".$request."
realanswer: ".$realanswer."
wishanswer: ".$wishanswer."
credits: ".$credits."
creditsdesc: ".$creditsdesc."
news: ".$news."
comments: ".$comments."
";
$message = stripslashes($message);
mail("ccccccc@xxxxx.xxx","Form Submitted at your website",$message,"From: Book Formulary");
$link = mysql_connect("localhost","xxxxxxx","xxxxxxx");
mysql_select_db("book2",$link);
$query = "insert into book2db (fn,ln,ct,em,cat,req,ra,wa,cr,crdsc,nw,co) values ('".$fname."','".$lname."','".$city."','".$email."','".$category."','".$request."','".$realanswer."','".$wishanswer."','".$credits."','".$creditsdesc."','".$news."','".$comments."')";
header("Refresh: 0;url=thankyou.htm");
}
?>
And here are 2 lines in the error log of the server I get:
[Fri Jun 27 07:06:53 2003] [error] [client xx.xx.xxx.xx] PHP Notice: Undefined index: HTTPS in xxxxxxxxxxxxxxxxxxxxxxxxxxx\process.php on line 23, referer: http://xxxxxxxxxxxxxxxxxxxxxxxxxxx/form1.html
[Fri Jun 27 07:06:53 2003] [error] [client xx.xx.xxx.xx] PHP Warning: Cannot modify header information - headers already sent in xxxxxxxxxxxxxxxxxxxxxxxxxxx\process.php on line 42, referer: http://xxxxxxxxxxxxxxxxxxxxxxxxxxx/form1.html
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I get a blank page instead of my thankyou page after the form is processed. Any idea what the problem could be? Here's what my process.php file looks like:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','fname');
pt_register('POST','lname');
pt_register('POST','city');
pt_register('POST','email');
pt_register('POST','category');
pt_register('POST','request');
$request=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $request);pt_register('POST','realanswer');
$realanswer=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $realanswer);pt_register('POST','wishanswer');
$wishanswer=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $wishanswer);pt_register('POST','credits');
pt_register('POST','creditsdesc');
pt_register('POST','news');
pt_register('POST','comments');
if($city=="" || $category=="" || $request=="" || $wishanswer=="" || $credits=="" || $news=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="fname: ".$fname."
lname: ".$lname."
city: ".$city."
email: ".$email."
category: ".$category."
request: ".$request."
realanswer: ".$realanswer."
wishanswer: ".$wishanswer."
credits: ".$credits."
creditsdesc: ".$creditsdesc."
news: ".$news."
comments: ".$comments."
";
$message = stripslashes($message);
mail("ccccccc@xxxxx.xxx","Form Submitted at your website",$message,"From: Book Formulary");
$link = mysql_connect("localhost","xxxxxxx","xxxxxxx");
mysql_select_db("book2",$link);
$query = "insert into book2db (fn,ln,ct,em,cat,req,ra,wa,cr,crdsc,nw,co) values ('".$fname."','".$lname."','".$city."','".$email."','".$category."','".$request."','".$realanswer."','".$wishanswer."','".$credits."','".$creditsdesc."','".$news."','".$comments."')";
header("Refresh: 0;url=thankyou.htm");
}
?>
=========================================================
And here are 2 lines in the error log of the server I get:
[Fri Jun 27 07:06:53 2003] [error] [client xx.xx.xxx.xx] PHP Notice: Undefined index: HTTPS in xxxxxxxxxxxxxxxxxxxxxxxxxxx\process.php on line 23, referer: http://xxxxxxxxxxxxxxxxxxxxxxxxxxx/form1.html
[Fri Jun 27 07:06:53 2003] [error] [client xx.xx.xxx.xx] PHP Warning: Cannot modify header information - headers already sent in xxxxxxxxxxxxxxxxxxxxxxxxxxx\process.php on line 42, referer: http://xxxxxxxxxxxxxxxxxxxxxxxxxxx/form1.html