there is a header("refresh ... statement at the bottom of process.php . Check and see if it contains your thank you page URL. If it does, try replacing it with header("Location: url_to_your_thank_you_page"); Also make sure there are no spaces before the php tag (<?php) at the very top of the process.php file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-06-26
Tried it. Still leaves a blank (process.php) page...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2003-06-27
I'm still getting a blank page instead of my thankyou page after the form is processed.
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:
For some reason the data gets posted correctly but the process.php file does not call my thank you page. The url is ok but...
Does anyone know how to solve this?
there is a header("refresh ... statement at the bottom of process.php . Check and see if it contains your thank you page URL. If it does, try replacing it with header("Location: url_to_your_thank_you_page"); Also make sure there are no spaces before the php tag (<?php) at the very top of the process.php file.
Tried it. Still leaves a blank (process.php) page...
I'm still getting a blank page instead of my thankyou page after the form is processed.
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
Turn notices off in PHP, you don't need them they're for detailed debugging. If that doesn't work, get rid of line 23.
Also, don't post the same thing twice ... redundancy is annoying.
Thanks, the notice thing worked!