Add customer name to subject line of form submission email?

Discussing Html . Code , Software , other

Moderators: macek, egami, gesf

David4321
New php-forum User
New php-forum User
Posts: 4
Joined: Mon Jan 21, 2008 3:18 pm

Add customer name to subject line of form submission email?

Postby David4321 » Mon Jan 21, 2008 3:43 pm

Hello,

I'm using gdform.php from godaddy to email forward form submission information from my website.

I would like a way to grab the information from one of the form fields (customer's name) (or failing that, some other unique identifying stamp) and have it added to the subject line of the email I get.

Any suggestions? Thank you very much.

I am not much of a coder - I've just messed around a bit. (so spell it out please, I'm quick, but not much background)

the html line that references gdform and defines email subject line is:

<form name="Form1" method="post" action="http://www.mywebsite.com/gdform.php" enctype="multipart/form-data" id="Form1" onsubmit="return ValidateForm1(this)" ><input type="hidden" name="redirect" value="purchase.html"><input type="hidden" name="subject" value="Order Information">

gdform script is:

<?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");

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


?>

Return to “HTML Basics”

Who is online

Users browsing this forum: Google [Bot] and 1 guest