Welcome to Onlinetunes24 .....

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 1 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 2 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 3 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

This is default featured post 4 title

We are committed to become your long-term, trusted partner. Our priority is not only to provide professional services and solutions but to become your IT vendor dedicated to meet your needs today and support your growing business needs tomorrow.

Show Bangla Date Time

<?php
class ShowBanglaDateTime{
//Base function
    public function bangla_date_time($str){
$eng = array('January','February','March','April','May','June','July','August','September','October','November','December',
'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec',
'Saturday','Sunday','Monday','Tuesday','Wednesday','Thursday','Friday',
'Sat','Sun','Mon','Tue','Wed','Thu','Fri',
'1','2','3','4','5','6','7','8','9','0',
'am','pm');
$bng = array('জানুয়ারি','ফেব্রুয়ারি','মার্চ','এপ্রিল','মে','জুন','জুলাই','আগস্ট','সেপ্টেম্বর','অক্টোবর','নভেম্বর','ডিসেম্বর',
'জানু','ফেব্রু','মার্চ','এপ্রি','মে','জুন','জুলা','আগ','সেপ্টে','অক্টো','নভে','ডিসে',
'শনিবার','রবিবার','সোমবার','মঙ্গলবার','বুধবার','বৃহস্পতিবার','শুক্রবার',
'শনি','রবি','সোম','মঙ্গল','বুধ','বৃহঃ','শুক্র',
'১','২','৩','৪','৫','৬','৭','৮','৯','০',
'পূর্বাহ্ণ','অপরাহ্ণ');
return str_ireplace($eng, $bng, $str);
}
}
?>
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<title>বাংলাতে সময় ও তারিখ</title>
</head>
<body>
<?php
date_default_timezone_set('Asia/Dhaka');
$BanglaDate=new ShowBanglaDateTime();
echo $BanglaDate->bangla_date_time(date('d M Y h:i A'));
?>
</body>
</html>

PHP Email with an attach file

<?php
    if(isset($_POST['submit'])) {
        //Deal with the email
        $to = "engr.lukman@gmail.com";
        $name = $_POST['name'];
        $email = $_POST['email'];
        $subject = $_POST['subject'];
       
        $message = strip_tags($_POST['message']);
        $attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
        $filename = $_FILES['file']['name'];
        $boundary =md5(date('r', time()));
        $headers = "From:" .$name." : ".$email;
        $headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
        $message="This is a multi-part message in MIME format.

--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"

--_2_$boundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit

$message

--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment

$attachment
--_1_$boundary--";

    if($name!="" && $subject!="" && $message!="") {
    if($email!="") {
        if(preg_match("/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})+$/",$email))
                {
                $output = '<h1 style=\"color:green\">'."Thank you ".$name.'</h1>';
                mail($to, $subject, $message, $headers);
                }
            else {
            echo "<h1 align=\"center\" style=\"color:red\">Please enter a valid email !!</h1>";
            }
        }
    else {
         echo "<h1 align=\"center\" style=\"color:red\">Email should not empty !!</h1>";
         }
    }
    else {
     echo "<h1 align=\"center\" style=\"color:red\">Mail not send successfully !</h1>";
     }
    }
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Mail File</title>
    </head>
<body>
    <?php echo $output; ?>

<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
    <p> Name : <input type="text" name="name" /> * </p>
    <p> Email : <input type="text" name="email" /> * </p>
    <p> Subject <input type="text" name="subject" /> * </p>
    <p> Message <textarea name="message" id="message" cols="20" rows="5"></textarea> </p>
    <p><label for="file">Attach a File : </label> <input type="file" name="file" id="file"></p>

    <p><input type="submit" name="submit" id="submit" value="Send"></p>
</form>

</body>
</html>

Delete Data



<?php include("configuration.php"); ?>
<?php
$result=mysql_query("select*from info") or die (mysql_error());
echo"<table border='1'>
<tr>
                                    <th>Name:</th>
                                    <th>Address</th>
                                    <th>Phone:</th>
                                    <th> Delete </th>
                        </tr>";
while ($row=mysql_fetch_array ($result)) {
            echo"<tr>";
                        echo "<td>" .$row['name']. "</td>";
                        echo "<td>" .$row['address']. "</td>";
                        echo "<td>" .$row[‘cell’]. "</td>";
                        // delete script
                        echo"<td><a href=\"script.php?delid=".$row['id']."\">" .Delete. "</a></td>";
                        echo "</tr>"; }
echo "</table>";
?>
File Name: Script.php
<?php
include("config.php");

// delete data from database start
$del=$_GET['delid'];
$redirect="delete_data.php";
mysql_query("delete from info where id='$del'");
header("Location: $redirect");
// delete data from database start
?>

View Data



<?php include ("configuration.php"); ?>
<?php
$result=mysql_query ("select*from info");
echo"<table border='1'>
<tr>
                                    <th>ID:</th>
                                    <th>Name:</th>
                                    <th>Address</th>
                                    <th>Phone:</th>
                        </tr>";
while($row=mysql_fetch_array($result))
{
            echo"<tr>";
                        echo "<td>" .$row['id']. "</td>";
                        echo "<td>" .$row['name']. "</td>";
                        echo "<td>" .$row['address']. "</td>";
                        echo "<td>" .$row['cell']. "</td>";
            echo "</tr>"; }
echo "</table>";
?>

Insert Data



<?php include ("configuration.php"); ?>
<form name="insert" method="post" action="insert_data.php">
Name: <input name="name" type="text" /> <br />
Address: <input name="address" type="text" /> <br />
            Phone: <input name="phone" type="text" /> <br />
            <input type="reset" value="Reset" /> | | <input type="submit" value="Submit" />
</form>

<?php
$name = $_POST["name"];
$address = $_POST["address"];
$phone = $_POST["phone"];

if($id!="" && $name!="" && $address!="" && $phone!="")
            mysql_query ("insert into info values (“ ”, '$id', '$name', '$address', '$phone')");
else
            echo "Any Field Should not be Empty !!";
?>

Loading
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Flying Twitter Bird Widget By ICT Sparkle