English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

4 answers

Ditto ilan, above. You have to create the form as an html file, with action= pointing to a php file to email the output of the form to you. An example of the php file (the classic, "formmail") may be downloaded, and used, free, at http://www.dtheatre.com/scripts/ ...)

2007-10-17 04:58:59 · answer #1 · answered by fjpoblam 7 · 1 0

You kind of have it the other way around, the question should be how do I put an HTML comment form in a PHP page. You won't be able to execute any php commands in a page ending with .HTM or .HTML. The page has to be .php, the HTML has to be inserted normally and you can actually grab a source snippet for a comment form at http://www.planet-source-code.com under PHP section.

2007-10-17 11:17:07 · answer #2 · answered by ilan 6 · 1 0

You use the FORM HTML tag . . . then use the ACTION attribute to direct it to the processing page, something like, "process.php" to process the data.

2007-10-17 11:21:08 · answer #3 · answered by Runa 7 · 1 0

create a file called comments.php

// inserting the php code
//storing values of the field in php variables
$btn = $_POST['submit'] ;
$email = $_POST['email'] ;
$name = $_POST['name'] ;
$comments = $_POST['comments'] ;

if ($btn) {
$message = "Name : $name, Email : $email, $comments : $comments";
echo $message;
//or(if u want it to mail :
// if (mail("toyouraddess", "subject", "message")) { echo "Message Sent"; }
//or(for inserting into dbase) :
// include('urdbconnection.php');
// $sql = "INSERT INTO table_name('name', 'email', 'comments') VALUES ($name, $email, $comments);";
//if(mysql_query($sql)) { echo "Message has been submitted"; }
}
?>



Your Name :

Your Email :

Comments :


2007-10-17 12:00:19 · answer #4 · answered by Ayush 1 · 2 0

fedest.com, questions and answers