Parse HTML form results in PHP

Parse HTML form results in PHP

The following example shows an efficient way to parse through HTML form results and email you the results. This is very useful when we have large forms with many fields. We must define the variables Name and Email in your HTML form. Then only we can easily use this method to parse variables.

<?php
$Message = “”;
foreach($HTTP_POST_VARS as $key=>$value)
{
if ($value)
$Message .=”$key: $value\r\n”;
}
mail(”mail@domain.com”, “Form Results”, stripslashes($Message), “From: $Name ” );
?>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.