Skip to main content
Participating Frequently
May 30, 2017
Question

DW Form Code Question

  • May 30, 2017
  • 2 replies
  • 531 views

See bottom for question

www.roatan.ws/contact.html

Code for contact.html

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

</head>

<body>

<form>

  <p>

    <input name="textfield" type="text" id="textfield" placeholder="Name:">

  </p>

  <p>

    <input name="email" type="email" id="email" placeholder="Email:">

  </p>

  <p>

    <textarea name="textarea" id="textarea" placeholder="Comment"></textarea>

  </p>

  <p>

    <input name="submit" type="submit" id="submit" formaction="gdform.php" formenctype="text/plain" formmethod="POST" value="Submit">

  </p>

</form>

</body>

</html>

Godaddy Server:

www.roatan.ws/contact.html

and

www.roatan.ws/gdform.php

Code for 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"]."/");

    }

?>

================================================

When I test the form it returns to my home page, but does not receive at [email removed by moderator to save you from spam.] in my gmail account.

This is the address that I used in the Godaddy forms panel.

Need help...

This topic has been closed for replies.

2 replies

Rob Hecker2
Legend
May 31, 2017

When I test the form it returns to my home page, but does not receive at [email removed by moderator to save you from spam.] in my gmail account.

The script does not send an email. It writes to a file. It's a very amateurish script.

Nancy OShea
Community Expert
Community Expert
May 30, 2017

Consult GoDaddy help regarding GDform.php.  Your HTML code needs to match your script.  They have a generic form you can use on their web site.

Using Our PHP Form Mailers on Web & Classic Hosting | Web & Classic Hosting - GoDaddy Help US 

Nancy

Nancy O'Shea— Product User & Community Expert