Hi all,
Im kind of a rookie when it comes to php and am currently stuck and hope someone out there may assist me in answering my question.
I recently followed the tutorial on Kirupa.com to make a PhP Contact Form.
It provides both the PhP file and the Html code. I have got it to work exactly how it has set itself to do. However I am wanting to adapt some things about it.
Currently the code for the PhP file is:
<?php
if(isset($_POST['submit'])) {
$to = "you@you.com";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field
E-Mail: $email_field
Message:
$message";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
So basically whats happening is I fill out the form and press send! Once I press send its loading up the php file with a message “Data has been submitted to $to!”, which I gathered is linked to the echo string within the PhP file.
Now what Im wondering and hoping for is adapting this part of the code, because what Id rather have is directing it to a webpage of my own instead of an echoed message.
So… is this possible? if so, how?
If anywhere out there has the knowledge or info id be glad to hear from you and would greatly appreciate it!
Many thanks,
Bigbalroo