GoDaddy's mail form

Discussion in 'PHP' started by lydiany, Jul 23, 2007.

  1. #1
    I am trying to get my mail form up and working, I have my website hosted through GoDaddy. They gave me a .php document to put in with my website but I don't know how to customize it so it works. When I click submit on my form it just pops open a new window with the homepage of my website and I never get the email. Can someone help me with what code I need to insert and where? I would be forever grateful. Thanks!

    <?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");

    $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
    $fp = fopen($file,"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 != ""){
    header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
    } else {
    header("Location: http://".$_SERVER["HTTP_HOST"]."/");
    }

    ?>
     
    lydiany, Jul 23, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    This script doesn't send any emails. Check your server if there's a folder called "data". There should be a few files in there holding the submitted data.

    If you want to receive real emails, I suggest you have a look at www.hotscripts.com - There are a lot of free and easy to use scripts.
     
    nico_swd, Jul 23, 2007 IP