Start with the Quickstart: http://framework.zend.com/manual/en/learning.quickstart.intro.html If you don't know the basics of PHP, I recommend you pick up a book. I loved this one back when I first learned PHP. http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166/ref=sr_1_1?ie=UTF8&s=books&qid=1265261741&sr=1-1
Your form is generated via JavaScript, but starting out with a plain HTML form will help you figure the steps out faster. Client side validation via JavaScript is good, but you need server side PHP validation too. You need to beef up on form processing (don't worry, so do I!). You'll catch flack on this site about injection attacks and such. If you can, you may want to investigate some books on web application security. Here are some books that can get you started.
In order for the following code to work, code similar to email.php must be called first so that the values are extracted from the $_POST superglobal array and stored in the variables that you use in contact.php ($name, $email, $human, $to, $subject, $body, $from). Otherwise, your form will, like you say, fail to contact you. This is a logic error, but you can fix it in no time if you find a good example.
No promises, but try this:
<?php
require('email.php'); //Assuming it is in the same directory as your contact.php
if ($_POST['submit']) {
if ($name !== '' && $email !== '') { //Variables have not been extracted from $_POST yet, as in email.php
if ($human === '4') {
if (mail ($to, $subject, $body, $from)) {
echo '<p>Your message has been sent!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
} elseif ($_POST['submit'] && $human !== '4') {
echo '<p>You answered the anti-spam question incorrectly!</p>';
} else {
echo '<p>You need to fill in all required fields!!</p>';
}
}
?>
I might suggest a few resources to beef up on form processing.
More importantly though, the cookie specification says that browsers need only accept 20 cookies per domain. This limit is increased to 50 by Firefox, and to 30 by Opera, but IE6 and IE7 enforce the limit of 20 cookie per domain. Any cookies beyond this limit will either knock out an older cookie or be ignored/rejected by the browser.
No. I'd argue that you should learn PHP first. There are tons of concepts you should be aware before you even consider creating applications using a framework, especially with Yii.
Yii has a higher learning curve than say CodeIgniter and CakePHP. While you might be able to create CRUD applications with them at first, it becomes a problem when you are faced with 'real-world' problems like content scraping, image manipulation, etc.
Learn PHP, create an application (blog/invoice app/inventory system) with vanilla PHP, and you'll be able to get on a framework and learn the framework, not much of the language(some concepts probably). PHP books are useful, when you get enough information from online. Books are good when you want to know different concepts from authors and you'll be fairly sure that the content is correct since they are edited by technical editors compared to unedited content you find online.
Welling & Thomson's PHP and MySQL Web Development is the gold standard:
http://www.amazon.com/PHP-MySQL-Development-Developers-Library/dp/0672329166/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1236994701&sr=8-1
I really liked this book, was clear, concise and informative.
http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166
Start with the Quickstart: http://framework.zend.com/manual/en/learning.quickstart.intro.html If you don't know the basics of PHP, I recommend you pick up a book. I loved this one back when I first learned PHP. http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166/ref=sr_1_1?ie=UTF8&s=books&qid=1265261741&sr=1-1
PHP and MySQL Web Development (4th Edition)
http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166
I'd say this book is a good start especially if you want to create a shopping cart site.
Your form is generated via JavaScript, but starting out with a plain HTML form will help you figure the steps out faster. Client side validation via JavaScript is good, but you need server side PHP validation too. You need to beef up on form processing (don't worry, so do I!). You'll catch flack on this site about injection attacks and such. If you can, you may want to investigate some books on web application security. Here are some books that can get you started.
PHP Security
Web Application Security
You need a
<form>
tag that has the following inside it somewhere.I found your opening
<form>
tag. Interesting.You may want to investigate your
action="#/email.php"
attribute a bit more. Is that what it's supposed to be?I usually do something like this (HTML 4.01 inside of PHP. You are using HTML5) (where this line is generated via PHP). Note: Incomplete example.
In order for the following code to work, code similar to email.php must be called first so that the values are extracted from the
$_POST
superglobal array and stored in the variables that you use in contact.php ($name, $email, $human, $to, $subject, $body, $from). Otherwise, your form will, like you say, fail to contact you. This is a logic error, but you can fix it in no time if you find a good example.No promises, but try this:
I might suggest a few resources to beef up on form processing.
PHP Programming, 3rd Edition
Beginning PHP
PHP, MySQL, & Apache: 5th Edition
PHP Cookbook, 2nd Edition
PHP and MySQL Web Development: 4th Edition
Learning PHP, MySQL, JavaScript, and CSS: Second Edition
Also, there are plenty of free tutorials on the web!
This is one of the things php is good for.
Since you say you are beginner programmer I'm going to point you to a basic tutorial on checking Databases with sql:
HP 101 (part 8): Databases and Other Animals - Part 1
This tutorial covers all you need:
In general all the PHP 101 series is really good for beginners.
If you prefer a more detailed coverage of the topic then: PHP and MySQL Web Development (4th Edition) is the best beginners book. IMO
Taken from this author's post
I believe for the unread/read status of forum posts should be done through the database. I could not find an example online, but I have read "PHP and MySQL Web Development (4th Edition)" and they have a section devoted to developing your own forum page. They supply example code and explain the process to get it started.
No. I'd argue that you should learn PHP first. There are tons of concepts you should be aware before you even consider creating applications using a framework, especially with Yii.
Yii has a higher learning curve than say CodeIgniter and CakePHP. While you might be able to create CRUD applications with them at first, it becomes a problem when you are faced with 'real-world' problems like content scraping, image manipulation, etc.
Learn PHP, create an application (blog/invoice app/inventory system) with vanilla PHP, and you'll be able to get on a framework and learn the framework, not much of the language(some concepts probably). PHP books are useful, when you get enough information from online. Books are good when you want to know different concepts from authors and you'll be fairly sure that the content is correct since they are edited by technical editors compared to unedited content you find online.
Sources I recommend:
freenode ##php
Once you get on a framework, you'll now know WHY you even need a framework. WHY you even want to code in MVC. WHY MVC fits you.