Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Simple Feedback Form Using GoDaddy
Old 03-29-2005, 09:07 PM Simple Feedback Form Using GoDaddy
ncriptide's Avatar
Skilled Talker

Posts: 72
Name: Reggie Byrum
Location: Charlotte, NC
Trades: 0
Okay, don't laugh - I've never configured a feedback form before. . .

I've created my simple form (name, address, email, etc) and all I want it to do is to send the results to my email address. Having never done a form before, I don't know what to put in my html code, or what I need to change in my gdform.php.

If anyone has done this, could you PLEASE clue me in? Following is a snippet of what is on my html form:

<FORM action="gdform.php" method="post" name="cdmember" id="cdmember">

Following is the gdform.php:

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


?>


HELP!!!!!
ncriptide is offline
Reply With Quote
View Public Profile Visit ncriptide's homepage!
 
 
Register now for full access!
Old 03-30-2005, 06:41 AM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
Can we see the complete pages. ie form and your action page

for a sample of some of my forms look at http://join.jonspcrepair.com/joinamw.php and http://iraqif.jonspcrepair.com/index.php?p=contact
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1

Last edited by amw_drizz; 03-30-2005 at 06:44 AM..
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 03-30-2005, 11:53 AM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
try this (after backing up your existing script)...

PHP Code:
<?php

if ($_SERVER["REQUEST_METHOD"] == "GET"){
    
$query_vars $_GET;
} else (
$request_method == "POST"){
    
$query_vars $_POST;
}
reset($query_vars);

$message "";
$t date("U");

$fp fopen("../data/gdform_$t","w");
while (list (
$key$val) = each ($query_vars)) {
    
fputs($fp,"<GDFORM_VARIABLE NAME={$key} START>\n{$val}\n<GDFORM_VARIABLE NAME={$key} END>\n");
    if (
strtolower($key) == "redirect") {
        
$landing_page $val;
    } else {
        
$message .= "{$key}:\t{$value}\n";
    }
}
fclose($fp);

mail("you@yourdomain.com""Form Submission"$message);

if (
$landing_page != ""){
    
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
} else {
    
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}

?>
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Simple Feedback Form Using GoDaddy
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21544 seconds with 12 queries