dump3cz
Üyeliği Durdurulmuş
Banlı Kullanıcı
-
Üyelik
01.05.2017
-
Yaş/Cinsiyet
25 / E
-
Meslek
Yazılım
-
Konum
Bilecik
-
Ad Soyad
O** Ç**
-
Mesajlar
1749
-
Beğeniler
169 / 326
-
Ticaret
3, (%67)
You tube
http://www.youtube.com/watch?gl=NG&feature=related&hl=en-GB&v=_JEEQ-OPVAY
Presentation
http://www.slideshare.net/mgirouard/a-gentle-introduction-to-object-oriented-php
Other Links
http://buildinternet.com/2009/07/an-introduction-to-object-oriented-php-part-1/
http://blog.teamtreehouse.com/getting-started-with-oop-php5
Example of what you want
class RegisterUser {
private $firstName;
private $lastName;
private $emailAddress;
function __construct() {
$this->firstName = isset($_POST['first_name']) ? $_POST['first_name'] : null;
$this->lastName = isset($_POST['last_name']) ? $_POST['last_name'] : null;
$this->emailAddress = isset($_POST['email_address']) ? $_POST['email_address'] : null;
}
function start() {
if (empty($this->firstName) || empty($this->lastName) || empty($this->emailAddress)) {
throw new Exception("Empty Post not allowed");
}
else
{
// Do some stuiff
echo " Registration Done";
}
}
}
$register = new RegisterUser();
if(!empty($_POST))
{
$register->start();
}