In PHP, You can display the image in HTML email template in two ways,

1. Your organization restricted your application directory by authorization and you cant able to access outside. In this case you can embed a images in html template
2. If there is no restriction and free to access anywhere you can display your image by using absolute and relative path directly

Please find the sample code for the first option:

<?php

$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From="m.achappan@gmail.com";
$mail->FromName="My site's mailer";
$mail->Sender="m.achappan@gmail.com";

$address = "achappan.mahalingam@yahoo.co.in";
$mail->AddAddress($address, "Achappan Mahalingam");

$mail->Subject = "HTML Email template logo test";

$mail->IsHTML(true);

$mail->AddEmbeddedImage('email_logo.png', 'logoimg', 'email_logo.png');
$mail->Body = "<p><img src=\"cid:logoimg\" /></p>";

$mail->AltBody = "Sample html logo Image test!";

if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
?>
To restart, start or stop MySQL server from the command line, type the following at the shell prompt…

/etc/init.d/mysqld start

/etc/init.d/mysqld stop 
    
/etc/init.d/mysqld restart


Some Linux flavours offer the service command too

service mysqld start 

service mysqld stop

service mysqld restart

1. Check a Specific Table in a Database

# mysqlcheck -c <dbname> <tablename> -u root -p

2. Check All Tables in a Database

# mysqlcheck -c <dbname> -u root -p

3. Check All Tables and All Databases

# mysqlcheck -c  -u root -p --all-databases 

4. Analyze Tables using Mysqlcheck

# mysqlcheck -a <dbname> <tablename> -u root -p 

5. Optimize Tables using Mysqlcheck

# mysqlcheck -o <dbname> <tablename> -u root -p 

6. Repair Tables using Mysqlcheck

# mysqlcheck -r <dbname> <tablename> -u root -p 

7. Combine Check, Optimize, and Repair Tables

# mysqlcheck -u root -p --auto-repair -c -o <dbname> 

8. Check, Optimize, and Repair All Tables from All databases

# mysqlcheck -u root -p --auto-repair -c -o --all-databases 

9. Additional Useful Mysqlcheck Options

-A, –all-databases Consider all the databases
-a, –analyze Analyze tables
-1, –all-in-1 Use one query per database with tables listed in a comma separated way
–auto-repair Repair the table automatically it if is corrupted
-c, –check Check table errors
-C, –check-only-changed Check tables that are changed since last check
-g, –check-upgrade Check for version dependent changes in the tables
-B, –databases Check more than one databases
-F, –fast Check tables that are not closed properly
–fix-db-names Fix DB names
–fix-table-names Fix table names
-f, –force Continue even when there is an error
-e, –extended Perform extended check on a table. This will take a long time to execute.
-m, –medium-check Faster than extended check option, but does most checks
-o, –optimize Optimize tables
-q, –quick Faster than medium check option
-r, –repair Fix the table corruption
                   <?php 

                  $date_of_completion = '16-03-2015';

                    $skip=1;
                   
                    if((substr_count($date_of_completion,"-"))<>2){
                        $error_msg .= "<br><font color='red'>Enter the date in 'dd-mm-yyyy' format</font>";
                    }
                    else
                    {
                        $pos=strpos($date_of_completion,"-");

                   
                        //Date validation
                        $date=substr($date_of_completion,0,($pos));

                        if(($date<=0)||($date>31))
                        {
                            $msg = " Date";
                            $skip = 0;
                        }
                       

                       //Month validation
                        $month=substr($date_of_completion,($pos+1),($pos));
                           
                        if(($month<=0)||($month>12))
                        {
                            if($skip ==0){
                                $and = ' & ';
                            }
                            $msg .= "$and Month";
                            $skip = 0;
                        }

                        //Year validation
                        $year=substr($date_of_completion,($pos+4),strlen($date_of_completion));
                       
                        if(($year<=1970) || ($year>2200))
                        {
                           
                            if($skip ==0){
                                $and = ' & ';
                            }
                            $msg .= "$and Year";
                        }
                        if(!empty($msg))
                        {
                            $error_msg .= "<font color='red'>Enter a valid <b>$msg or Date format</b></font>";
                        }
                    }
                   
                   echo $error_msg;

?>
[root@achappan~]# find . -name '*.php' | wc -l



Cross-browser refers to the ability of a website, web application, HTML construct or client-side script to function in environments that provide its required features and to bow out or degrade gracefully when features are absent or lacking.

  1. Ghostlab  
  2. BrowserStack
  3. Sauce Labs
  7. Browsera
  8. Mogotest
10. Litmus
13. Spoon

Blog Archive

Total Pageviews

Popular Posts