PHP Help Needed
Posted: Tue Mar 30, 2010 2:14 pm
Hi,
I need help in my PHP code, this simply takes all values from all text boxes on my form and sends all to my email.
The problem is that it reverses the fields, for example, 1st field is name, 2nd is email and 3rd is message on my form, but this form sends it to me in reversed order!
This is the first lines of my code which collects all fields and I think should be changed:
Code:
Please anyone knows how can I do it? I am newbie at PHP.
Thanks all
I need help in my PHP code, this simply takes all values from all text boxes on my form and sends all to my email.
The problem is that it reverses the fields, for example, 1st field is name, 2nd is email and 3rd is message on my form, but this form sends it to me in reversed order!
This is the first lines of my code which collects all fields and I think should be changed:
Code:
Code: Select all
<?php
// Create Message Text
$form_fields=array_keys($HTTP_POST_VARS);
while($field=array_pop($form_fields)){
if ($field != "To")
$temp.=" $field : = $HTTP_POST_VARS[$field] \n";
}
// Read POST request params into global vars
$from = $_POST['Email'];
$message = $temp;
// Obtain file upload vars
$fileatt = $_FILES['File']['tmp_name'];
$fileatt_type = $_FILES['File']['type'];
$fileatt_name = $_FILES['File']['name'];
...Thanks all