September 14, 2012

New iPhone 5 Mobile is Launch



The iPhone 5 comes in either white and silver or black and slate and to buy it outright in Australia costs $799 for the 16 gigabyte model, $899 for the 32 gigabyte model and $999 for the 64 gigabyte model. Apple said customers could pre-order from this Friday and mobile carriers are also taking pre-orders.

Not a shocker either, but the iPhone 5 will support 4G LTE networks. That's in addition to the current support for GPRS, EDGE, EV-DO, and HSPA data networks. LTE has a single chip for voice and data, a single radio chip, and a "dynamic antenna" that will switch connections between different networks automatically. 

September 11, 2012

How To Apply CSS In CodeIgniter


1. Open "config.php" within directory CodeIgniter\system\application\config.
2. Add following code. At last line before '?>'
$config['css'] = 'mystyles.css';
3. Create a file named mystyles.css within root.
4. Enter example code like this:
h1{
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:30px;
}
p{
font-family:Georgia, "Times New Roman", Times, serif;
font-size:12px;
}
#menu{
height:50px;
}
.....etc
5. Open model file named "your_filename.php" within CodeIgniter\system\application\models.
6. Add following two lines.
<?php
class Blog extends CI_Controller {
function index()
{
$data['title']="This is my blog";
$data['heading']="Testing of blog page";
$data['base']= $this->config->item('base_url');
$data['css']= $this->config->item('css');

$this->load->view("blog_view",$data);
}
}
?>
7. Then, update "your_viewfile.php" within CodeIgniter\system\application\views.
8. Update <head></head>, like this:
<html>
<head>
<link rel="stylesheet" type="text/css" href="<?php echo "$base/$css"?>">
<title><?php echo $title;?></title>
</head>
<body>
<h1><?php echo $heading;?></h1>
</body>
</html>
Enjoy It.

August 25, 2012

How to send Multiple Emails in PHP


include("../connect.php");
if(isset($_REQUEST['Send']))
{
foreach ($_POST['chk_box'] as $id)
{
      $qr = mysql_query("SELECT email FROM <Table Name> WHERE id = '".$id."' ");
      if (mysql_affected_rows()>0)
{
while ($email = mysql_fetch_array($qr))
{
            $email_add = $email['email'];
 mail( $email_add , 'Subject','Message Goes Here', "From: <Your Email Address>");
}
}
}
}

August 4, 2012

display image preview before it upload using PHP and JavaScript


Put this code between <head>...</head> tag.

<script type="text/javascript">
   function readURL(input) {
    if (input.files && input.files[0]) {
        var reader = new FileReader();
        reader.onload = function (e) {
        $('#test').attr('src', e.target.result);
       }
        reader.readAsDataURL(input.files[0]);
       }
    }
</script>

Put this code in main body.

<form id="form1" runat="server">
<input onchange="readURL(this);" type="file" />
      <img alt="Image Display Here" id="test" src="#" />
  </form>

Enjoy :

July 31, 2012

How to get date from the datetime in php

How to get date from the datetime in php


$result = mysql_query("SELECT `datetime` FROM `table`");
$row = mysql_fetch_row($result);
$date = date_create($row[0]);

echo date_format($date, 'Y-m-d H:i:s');

echo date_format($date, 'd/m/Y H:i:s');

echo date_format($date, 'd/m/y');

echo date_format($date, 'g:i A');

echo date_format($date, 'G:ia');

echo date_format($date, 'g:ia \o\n l jS F Y');

July 28, 2012

How To Get Month Number to Month Name in PHP


<?php
$monthNum = 5;
$monthName = date("F", mktime(0, 0, 0, $monthNum, 10));
echo $monthName;
?>
//output: May

July 25, 2012

Select query to get total # records for each day in a month

select day(DateField), count(*) from table where month(DateField) = month(NOW()) and year(DateField) = year(NOW()) group by day(DateField)

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...