Create a WML Form to Collect user's comments, name and email address. Save following code as Guestbook.wml
PHP Code:
="1.0"?>
Guest Book!
Your Name :
Your Email:
Your Comments :
Please Click Here To SEND
And now create an-other file. This file contains PHP code to Create text file (user_comments.txt) in C:\. User_comments.txt file will hold all data submit by Users.
(Note : Save following file as save_comments.php and don't forget to save this both files in same directory)
/* Before Commercial use don't forget to ask me [email]yadish_sahar@hotmail.com[/email] */
("Content-type:text/vnd.wap.wml");
if (isset($user_name) and isset($user_email)
and isset($user_comments) and ($user_name and $user_email and $user_comments != ""))
{
$file_name="c:\user_comments.txt";
$file_data = fopen($file_name ,"a");
$data_to_write = "User Name is :".$user_name."\n".
"Email Address is :".$user_email."\n".
"He/She Submit this Comments :".$user_comments."\n".
"*************************\n\n";
fwrite($file_data,$data_to_write);
fclose($file_data);
echo "
Thank You!
Your Comments is Saved. Thank you very much again
";
}
else
{
Echo "
Some thing is Wrong with Your Form Submission!
";
}
?>
No comments:
Post a Comment