There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
PHP mail() help


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
cj_white's Avatar
Senior Member with 335 posts.
 
Join Date: Oct 2001
03-Mar-2004, 01:10 PM #1
PHP mail() help
i set up a form for visitor feedback on this site i just did. it has 4 questions and 4 text areas. it sends the answers to the processing script via POST. the script is below:

<?php
$msg= "Question 1: $HTTP_POST_VARS[q1]\n";
$msg.= "Question 2: $HTTP_POST_VARS[q2]\n";
$msg.= "Question 3: $HTTP_POST_VARS[q3]\n";
$msg.= "Question 4: $HTTP_POST_VARS[q4]";
$sendto= "*********";
$subject= "Feedback from Grove Theater Website";
mail( $sendto, $subject, $msg );
header("Location:success.html");
?>

this is the exact same script i have used on other websites and it has worked just fine. i first tried it with the email address i got with the domain and then i tried it with my personal account. neither of them received an email from the site. godaddy.com is hosting it. i have emailed their tech support to see if they have an answer. does anyone have an idea of whats wrong. the only thing i know that could be wrong is if the php.ini doesn't have a mail server assigned to it. thanks in advance
cj_white's Avatar
Senior Member with 335 posts.
 
Join Date: Oct 2001
03-Mar-2004, 07:35 PM #2
i got an email from godaddy.com tech support. they said they have the mail function disabled. just a heads up
Snake~eyes's Avatar
Senior Member with 639 posts.
 
Join Date: Apr 2002
03-Mar-2004, 08:33 PM #3
Weird, so I guess there's not much you can do. Except maybe store it in a database. Get a new host would be my suggestion.

Also why do you user the header function? Just put the succes.html code below that. Just curious.
cj_white's Avatar
Senior Member with 335 posts.
 
Join Date: Oct 2001
03-Mar-2004, 09:21 PM #4
i learned to use the header that way from Sam's PHP/MySQL/Apache book.
they said i could use a php file they had. here's the code for it. i'm not sure how to go about using it for the same purpose

<?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"]."/");
}


?>

i emailed the tech support back to see if they had documentation but i haven't heard from them yet.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:58 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.