Results 1 to 7 of 7

Thread: GoDaddy gdform.php problem

  1. #1
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default GoDaddy gdform.php problem

    Hello,

    Ive read some other threads on the gdform.php but none of them were really able to help me out, so Im hoping someone can!

    Now, Im not very familiar with php, however I would like to create a form on the site where people can fill it out and it gets sent to my e mail- simple enough I thought, since godaddy provides instructions for their gdform!

    Well, I saved my gdform.php in the same folder as my form html which is as follows:
    Code:
    <style type="text/css">
    <!--
    .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
    
    body {
    	background-color: #E6DEEB;
    }
    .style2 {font-size: 12px}
    .style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; }
    -->
    </style>
    <body scroll="yes">
    <form action="gdform.php" method="post" enctype="text/plain">
    <input type="hidden" name="subject" value="Form Submission" /> 
    <input type="hidden" name="redirect" value="http://www.trinityinvestmentgroup.net/sell/sell/thankyou.html" />
    <p><span class="style3">First Name</span><span class="style2">:</span>
      <input type="text" name="FirstName" /></p>
    <p><span class="style3">Last Name:</span>
      <input type="text" name="LastName" /></p>
    <p><span class="style3">E-Mail:</span>      
      <input type="text" name="email" /></p>
      <p><span class="style3">Phone:</span>      
        <input type="text" name="phone" /></p>
    <p><span class="style3">Sales Price:</span> 
      <input type="text" name="sales price" size="20" maxlength="20"></p>
    <p><span class="style3">Lot Address:</span> 
      <input type="text" name="lot address" size="55" /></p>
    <p><span class="style3">Lot Dimension:</span> 
      <input type="text" name="lot dimension" /></p>
    <p><span class="style3">Land Description</span><span class="style2">:</span> 
      <textarea name="land description" cols="40" rows="10"></textarea>
    <p><span class="style1 style2">Comments</span><span class="style2">:</span>
      <textarea name="comments" cols="40" rows="10">
    </textarea>
    </p> 
    <input type="submit" name="submit" value="submit"/>
    </form>
    Then, my gdform that godaddy has provided looks like this:
    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");
    
        $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"]."/");
        }
    
    
    ?>
    Now, Im having two issues- my thankyou.html redirect page is not coming up- but my index page when I hit Submit.
    AND when I submit something- its not in my inbox. Or in my spam folder. Its like its not working. Does anyone have any ideas? And please as layman as possible! lol.. thanks!
    Last edited by djr33; 10-22-2007 at 06:26 PM.

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Ugh. GoDaddy stuff.

    Use the mail() function. Much easier.
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Oct 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you for the suggestion, but as I stated before I am no php or coding expert period, so I wouldnt even know how to begin with the mail function... I clicked on the link in your reply for the mail function and... well... I just dont get it lol. Im sorry

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, this stuff isn't exactly easy, but you can work it out.
    Using godaddy's setup will likely be harder, perhaps not in it's concept, but in the end because it will be buggy. I use godaddy but haven't bothered trying their scripts; I just write my own.


    $landing_page is the page it will be sent to, IF that variable is defined. Otherwise, it directs to the main page on the site as you have not specified a page.
    Use this to set the page, anywhere near the top of the php script:
    $landing_page = 'mypage.php'; //your.com/mypage.php

    Now, as for it not sending the mail, I have no idea.

    That script is not meant to send mail. It writes the data to a file, with fopen() fputs(), etc. Then, I would guess, the server automatically sends the contents of such a file to your email address, if this has been properly setup.

    From what I can see, the PHP looks accurate enough and the file is likely being generated. You could echo the contents of the file to check, but as it likely is working, I'd suggest going into cpanel and checking out what the settings are-- is it set to the right email? etc.


    However, using mail() is quite basic:
    mail($to,$subject,$body); //sent
    Just be sure to have all of that info right and you're done.

    Note: I have had some weird/fatal problems using mail() on godaddy's windows servers, if you happen to not be on linux (on linux, it works fine).


    Please use [code] tags around code when you post it. Much easier to read. I just added them to your post, by the way.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Nov 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default gdform.php

    I had the same problem and wound up finding this forum from a search engine, so hello everyone. I gather from the phpinfo() page, that GoDaddy has the mail() function disabled on its NT servers(the sendmail_from category has no local or master value). So your only option is to conform to their standards.

    Also, more good news, apparently the file is written and is then sent to the MX on an hourly que. So if you finally do figure out exactly how GoDaddy wants the form to work and want to test it, you may have to wait an hour to see if it worked.

    While the form may have been designed to make things simpler, some of us are learning exactly why they call it a GD form.

    Here is how GoDaddy wants the form set up:
    http://help.godaddy.com/article.php?...10&topic_id=58

    I also found a site that claims that mail is not the only function disabled on GoDaddy machines. Here is a list provided by http://www.imscart.com :

    Godaddy PHP Disabled Functions (Linux): All Posix functions disabled. Also, the following functions are disabled: fpassthru, file, mail, exec, system, passthru, popen, crack_check, crack_closedict, crack_getlastmessage, crack_opendict, fsockopen, psockopen, opendir, readdir, closedir, phpinfo

    It has also been noted that they do not list ALL of the functions that they have disabled. For example move_uploaded_file() sometimes is disabled too.

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Windows servers with godaddy are weird. Then again, PHP on windows can just be weird sometimes anyway.

    That list is a bit off, though, at least. Clearly phpinfo is not disabled...
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Hey guys, did you find out what is the solution for sending mail with godaddy??

    I am facing the same problem, i have a shared windows hosting, this it my code in the contact.html:

    Code:
    <form action="/gdform.php" method="post" enctype="text/plain"><input type="hidden" name="subject" value="Form Submission" /> <input type="hidden" name="redirect" value="http://www.hrvojemesec.com/hvala.html" /><input type="text" name="FirstName" size="30" id="aaa"/><input type="text" name="email" size="30" id="bbb"/><textarea rows="20" cols="24" name="comments" id="ccc"></textarea><input type="submit" value="Šalji" id="ddd" /></form>
    and this is godaddy's gdform.php file for sending form mail:

    Code:
    <?php
    $landing_page = 'hvala.html';
    	$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'] . "\ssfm\gdform_" . $t;
    	$fp = fopen($file,"w");
    
    	while (list ($key, $val) = each ($query_vars)) 
    	{
    		fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\r\n"); 
    		fputs($fp,"$val\r\n");
    		fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\r\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"]."/");
    	}
    ?>
    I set it all up and when i send an email it gets in my inbox but it is blank!!! Help anyone!!

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
  •