Forum Moderators: mack
I want to be able to edit and write the code that processes my reply form on my website. Like for instance, instead of putting my email address, I want to put a simple reply form for people to send me messages through. Or even have multiple choice questions for people to answer, then their answers would be processed by the form and sent to me.
I've heard of CGI and PERL. I want to know is processing a form possible only using PHP, for instance? Since I'm already studying it? What are my best options, according to the information I just gave, to be able to code the processing of my web forms?
Thanks for anyone taking the time to help.
What are your concerns?
My concerns are:
1. the difficulty of learning to process the form or the learning curve (even though I already know that PHP is not hard to learn at all, so it was a relief that you told me PHP alone suffices for this job, but it's just that I don't have that much time);
2. how much time or attention I will need from the website host's administrator, as my host is not very powerful and without a fancy graphical control panel and so, much of the stuff has to be done manually especially by the administrator himself, who is rarely available (!);
3. and finally the format in which I will receive the visitors' answers, especially the multiple-choice answers and numerical data and stuff. I'd like to receive this data in a presentable, easily readable and storeable format. I remember 4 or 5 years ago, when I first tried to process a reply form using the cgi-bin, something had to be done so you can even begin to read the answers.
2. You shouldn't need much from the admin at all. As long as your host is reliable...that's all that really matters. I would looks for a host that is more readily available...but I'm sure you have a good reason for using this particular host...so as long as it supports PHP you're all set.
3. You can receive it however you want. You will have to program how you want it to send you the data. You can keep it simple and have it just give you the input name and the value...or you can get as complex with it as you want...it all depends on how much time you want to spend programming it.
u have to just place this file in the folder where the page is and that it
<?PHP
$to = "email@yourwebsite.com where it is to be send";
$subject = "New Application";
$headers = "From my website";
$forward = 1;
$location = "its the address of pag where u shd go after submitting thanks.htm";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thanks! . We will get back to you as soon as possible.";
}
?>
make the form and configure submit button so that this php file shoould handle processing.
for using this u must have support for php on your server,nothing else rest is just 2 minutes job