PDA

View Full Version : form comes back in differnet order


ohiodoc
06-12-2012, 07:38 PM
I have this form and it works but when they fill it out the text file I get in my email comes in a different order then when they fill it out. Why is it doing this?
Here is the link. I need help with this.
http://www.residenceforpatriots.org/save.html

domedia
06-12-2012, 09:38 PM
The script that generates your email has the values from the form set in a different order.

ohiodoc
06-12-2012, 09:41 PM
So how do i change so it stays in the same order?

edbr
06-13-2012, 02:22 AM
cant say without seeing your mailing script

ohiodoc
06-13-2012, 02:26 AM
I am using godaddys php for the mail script.

edbr
06-13-2012, 05:17 AM
then ask them, if we dont see it how can we help?

ohiodoc
06-13-2012, 04:47 PM
here is the mail script

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

edbr
06-15-2012, 03:22 AM
i think it would be a mistake to mess with this, looks like the mailing is dome from another form that this date is inserted in. Its a simple generic form i would use a different one the one hee is pretty much the same

http://www.dreamweaverclub.com/dreamweaver-php-form.php you may need to increase the
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}

to allow more characters to be included.