Welcome to Welcome to DNF.com™ - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars

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!

Results 1 to 5 of 5
  1. #1
    Gold Lifetime Member

    Join Date
    Jan 2005
    Location
    Chicago, IL
    Posts
    164
    DNF$
    804
    Bank
    0
    Total DNF$
    804
    Donate  

    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"]."/");
        }
     
     
    ?>

  2. #2
    Gold Lifetime Member

    Join Date
    Oct 2004
    Posts
    204
    DNF$
    340
    Bank
    0
    Total DNF$
    340
    Donate  

    Re: Feedback form [PHP]

    on the last line change "/" to "/thanks.htm"

  3. #3
    Gold Lifetime Member

    Join Date
    Jan 2005
    Location
    Chicago, IL
    Posts
    164
    DNF$
    804
    Bank
    0
    Total DNF$
    804
    Donate  

    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>

  4. #4
    Gold Lifetime Member

    Join Date
    Oct 2004
    Posts
    204
    DNF$
    340
    Bank
    0
    Total DNF$
    340
    Donate  

    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.

  5. #5
    Platinum Lifetime Member

    Join Date
    Nov 2004
    Posts
    967
    DNF$
    1,247
    Bank
    0
    Total DNF$
    1,247
    Donate  

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Domain name forum recommended by Domaining.com