Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1879
  • Last Modified:

email form where Godaddy.com is the host

Hello,

Godaddy is careful about how to make e-mail forms. They have a php file gdform.php that goes in the root directory, and I fill out the recipient's email address inside of godaddy.com. The call in the first line of the form in my contact.html page isis to the php form I made to control the form (form.php). I think I'm suppost to delete the row in form.php that has the mail statement and sais where the e-mail form goes.

When I use the current setup, my e-mail form completly acts like it is working, but no e-mail get's sent.
I cannot figure out how to successfully make this e-mail form work, please help.


contact.php URL: jibzauctions.com/nonf/index-5.html


form.php:

<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$menu1 = $_POST['comments'];

$message = "First-name: $first_name\n";
$message .= "Last-name: $last_name\n";
$message .= "E-mail: $email\n";

header("Location: http://jibzauctions.com/nonf/index.html");
?>  


And the gdform.php form handler:

<?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");
    $fp = fopen("../data/gdform_$t","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"]."/");
    }


?>

Thanks in advance,

Bob


0
weikelbob
Asked:
weikelbob
1 Solution
 
vickerleungCommented:
Bob,

I think at least you have to have the mail () function inside your script

Check out this really short tutorial about PHP sending email
http://email.about.com/cs/phpemailtips/qt/et031202.htm

Vicker
0
 
matt_mcswainCommented:
But you're not using godaddy's form handler, correct?
That's perfectly fine, if not preferred, but where is your call to mail()?

<?php
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$menu1 = $_POST['comments'];

$message = "First-name: $first_name\n";
$message .= "Last-name: $last_name\n";
$message .= "E-mail: $email\n";
if (!mail('youremail@domain.com','Subject',$message)) die('Mail Failed!');
header("Location: http://jibzauctions.com/nonf/index.html");
exit;
?>  
0
 
justinsaneCommented:
Godaddy has disallowed the use of the mail() function to prevent abuse.

I have also had a lot of trouble with sending mails on the fly with godaddy. After many email back and forth with them, the only conclusion they had for me was to get hosting elsewhere, because nearly any complex mailings would be banned.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
matt_mcswainCommented:
I use godaddy and am able to use mail(). But, I think you are right at least on their Windows servers.
And I've gone through the exact same thing you described. For instance, on one domain I could send multiple mails at once, but on another, if I tried to send more than one it would fail. I called them and got nowhere. Same old song and dance about, "We don't do tech support for client scripts." And I'd say, "There's nothing wrong with my script, it's your configuration!".

Maybe it had to do with their ban you mentioned.
Oh, and I ended up getting hosting elsewhere, too. ;)
0
 
justinsaneCommented:
It took many many emails back and forth to finally get them to admit that they banned it. Funny though, I'm sure i was on a unix server. Anyhow, I'm glad to be done with them.

Funny thing, now, 5 months later, I still get one or two of my "test" emails every few weeks that I suppose are finally sneaking through the queue.
0
 
weikelbobAuthor Commented:
I got it, I upgraded and used my own PHP driven forms.

Hope they fixed their problems!

Bob
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now