Posts

Showing posts from May, 2014

Pagination with CodeIgniter

The Model models/ model_page_name .php class class_name extends CI_Model {     public function __construct() {         parent::__construct();     }     public function record_count() {         return $this->db->count_all("table_name");     }

Protect Your WordPress Site From Hackers

1. Delete the username “admin”   The default username when creating a WordPress site is “admin.” Most people keep this username. This makes it dead easy for hackers to guess your username. Then they are already half logged in to your site. So delete any account with the username “admin.” Note: if the account with username “admin” is the only user that currently has Administrator-level access, you won’t be able to delete it until you first create and login with a different Administrator-level account. WordPress needs to ensure that there is some way to access Administrator functions for your site.

send email with attachment in php

Use the phpmailer class to add attachments function emailWithAttachment ( $to , $subject , $message , $attachment )   { $mail = new PHPMailer (); $mail -> AddAddress ( $to ); $mail -> From = "your@email.com" ; $mail -> FromName = "Your Name" ; $mail -> Subject = $subject ; $mail -> Body = $message ;