PHP Form Problems with GoDaddy

Hi Everyone!

I know there has been several posts about this same problem, but I can’t seem to find a solution anywhere.

I have been using the same code for a contact form for several sites (hosted with GoDaddy) and editing the gdform as necessary — My last site will redirect properly to the “Thank You” page but for some reason my client isn’t getting the emails that should be sent to his email address.

I just reinstalled the scripts directory via GoDaddy and specified the email address, but I’m wondering if I need to refresh the gdform.php file that is already posted on the site for it to work?

Any suggestions?

Suggestions? Sure, post the code you’re having problems with. :wink:

The only gdform.php source code I can find, doesn’t have a [fphp]mail/fphp call in it.

here’s the PHP code?

<?php
    
    // Subject of email sent to you.
$subject = 'Fern Landscaping Website Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'chris@fernlandscaping.com';

// Where to redirect after form is processed.
$url = 'http://www.fernlandscaping.com/thankyou.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0'; 
    $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\
"); 
        fputs($fp,"$val\\r\
");
        fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\\r\
");
        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"]."/");
    }
?>

That script, never attempts to send any type of email I’m sorry to say.

It does however, create file on the server (in the ssfm folder) with the form data.

yikes! well that could explain my problem! :slight_smile: Thanks Anthony

I’ll quickly knock something up for you if you like?

if you could help, I’d really appreciate it! I don’t have much familiarity with PHP and am trying to figure out where the sending email command would be - I have a similar form on my personal site and I get contact emails from it so I’m not sure what I missed!

I appreciate it! :slight_smile:

Here is a free contact form script that used to work with Godaddy. Give it a try.
Creating a contact form for your website

i worked with GoDaddy servers before and i think they have the mail() disabled. numerous times i bumped into this problem… i just end up telling the client to move to my server lol… i hate figure stupid **** like that.

literally nothing is working. I had Anthony help me re-write my PHP form and it’s still not taking on GoDaddy — and after he pointed out the errors in my original php form I realized that my own site (that i thought was using the gdform) is NOT using that to send me my form mail, and now am completely confused.

Wow, things just arn’t going well at all!

PHP4 (yes, 4!), mail function disabled, nearly all f*() functions disabled too, PEAR should be available but just isn’t (despite being in include path).

I’ve tried alternate libraries with various methods (SMTP, SMTP Auth’d), a collection of supposedly available servers. Which aren’t.

Not to mention this cached php.ini b*llocks.

Bloody awful, just awful.

However, I will not be beaten. :smiley:

Have you tried contacting their technical support line (480) 505-8877 and asking them how you can get mail() enabled?

After a quick Google search you are definitely not the only one experiencing this problem so their techs should have something (cross fingers).

I came across this thread and if you skip the WordPress posts and read the last one it mentions being able to switch your GoDaddy account from Windows to Linux hosting for free, which apparently solved the poster’s similar dilemma. It was posted only a couple months ago so it may be something worth asking tech support about.

Good luck and please let us know if/how you resolve this issue :slight_smile:

Hi beeb93,

Thanks for chiming in, I appreciate it!

Sadly, I do think Sarah is going to have to contact the host to help resolve some issues. I’m compiling an email detailing some points for her to bring up.

I find it criminal almost, that GoDaddy can offer ‘PHP’ hosting yet cripple it so much in the name of security.

Laziness, that’s all it is, laziness. :mad:

I feel a lot better knowing it’s not just strictly a silly mistake i made!!! :slight_smile: Thanks for all of your suggestions

I just tried switching over the Linux hosting plan and tested it again - I’m crossing my fingers that will do the trick because I just called GoDaddy and the wait time was ridic. If not, I’ll call them back and let you all know what they have to say for themselves!!
grr - shakes fist

any idea why i would be getting this error message on my redirect?

Warning: Cannot modify header information - headers already sent by (output started at /home/content/f/e/r/fernlandscape/html/webformmailer.php:2) in /home/content/f/e/r/fernlandscape/html/webformmailer.php on line 31

Simply put, headers are information the client (aka browser) sends to the server. If your script attempts to send headers manually then it must be done BEFORE any single character (even spaces) are sent. Otherwise you get that infamous header error message you quoted.

Without seeing your script, one can put

<?php ob_start(); ?>

as the very FIRST line in the page and then put

<?php ob_end_flush(); ?>

as the very LAST line.

This enables something called “Output Buffering” that basically keeps all data in a “toilet” then “flushes” the data once everything has been written out.

It wouldn’t hurt to copy and paste the contents of “webformmailer.php” here just in case there’s something else that needs attention.

Perhaps wait for a PHP guru here on the forums to double-check my info before you implement anything in case I missed something. :slight_smile:

my client just emailed me and told me that he received a couple of my emails with my contact information —problem is, now I have no clue where I was in the process since I (and by I, I clearly mean Anthony!) have tried so many things. I guess this is a learning process!

Will post when I figure out something (or when I have more problems, but I’m trying be positive!! haha)

LMAO Anthony… i was the same way… i was like **** that i will not be beaten’ well guess what they kicked my ass lol

seriously its not even worth the effort. GoDaddy hosting is made for really basic 1 pager / ‘make your own website template’ type of websites.

GoDaddy is great for domains and thats it.

just got a message from godaddy customer support saying

Only Windows accounts running IIS7 can use gdform.php.

can anyone tell me exactly what that means and how i’d find out if i’m running that? THANKS!

Hi Sarah,

All fixed for you, I have configured your script/server and tested the form. :slight_smile:

Yay! Well done you.

Anthony.