Simple email function to send html content

Use the the below send_mail() function to send the text or html mail to specific recipients

<?php
function send_mail($to, $from, $subject, $body, $cc='', $bcc=''){
    // To send HTML mail, you can set the Content-type header.
    $headers = "From: $from\r\n";
    $headers .= "Content-type: text/html\r\n";
    //add additional headers like, reply-to, etc if you need
    if(!empty($cc)){
        $headers .= "Cc: $cc\r\n";
    }
    if(!empty($bcc)){
    $headers .= "Bcc: $bcc\r\n";
    }
    // and now native mail function
    mail($to,$subject, $body, $headers);
   //you can use the return type for success message or error message
}
?>

You can use the above function by calling the function with parameters as below

<?php
    send_mail('recipient@domain.com', 'frommail@fromdomainname.com', 'Hello subject', 'Content');
?>

Change column position in mysql table

Many times, we come across the situation where a column needs to be re-position in the table. Either at first position, at last position or  anywhere in the table after some columns. This particular modification can be done using ALTER TABLE queries.

#Position a column at first position
ALTER TABLE table_name MODIFY COLUMN column_name datatype FIRST;
Example : ALTER TABLE events MODIFY COLUMN event_id INT FIRST;
#Position a column after specific column
ALTER TABLE table_name MODIFY COLUMN column_name datatype AFTER another_column;
Example : ALTER TABLE events MODIFY COLUMN event_id INT AFTER event_name;

Welcome to Aaro Scripts!

Welcome to Aaro Scripts. Its all about the web coding, design, code snippets, concepts and lot. Keep visiting daily for new topics. Aaro scripts will main provide the resource for php, css2, css3, html4, html4, javascripts, jquery, magento, codeigniter, etc.

Yes you assumed correct. I am a PHP developer, and i will focus mainly on the solutions related php programming.