Ask Your Question By Comment We Will Give You Better Solution Soon

Saturday 4 November 2017

Array in PHP

PHP Indexed Arrays

<?php
$s = array("Ku", "Su", "Yu");
echo "I like " . $s[0] . ", " . $s[1] . " and " . $s[2] . ".";
?>


PHP Associative Arrays

<?php
$age = array("Peter"=>"35", "Ben"=>"37", "Joe"=>"43");

foreach($age as $x => $x_value) {
    echo "Key=" . $x . ", Value=" . $x_value;
    echo "<br>";
}
?>
Result: Key=Peter, Value=35
Key=Ben, Value=37
Key=Joe, Value=43

Multidimensional Arrays


<?php
$cars = array
  (
  array("Volvo",22,18),
  array("BMW",15,13),
  array("Saab",5,2),
  array("Land Rover",17,15)
  );
 
echo $cars[0][0].": In stock: ".$cars[0][1].", sold: ".$cars[0][2].".<br>";
echo $cars[1][0].": In stock: ".$cars[1][1].", sold: ".$cars[1][2].".<br>";
echo $cars[2][0].": In stock: ".$cars[2][1].", sold: ".$cars[2][2].".<br>";
echo $cars[3][0].": In stock: ".$cars[3][1].", sold: ".$cars[3][2].".<br>";
?>

Result:
Volvo: In stock: 22, sold: 18.
BMW: In stock: 15, sold: 13.
Saab: In stock: 5, sold: 2.
Land Rover: In stock: 17, sold: 15.

PHP Mail Function


$title='Test';
     $body = ' "';
$from='info@test.com';


  $headers = 'From: '.$from.'' . "\r\n" .
              'Reply-To: '.$from.'' . "\r\n" .
  'BCC: '.$from.''. "\r\n" .
 
  'Content-type: text/html; charset=utf-8' . "\r\n" .'X-Mailer: PHP/' . phpversion();
 
              //put your email address here
              mail($email, $title, $body, $headers);

PHP Pagination Code Example

<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$con=mysql_connect("localhost","root",'');
mysql_select_db('test');
$page=5;
 ?>
<div class="content-wrapper"><?php 
 $url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
   ?>
      <?php
$tableName="student";

$limit = 4;

$targetpage = "index.php";
$query = "SELECT COUNT(*) as num FROM $tableName";
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages['num'];

$stages = 3;
@$page = mysql_escape_string($_GET['page']);
if($page){
$start = ($page - 1) * $limit;
}else{
$start = 0;
}
    $sql_blog = mysql_query("SELECT * FROM $tableName order by id desc LIMIT $start, $limit");

while($row_blog = mysql_fetch_array($sql_blog)){
                       ?>
                   
               <div class="blog-item">
                                     
                <div class="blog-content">
 
                    <ul class="blog-meta">
                        <li>by <a href="#"><?php echo $aid=$row_blog['name'];
?></a></li>
                <?php echo $row_blog['name'];?> Views</li>
             </ul>
           
       
            </div>
        <?php } ?>
     
       
        <div class="review-pager pager-wrappper mt-40">
                   
            <div class="row">
           
                <div class="col-xs-12 col-sm-12">
                    <?php
  if ($page == 0){$page = 1;}
$prev = $page - 1;
$next = $page + 1;
$lastpage = ceil($total_pages/$limit);
$LastPagem1 = $lastpage - 1;

