• GoDaddy Community
  • Websites + Marketing | Website Builders
  • Websites + Marketing | Website Builders

    cancel
    Showing results for 
    Show  only  | Search instead for 
    Did you mean: 
    Go to solution
    Highlighted
    New

    First Time Using gdform.php, No Emails Received

    I'm trying to use gdform.php to collect emails for the first time, but nothing is coming through. 

     

    My HTML form:

     

    <form class="form-horizontal" name="contact_form"  action="/gdform.php" method="post">
                    <div class="form-group">
                        <label for="yourName" class="col-sm-2 control-label">Your name:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="yourName" name="yourName" placeholder="Your name">
                        </div>
                    </div>
                    <div class="form-group">
                            <label for="yourEmail" class="col-sm-2 control-label">Your email:</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="yourEmail" name="yourEmail" placeholder="Your email">
                            </div>
                    </div>
                    <div class="form-group">
                        <label for="yourMessage" class="col-sm-2 control-label">Your message:</label>
                        <div class="col-sm-10">
                            <textarea class="form-control" rows="5" id="yourMessage" name="yourMessage" placeholder="Your message"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-primary btn-lg btn-block" name="submit" onclick="formSubmit()">Submit</button>
                        </div>
                    </div>
                </form>

    The JavaScript function formSubmit just alerts the user that the form has been submitted.

    My gdform.php:

     

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

    Both index.html and gdform.php are in the root folder of the site. There is not error message, the user is redirected to index.html on submit. No email is received in the destination account, which I verified is correct.

    What am I missing?

     

    1 ACCEPTED SOLUTION

    Accepted Solutions
    Highlighted
    New
    Solution

    Re: First Time Using gdform.php, No Emails Received

    Nevermind, it works; emails just ending up in Junk folder

    View solution in original post

    1 REPLY 1
    Highlighted
    New
    Solution

    Re: First Time Using gdform.php, No Emails Received

    Nevermind, it works; emails just ending up in Junk folder

    View solution in original post