today I have written my first PHP script (and it even works, how cool!) and I have few questions.
Here's the script
<?php $to = "firstname.lastname@example.org"; $subject = "Comments on page"; $message = $_POST["comments"]; mail($to,$subject,$message); echo "Thank you for sending your feedback. That will help me improve the website."; ?>
and this is the element it applies to (I am testing it onto this page http://antobbo.webspace.virginmedia.com/webediting/documents.htm)
<form action="email.php" method="post"> <p><input type="button" value="Comment" onclick="showCommentBox()"><br></p> <div class="hidden" id="comment"> <p>Comments and suggestions:<br><textarea name="comments" rows="3" cols="30"></textarea><br><br> <input type="submit" value="Send"></p> </div> <!-- end of comment_box--> </form>
Now, the action page is email.php which then displays a message upon form submission (I still need to style this page a bit so it has just a simple message at the moment) and I kind of wondered how I can after say 5-10 seconds redirect people back to my website automatically rather than leaving them on the php page. Do I need to do that in PHP or can I do that in Java script? And where would I place this new script (or should be part on another script?!)...sorry I hope I am making some sense!