Changing the way a submitted form looks when emailed

d44ve

Limp Gawd
Joined
Mar 28, 2007
Messages
422
OK, I have my form all setup and it is emailing me.... however, the way it looks in the email is difficult to read. Is there way where I can change the way it emails me? I know I can change what is says for each category, but it still comes out bunched together and just doesnt look good.

So basically I want to know if there is a way to change the way it looks when it comes through my email?

This is the way it looks now in my email :



Untitled.jpg









This is how I would like it to look like :





Untitled1.jpg
 
Some HTML an voila.

For the email headers you could specify:
Code:
Content-type: text/html; charset=iso-8859-1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Young DC's Services</title>
<link rel="stylesheet" type="text/css" href="view.css" media="all">
<script type="text/javascript" src="view.js"></script>
<script type="text/javascript" src="calendar.js"></script>
</head>
<body id="main_body" >
 
I meant the code you can't see from going to the web page, such as the PHP file the form submits to.
 
To elaborate on Sgraffite's post, we need the source code of gdform.php and possibly other required files.
 
Forgive me here.... you guys have been a lot of help...

but, how would I get you the source code of the gdform.php?
 
Is this what you are looking for?


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


?>
 
Did you rename the file? I'm looking at the 'form.html' and it now posts to 'formmail.php'. IIRC, it was gdform.php.

We need the text inside of gdform.php in order to determine and modify what it does.

I just looked it up and that is indeed gdform.php. It's an odd script, it doesn't do what someone would think. The first think I was looking for is a PHP mail function but it's not there.

All the script does is save the posted variables into a file gdform_(timestamp) and redirects the user if a redirect was specified.

Perhaps there is a mail cronjob running in the background that actually does the mailing.

The only thing that you could do with this is try to format the variables prior to submission yourself. It's hard to determine the outcome - for all we know the end result is plaintext, and not html. It depends how the rest of this mailjob is performed.

MAYBE this would work.

Code:
$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while(list ($key, $val) = each ($query_vars)) 
{
  if(!empty($val))
  {
    fputs($fp,"<GDFORM_VARIABLE NAME=<p style="background-color: #CCC>".$key."</p> START>\n");
    fputs($fp,"$val\n");
    fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
    if ($key == "redirect") { $landing_page = $val;}
  }
}
 
Back
Top