on the last line change "/" to "/thanks.htm"
If you are new to domains and looking to buy, sell and learn about domains then you have come to the right place. DNForum is the largest domain name community on the internet and continues to grow every day. There are over 105,000 domainers on DNForum doing everything from buying domains, selling domains, learning about domains and discussing domains. Take a minute and Register.
Register Today on DNForum IT'S FREE!A friend wanted to put a feedback form on his site, and I did the best I could. Just about everything works. People are able to input their data and then summit it, but when it comes to the redirect after hitting the summit button, it doesn’t load the way I would prefer.
I have a [thank you] page, but after hitting summit the index loads in the Iframe…. Can anyone take a look at the coding and maybe point me in the right direction? PM me if you want to take a look at the feedback page, i will then supply the url
PHP Code:<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$fp = fopen("../data/gdform_$t","w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != "thanks.htm"){
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
} else {
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>
on the last line change "/" to "/thanks.htm"
Thanks for your help, but this didn’t work either, the index page continues to load in the iFrameOriginally Posted by Gray
hey i got it, thanks again for the help. i had to do what you suggested, but another change'
this is what i had
</FONT>PHP Code:if ($landing_page != "thanks.htm"){
and this is what i had to change it to
</FONT>PHP Code:if ($landing_page == "thanks.htm"){
On your form is there something like this?
<input type="hidden" name="redirect" value="index.html">
[EDIT] OK no problem then.![]()
Hi
This is what im using in most of my sites:
*Copy the code and save it as feedback.phpPHP Code:<?
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'admin@YourDomain.com;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "Contact Form" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.YourDomain.com/offer.html" ;
$errorurl = "http://www.YourDomain.com/error.html" ;
$thankyouurl = "http://www.YourDomain.com/thank.html" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$domain = $_POST['domain'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($domain) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"NAME:\n" .
"$name\n\n" .
"EMAIL:\n" .
"$email\n\n" .
"DOMAIN:\n" .
"$domain\n\n" .
"COMMENTS\n" .
"$comments\n" .
"\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
header( "Location: $thankyouurl" );
exit ;
?>
*You will need a thank you page & error page.
*You will also need to place this in your contact page:
<form action="http://www.YourDomain.com/feedback.php" method="post">
It always work for me.![]()
Bookmarks