$paginate = '';
if($lastpage > 1)
{

$paginate .= "<ul class='pagination'>";
// Previous
if ($page > 1){
$paginate.= "<li><a href='$targetpage?page=$prev'>previous</a></li>";
}else{
$paginate.= "<span class='disabled'>previous</span>"; }

// Pages
if ($lastpage < 7 + ($stages * 2)) // Not enough pages to breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page){
$paginate.= "<span class='current'>$counter</span>";
}else{
$paginate.= "<li><a href='$targetpage?page=$counter'>$counter</a></li>";}
}
}
elseif($lastpage > 5 + ($stages * 2)) // Enough pages to hide a few?
{
// Beginning only hide later pages
if($page < 1 + ($stages * 2))
{
for ($counter = 1; $counter < 4 + ($stages * 2); $counter++)
{
if ($counter == $page){
$paginate.= "<span class='current'> Current Page: $counter</span>";
}else{
$paginate.= "<li><a href='$targetpage?page=$counter'>$counter</a></li>";}
}
$paginate.= "...";
$paginate.= "<li><a href='$targetpage?page=$LastPagem1'>$LastPagem1</a></li>";
$paginate.= "<li><a href='$targetpage?page=$lastpage'>$lastpage</a></li>";
}
// Middle hide some front and some back
elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))
{
$paginate.= "<li><a href='$targetpage?page=1'>1</a></li>";
$paginate.= "<li><a href='$targetpage?page=2'>2</a></li>";
$paginate.= "...";
for ($counter = $page - $stages; $counter <= $page + $stages; $counter++)
{
if ($counter == $page){
$paginate.= "<span class='current'>$counter</span>";
}else{
$paginate.= "<li><a href='$targetpage?page=$counter'>$counter</a></li>";}
}
$paginate.= "...";
$paginate.= "<li><a href='$targetpage?page=$LastPagem1'>$LastPagem1</a></li>";
$paginate.= "<li><a href='$targetpage?page=$lastpage'>$lastpage</a></li>";
}
// End only hide early pages
else
{
$paginate.= "<li><a href='$targetpage?page=1'>1</a></li>";
$paginate.= "<li><a href='$targetpage?page=2'>2</a></li>";
$paginate.= "...";
for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)
{
if ($counter == $page){
$paginate.= "<span class='current'>$counter</span>";
}else{
$paginate.= "<li><a href='$targetpage?page=$counter'>$counter</a></li>";}
}
}
}

// Next
if ($page < $counter - 1){
$paginate.= "<li><a href='$targetpage?page=$next'>next</a></li>";
}else{
$paginate.= "<span class='disabled'>next</span>";
}

$paginate.= "</ul>";

}
echo $total_pages.' Results';
// pagination
echo $paginate;
                ?>

                   
                   
                </div>
   
            </div>
       
        </div>
   
    </div>

Wednesday 4 November 2015

Website Design And Development Diwali Offers :

Quality Zone Infotech is wishing you all an Advance Happy Diwali 2015. Let s hope The Diwali
Festival of light bring a big success in your business. Grab our Special Packages for the this 
Diwali!

Festive season is just around the corner and we would like you to be a part of festivities. Lets 
bring in this festive season with a BIG bang! .
May I know in which Service are you interested in?

We offer complete Web  solutions with reasonable price.(Till 11th November, 2015)
 Ecommerce Website Design And Development With All Features Only in     23000 INR
 Dynamic Business Website 8-10 Pages Only In     8000 INR
 SEO And SMO Promotion     11500 INR/Month.
 Content Writing Only in     50 Paise Per Word
 10% Off On Domain Name And 12% Off On Web Hosting.


Thursday 11 June 2015

Menu and Sub menu code example

+++++++++++++= Copy and Past this ++++++++++++++++++++++++++++++++++


<html>
<head>
<title>Example of Menu and Submenu</title>
<style type="text/css" media="screen">
#hmenu ul {
padding:1;
margin:1;
list-style:none;
}
#hmenu li {
float:left;
position:relative;
padding-right:50;
display:block;
}
#hmenu li ul {
display:none;
position:absolute;
}
#hmenu li:hover ul {
display:block;
height:auto;
width:8em;
}
#hmenu li ul li {
clear:both;
border-style:none;
}
</style>
</head>
<body>
<div id="hmenu">
  <ul>
    <li><a href="#">Hero Bike</a>
      <ul>
        <li><a href="#">Hero Honda</a></li>
        <li><a href="#">CBZ</a></li>
        <li><a href="#">Sport</a></li>
        <li><a href="#">CD Delux</a></li>
      </ul>
    </li>
    <li> <a href="#">Bjaj</a>
      <ul>
        <li><a href="#">Pulsure</a></li>
        <li><a href="#">Discover</a></li>
        <li><a href="#">Bjaj</a></li>
        <li><a href="#">try</a></li>
      </ul>
    </li>
    <li> <a href="#">Bullat</a>
      <ul>
        <li><a href="#">Royal Enfield</a></li>
        <li><a href="#">GHX</a></li>
        <li><a href="#">CBG</a></li>
      </ul>
    </li>
  </ul>
</div>
</body>
</html>
Any Other Help contact:<a href="www.qualityzoneinfotehc.com">Quality Zone Infotech</a>ef="www.qualityzoneinfotehc.com">Quality Zone Infotech</a>

Wednesday 4 February 2015

Cannot access cPanel or Webmail or WHM

Dear Friends,
There is a best solution for your problem Use this and comment your experience :

ServiceStandard portSecure portProxy subdomain
cPanel20822083cpanel.example.com
Webmail20952096webmail.example.com
WHM (Only on VPS and dedicated servers)20862087whm.example.com