Replace (go daddy) gdform.php with custom php form mailer
Results 1 to 4 of 4

Thread: Replace (go daddy) gdform.php with custom php form mailer

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    3

    Replace (go daddy) gdform.php with custom php form mailer

    Hello, and thanks in advance for any assistance -

    I have a website on godaddy, and I've been using their gdform.php script for form mailing.

    It is in 2 parts - the gdform.php which is in my folder, and the mailer which I cannot view or edit, on their server.

    As it exists, the email subject is determined in my html, and the mailto address was entered in godaddy control panel.


    My objective:

    A) To create a php form mailer script which will replace the gdform entirely.

    B) I want new script to grab the contents of 1 form field (customer name) and add it to the emial subject line.
    ie: I want the email subject to read "Order from: 'customer name'" //from "Editbox14"



    I am a complete novice in php. I have moderate knowledge with HTML. I am quick and creative, but I lack background - so please don't make assumptions on what I know. Since this is a short script, the most helpful would be fully formed script suggestions for me to play with. (doctor mine below)

    -----------------------------------------------------------------

    Here is the html line which posts the form and defines the email subject line:

    <form name="Form1" method="post" action="http://www.mywebsite.com/test/mmcform.php" enctype="multipart/form-data" id="Form1" onsubmit="return ValidateForm1(this)" ><input type="hidden" name="redirect" value="purchase.html"><input type="hidden" name="subject" value="Order From:">


    -----------------------------------------------------------------

    Here is the existing 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"]."/");
    }


    ?>

    --------------------------------------------------------------------

    Here is a variant I've been modifying and testing (with no success so far)

    (I changed the script name to mmcform.php, and replaced all references to gdform with mmcform in both php and html.)

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

    $to ="myemail@email";
    $from = $_POST['Editbox14'];
    $subject ="Order from:" . $_POST['Editbox14'];
    mail($to ,$from , $subject, $message)

    $message .= '$_POST['Editbox1']
    $message .= '$_POST['Editbox2']
    $message .= '$_POST['Editbox14']

    $file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
    $fp = fopen($file,"w");
    while (list ($key, $val) = each ($query_vars)) {
    fputs($fp,"<MMCFORM_VARIABLE NAME=$key START>\n");
    fputs($fp,"$val\n");
    fputs($fp,"<MMCFORM_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"]."/");
    }

    mail($to,$from, $subject, $message)
    if(!mail){
    echo 'Message Not sent!';
    }
    echo 'Message was sent!';


    ?>

    Thanks so much again for any assistance

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Posts
    9
    I have used formmail.php from tectite.com on godaddy without too much trouble. It's free and robust.

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Posts
    3

    Thanks

    Thanks for the suggestion - looks good. I'm testing.

  4. #4
    Junior Member
    Join Date
    Sep 2008
    Posts
    1

    Thumbs up THANKS!

    Quote Originally Posted by davidannis View Post
    I have used formmail.php from tectite.com on godaddy without too much trouble. It's free and robust.
    Just want to say thanks for the info here. I was having trouble with godaddy and it's gdform.php and was searching all over for some remedies. Came across this info after not much luck elsewhere and finally success! I'm used tectite.com's formmail.php on my site with relative ease, even tweaking it for my own specific needs. (i'm building my first site and learning as i go, so relatively easily means a lot here.) was really impressed with how they basically walk through how to install and test right away on their readme.txt file downloaded with the rest of the files. anyone else out there having trouble with forms, particularly on godaddy, i would highly recommend tectite's... it's free, btw.

    again, thanks a lot for the info.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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