It appears you have not yet registered with our community. To register please click here...

DNforum.com - Domain Sales, Domain Forum, Domain Appraisals
 
Register Now!
Register Now for FREE!
Our records show you have not yet registered to our forums. To sign up for your FREE account INSTANTLY fill out the form below!

Username: Password: Confirm Password: E-Mail: Confirm E-Mail:  
Birthday:       I agree to forum rules 

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Scripts
Reply
 
LinkBack Thread Tools Display Modes
Old 09-28-2005, 08:05 PM   #1 (permalink)
Gold Lifetime Member
 
Name: Douglas McEwing
Last Online: 06-20-2008 08:00 AM
iTrader: (7)
Join Date: Jan 2005
Posts: 146
DNF$: 0
Location: Chicago, IL
Country:


Feedback form [PHP]

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"]."/");
    }
 
 
?>
chidoug is offline   Reply With Quote
Sponsored Links
Old 09-30-2005, 01:32 AM   #2 (permalink)
Gold Lifetime Member
 
Last Online: 11-03-2005 05:10 PM
iTrader: (5)
Join Date: Oct 2004
Posts: 206
DNF$: 300


Re: Feedback form [PHP]

on the last line change "/" to "/thanks.htm"
Gray is offline   Reply With Quote
Old 09-30-2005, 08:37 AM   #3 (permalink)
Gold Lifetime Member
 
Name: Douglas McEwing
Last Online: 06-20-2008 08:00 AM
iTrader: (7)
Join Date: Jan 2005
Posts: 146
DNF$: 0
Location: Chicago, IL
Country:


Re: Feedback form [PHP]

Quote:
Originally Posted by Gray
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 iFrame


hey i got it, thanks again for the help. i had to do what you suggested, but another change'
this is what i had
PHP Code:
if ($landing_page != "thanks.htm"){ 
</FONT>

and this is what i had to change it to
PHP Code:
if ($landing_page == "thanks.htm"){ 
</FONT>
chidoug is offline   Reply With Quote
Old 09-30-2005, 08:58 AM   #4 (permalink)
Gold Lifetime Member
 
Last Online: 11-03-2005 05:10 PM
iTrader: (5)
Join Date: Oct 2004
Posts: 206
DNF$: 300


Re: Feedback form [PHP]

On your form is there something like this?

<input type="hidden" name="redirect" value="index.html">


[EDIT] OK no problem then.
Gray is offline   Reply With Quote
Old 09-30-2005, 02:02 PM   #5 (permalink)
Platinum Lifetime Member
 
Last Online: Yesterday 01:08 PM
iTrader: (38)
Join Date: Nov 2004
Posts: 799
DNF$: 518


Re: Feedback form [PHP]

Hi

This is what im using in most of my sites:

PHP 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 ;

?>
*Copy the code and save it as feedback.php
*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.
hostele is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 05:04 AM.
Copyright @2001-2008 DNForum.com

Learn Domains
Promote Domains
Research Domains
Buy Domains
Resell Domains
Park Domains
Sell Domains
Build Domains
Host Domains
Trademark Domains
Domain Domains
manage Domains
Appraise Domains