-
A journey leads to php....
PROCESSING FORMS
What is one thing almost everyone wants to do with their website? Have a contact form. And, it isn’t as difficult as you’d think. We’re going to use the PHP mail() command to make one.
Make an HTML form with Name, Email and Message fields. Take the code below and place it in a PHP file to use as your action.
<?php
mail("[email protected]", "Form Feedback", " // your address and subject
Name: $name
Email: $email
Message: $message
", "From: $email");
// Display results
echo("
<html>
Name: $name
Email: $email
Message: $message
</html>
");
?>
Section Two Overview
In this section, we covered some more advanced features of PHP. Not for the timid, but not impossible to grasp!
IF - Do something if something is true.
ELSE - Do something else if it isn’t
ELSEIF - Add more choices to IF
SWITCH - Use this if you have a lot of ElseIf’s
ARRAY - One variable, many values
ASSOCIATIVE ARRAY - One variable, even more values
LOOPS - For, While, For Each - A way to repeat code
FUNCTIONS - Turn a big code chunk into a small one
SESSIONS - Carry unique data from page to page
COOKIES - Store session data on your viewer’s computer
FORM PROCESSING - Process web forms, such as a mailer
QUIZ
1. What are the 3 ways to comment code in PHP?
2. ELSEIF cannot be used without __
3. What are Cookies used for in PHP?
-
-
thanx a lot for this tut.!
-
WOW!
this is a good One. I've bookmarked it for future reference. this time I'll concentrate on my web page designing. CSS and HTML
Then back here when I'm ready.
Thanks a lot
-
-
this is free phpnuk hosting.free and easy make your forum:
www.greatnuk.com
-
i am a beginer so i agree with your view and follow suit
-
waw thanks goooooooooooood
-
-
How can you remember all these sentences? I can't remember all these strings and I must have them on a side on a letter written. has someone have any idea how to know everycode? I know one thing:
<?php
phpinfo();
?>
or:
<?php
include(file.php);
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks