We can use Gmail SMTP settings to send mail in opencart.
Go to System -> Settings -> Mail tab
Select Mail Protocol: SMTP
SMTP Host: ssl://smtp.gmail.com
SMTP Username: your gmail username
SMTP Password: your gmail password
SMTP Port: 465
Domain Model Validation
Using some magic methods can integrate validation without having to implement get and set methods everywhere.
class ValidationException extends Exception {
}
abstract class DomainModel {
private $validationErrors = array();
final public function __get($field) {
$getMethodName = 'get' . ucfirst($field);
if (method_exists($this, $getMethodName)) {
return call_user_func(array($this, $getMethodName));
} elseif (isset($this->$field)) {
return $this->$field;
}
}
final public function __set($field, $value) {
$setMethodName = 'set' . ucfirst($field);
if (array_key_exists($field, $this->validationErrors)) {
unset($this->validationErrors[$field]);
}
if (method_exists($this, $setMethodName)) {
try {
call_user_func(array($this, $setMethodName), $value);
} catch (ValidationException $e) {
$this->validationErrors[$field] = $e->getMessage();
}
} elseif (array_key_exists($field, get_object_vars($this))) {
$this->$field = $value;
}
}
final public function isValid() {
return count($this->validationErrors) == 0;
}
final public function getValidationErrors() {
return array_values($this->validationErrors);
}
final public function setData($data) {
foreach ($data as $field => $value) {
$this->__set($field, $value);
}
}
final public function getData() {
return get_object_vars($this);
}
}
class Test extends DomainModel {
protected $message;
public function setMessage($msg) {
if ($msg == null || strlen(trim($msg)) == 0) {
throw new ValidationException("Message must not be empty");
}
$this->message = $msg;
}
}
$obj = new Test();
$obj->message = "Hello!";
echo $obj->message . "\n";
$obj->message = " ";
if (!$obj->isValid()) {
foreach ($obj->getValidationErrors() as $error) {
echo $error . "\n";
}
}
What is CakePHP? Why Use it?
http://book.cakephp.org/2.0/en/plugins.html
CakePHP is a free, open-source, rapid development framework for PHP. It’s a foundational structure for programmers to create web applications. Our primary goal is to enable you to work in a structured and rapid manner–without loss of flexibility.
CakePHP takes the monotony out of web development. We provide you with all the tools you need to get started coding what you really need to get done: the logic specific to your application. Instead of reinventing the wheel every time you sit down to a new project, check out a copy of CakePHP and get started with the real guts of your application.
CakePHP has an active developer team and community, bringing great value to the project. In addition to keeping you from wheel-reinventing, using CakePHP means your application’s core is well tested and is being constantly improved.
Here’s a quick list of features you’ll enjoy when using CakePHP:
Active, friendly community
Flexible licensing
Compatible with versions PHP 5.2.6 and greater.
Integrated CRUD for database interaction.
Application scaffolding.
Code generation.
MVC architecture.
Request dispatcher with clean, custom URLs and routes.
Built-in validation.
Fast and flexible templating (PHP syntax, with helpers).
View Helpers for AJAX, JavaScript, HTML Forms and more.
Email, Cookie, Security, Session, and Request Handling Components.
Flexible ACL.
Data Sanitization.
Flexible Caching.
Localization.
Works from any web site directory, with
PHP assignment operators
equal (=) sign is used to represent PHP assignment operator but in array we use => sign to assign value. Now take a look at an example of PHP assignment operators.
<?phpSave and run the above code.
$a = 20;
echo $a;
?>
We can use PHP arithmetic operator in PHP assignment operator. Here is an example:
<?php
$a=10;
$a+=10;
echo $a;
?>
PHP code for database connection and querry
PHP code for database connection and querry:
$link = mysql_connect("localhost", "root", "pass") or die("connection error");
mysql_select_db("database",$link);
Querry code:
$vec=mysql_query("SELECT * FROM PHOTOS");
for($i=0;$i"<"mysql_num_rows($vec);$i++)
(Take the "" out)
{
mysql_data_seek($vec,$i);
$a=mysql_fetch_row($vec);
echo"$a[0] $a[1] $a[2]";
}
Where $a[0] it's the first field in the querry result.
How to hack facebook accounts
Now that you have an account that you know is one of your victems friends and you have about 20 mutual friends. Add your victim and tell him or her that this is your new Facebook Account. There will be no reason for him/her to not beleive you and he/she will add you.
Now, since you are friends with the victim you will have 100 percent complete full access to their profile on facebook. You have access to school information, employment information, videos, private photo albums and anything else she’s added to the fb account.
This is a great way to get around using the traditional hacks that require some technical knowledge to using some basic psychological principles and social engineering.
Most of the time, you are not going to face any sort of challenge like that, but it is always best to know the potential consequences of any type of hacking endeavor. The smart hacker knows that despite knowing how to get someone’s Facebook password, they can only run from hired guns for so long when those folks have a lot more manpower and technology to track down those that ‘wronged’ a company as massive as Facebook. Just to see private Facebook pictures it may be worth it to you, and if so then you want to focus on the methods. Keyloggers are a prime choice if you have access to a computer the person uses to log into the site. You can install these easily enough and they will log the keystrokes of the person so you can see the password they type. That means you can then take that password and perform a natural login. However, be aware that these programs are not your only method. Plenty of people pretend to be someone else, talk to a person and manage to weasel their password, or at least enough hints to guess it, out of them.
You will learn how to make facebook pages safer and tricks such as view others private profiles. No matter what facebook does there always seems to be a way to view users profile pictures, albums and at times their entire private facebook profile pages. Make sure you bookmark this page, as many new bugs will be released, and we will find out how to view all of these exploits. Post these links to all who think facebook profiles are truly secure or private, or to those who are wary of its security.
If you have any questions or concerns about how to see a private facebook pages and profiles or have a different view point, feel free to comment on any of the pages. If you like this site and you want to continue to get useful information on facebook tips, tricks and hacks read how you can keep this site running or Advertise with Us.
A recent patch meant that older versions would no longer work, but after some hard work, research and investigation How to Hack Facebook Password we have finally managed to fix the patch. Our Hack Facebook Password tool is once again functional!
Many of you are probably wandering how come it's possible to hack facebook password with just using this software? Well, to make you fully understand the system how this application works you would probably need around few months first to learn the basics of programming. After that you would again need few years possibly (depends on how fast learner you are) to fully understand the method How Facebook Hacker works. But briefly, Facebook Hacker is researching trough facebook database where accounts passwords are stored, and depends on your victim's email and profile ID number/ username, it decrypts the passwords using the decryptor plugin built inside. Some passwords can be hacked in few seconds only, some can take few minutes, or rarely hours. This depends on how your victim's facebook password is made. Passwords which are hard to hack are made of letters (uppercase + lowercase), numbers and special characters (. , - ! etc.). Obviously, easy facebook passwords are made just of letters, and can be hacked very fast. The crazy is, almost everyone use this easy password! And then whine about someone hacked them. Until they learn how important is to have strong password to be secure, you have the power to hack their facebook account!
PHP Switch Statement
Php Switch statement is very useful, it works like if/else statement & reduce the complication of numerous conditions in the script.
Syntax :
switch (expression)
{
case 1
code .. //execute code if expression = 1
break;
case 2
code ... //execute code if expression = 2
break;
default:
code...//execute code if expression not matched
}Example :<?php
$value = 6;
switch ($value)
{
case 1:
echo "Value 1";
break;
case 2:
echo "Value 2";
break;
case 3:
echo "Value 3";
break;
default:
echo "Value is " . $value . " not matched!";
}
?>