?
Solved

email form where Godaddy.com is the host

Posted on 2005-03-23
6
Medium Priority
?
1,866 Views
Last Modified: 2008-01-09
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
Comment
Question by:weikelbob
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 16

Expert Comment

by:vickerleung
ID: 13618507
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
 
LVL 11

Accepted Solution

by:
matt_mcswain earned 2000 total points
ID: 13618524
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
 
LVL 1

Expert Comment

by:justinsane
ID: 13625130
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Expert Comment

by:matt_mcswain
ID: 13625240
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
 
LVL 1

Expert Comment

by:justinsane
ID: 13630770
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
 
LVL 7

Author Comment

by:weikelbob
ID: 13632121
I got it, I upgraded and used my own PHP driven forms.

Hope they fixed their problems!

Bob
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question