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

Monday, 2 February 2015

Changes in php.ini File

Go to-: wamp-: PHP -: php ini



Find:
post_max_size = 8M
upload_max_filesize = 2M
max_execution_time = 30
max_input_time = 60
memory_limit = 8M

Change to:
post_max_size = 750M
upload_max_filesize = 750M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M



Monday, 8 December 2014

Quality Zone Infotech brings heavy discounts on X-mas Hurry!!!

Quality Zone Infotech brings heavy discounts on its unique packages including Website design and development,Hosting,SEO & SMO packages. All these are available at a minimal Christmas price! Call us for a free audit now!

Wednesday, 10 September 2014

MySQL Data Types

In MySQL there are three main types : text, number, and Date/Time types.

Text types:

Data typeDescription
CHAR(size)Holds a fixed length string (can contain letters, numbers, and special
 characters). The fixed size is specified in parenthesis. Can store up
 to 255 characters
VARCHAR(size)Holds a variable length string (can contain letters, numbers, and
special characters). The maximum size is specified in parenthesis.
 Can store up to 255 characters. Note: If you put a greater value
 than 255 it will be converted to a TEXT type
TINYTEXTHolds a string with a maximum length of 255 characters
TEXTHolds a string with a maximum length of 65,535 characters
BLOBFor BLOBs (Binary Large OBjects). Holds up to 65,535 bytes of data
MEDIUMTEXTHolds a string with a maximum length of 16,777,215 characters
MEDIUMBLOBFor BLOBs (Binary Large OBjects). Holds up to 16,777,215 bytes of
data
LONGTEXTHolds a string with a maximum length of 4,294,967,295 characters
LONGBLOBFor BLOBs (Binary Large OBjects). Holds up to 4,294,967,295 bytes
 of data
ENUM(x,y,z,etc.)Let you enter a list of possible values. You can list up to 65535
values in an ENUM list. If a value is inserted that is not in the list,
a blank value will be inserted.Note: The values are sorted in the
order you enter them.
You enter the possible values in this format: ENUM('X','Y','Z')
SETSimilar to ENUM except that SET may contain up to 64 list items
 and can store more than one choice



Number types:
Data typeDescription
TINYINT(size)-128 to 127 normal. 0 to 255 UNSIGNED*. The maximum number of digits may be specified in parenthesis
SMALLINT(size)-32768 to 32767 normal. 0 to 65535 UNSIGNED*. The maximum number of digits may be specified in parenthesis
MEDIUMINT(size)-8388608 to 8388607 normal. 0 to 16777215 UNSIGNED*. The maximum number of digits may be specified in parenthesis
INT(size)-2147483648 to 2147483647 normal. 0 to 4294967295 UNSIGNED*. The maximum number of digits may be specified in parenthesis
BIGINT(size)-9223372036854775808 to 9223372036854775807 normal. 0 to 18446744073709551615 UNSIGNED*. The maximum number of digits may be specified in parenthesis
FLOAT(size,d)A small number with a floating decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter
DOUBLE(size,d)A large number with a floating decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter
DECIMAL(size,d)A DOUBLE stored as a string , allowing for a fixed decimal point. The maximum number of digits may be specified in the size parameter. The maximum number of digits to the right of the decimal point is specified in the d parameter

Thursday, 4 September 2014

Display different div click in php

####################### Just Copy And Past #######################


<div id="nav">
    <a href="#content1">Show 1</a>
    <a href="#content2">Show  2</a>
    </div>

<div id="content1" class="toggle" style="display:none">Show 1</div>
<div id="content2" class="toggle" style="display:none">Show  2</div>

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script>
<script type="text/javascript">
$("#nav a").click(function(e){
    e.preventDefault();
    $(".toggle").hide();
    var toShow = $(this).attr('href');
    $(toShow).show();
});
</script>

Tuesday, 24 June 2014

JavaScript validation required field border changed

/////////////////////////////////////////Just Copy Past///////////////////////////////

<form name= "reg" id="reg" method="POST" action="http://www.qualityzoneinfotech.com/" onsubmit="return validate()">

   
    <input id="first" name="first" type="text" value="" placeholder="first"><br />

<input id="email" name="email" type="text" value="" placeholder="email"><br />

<textarea id="message" name="message" placeholder="message" ></textarea><br />
    <input type="submit"></button>
</form>

<script type="text/javascript">

function validate(){
    var formIsValid = true;
    var first=document.forms["reg"]["first"];
    if(first.value == null || first.value == ""){
        first.style.borderColor = "red";
        formIsValid = false;  
    }
 var email=document.forms["reg"]["email"];
    if(email.value == null || email.value == ""){
        email.style.borderColor = "red";
        formIsValid = false;  
    }
 var message=document.forms["reg"]["message"];
    if(message.value == null || message.value == ""){
        message.style.borderColor = "red";
        formIsValid = false;  
    }

    return formIsValid;

}
</script>

PoPup code in JavaScript for PHP

""""""""""""""""""" Just Copy And Past""""""""""""""""""""""""""

<style type="text/css">
/* popup DIV-Styles*/
#popup {
    display:none; /* Hide the DIV */
    position:fixed;
    _position:absolute; /* hack for internet explorer 6 */
    height:300px;
    width:600px;
    background:#FFFFFF;
    left: 300px;
    top: 150px;
    z-index:100; /* Layering ( on-top of others), if you have lots of layers: I just maximized, you can change it yourself */
    margin-left: 15px;
   
    /* additional features, can be omitted */
    border:1px solid #0000CC;    
    padding:15px;
    font-size:15px;
    -moz-box-shadow: 0 0 5px #ff0000;
    -webkit-box-shadow: 0 0 5px #ff0000;
    box-shadow: 0 0 5px #ff0000;
   
}

#main {
    background:#6699FF; /*Sample*/
    width:100%;
    height:100%;
}

a{
cursor: pointer;
text-decoration:none;
}

/* This is for the positioning of the Close Link */
#popupBoxClose {
    font-size:20px;
    line-height:15px;
    right:5px;
    top:5px;
    position:absolute;
    color:#6fa5e2;
    font-weight:500;    
}
</style>  
<script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript"></script>

<script type="text/javascript">
   
    $(document).ready( function() {
   
        // When site loaded, load the Popupbox First
        loadPopupBox();
   
        $('#popupBoxClose').click( function() {          
            unloadPopupBox();
        });
       
        $('#main').click( function() {
            unloadPopupBox();
        });

        function unloadPopupBox() {    // TO Unload the Popupbox
            $('#popup').fadeOut("slow");
            $("#main").css({ // this is just for style      
                "opacity": "1"
            });
        }  
       
        function loadPopupBox() {    // To Load the Popupbox
            $('#popup').fadeIn("slow");
            $("#main").css({ // this is just for style
                "opacity": "0.3"
            });        
        }      
    });
</script>  
<html>
<head>
<title>Quality Zone Infotech POPUPBOX </title>
</head>
<body>
<div id="popup">    <!-- OUR PopupBox DIV-->
    <span style="font-size:15px; color:#3333FF;">My Popup Is Working Fine Thanks Quality Zone Infotech</span>
</h1>
    <a href="http://www.qualityzoneinfotech.com/" id="popupBoxClose">close</a>  
</div>
<div id="main"> <!-- Main Page -->
    <h1>Thanks Quality Zone Infoech</h1>
</div>
</body>
</html> 

Sunday, 15 June 2014

Display Message in Popup in php

<?php
if($status == 1)
           {
               echo '<script>alert("Thanks for submiting your query. We will get back to you in next 24 hours");</script>';
             
           }
           else{
 echo '<script>alert("Meassage has not submitted!");</script>';            

           }
?>

Tuesday, 3 June 2014

Remove powered by kunena forum

Write this line in your css file

/*powerd by kunena hide*/
#Kunena + div{display:none !important}

After that Press Ctr+F5

if it will help you then comment must 

Monday, 2 June 2014

500 error in joomla login form

Go to libraries/joomla/application/application.php
Comment this line
$this->triggerEvent('onUserLoginFailure', array((array) $response));

And set Change Permissions of this file 774
It will work fine and save your time

Sunday, 25 May 2014

Code for social Likes and share


                                          -----:  Just past this code and use it  :------ 

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like" data-href="https://www.facebook.com/qualityzoneinfotech" data-width="50px" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>

<script language="javascript">
function shinra_fb_count( $url_or_id ) {
    /* url or id (for optional validation) */
    if( is_int( $url_or_id ) ) $url = 'http://graph.facebook.com/' . $url_or_id;
    else $url = 'http://graph.facebook.com/' .  $url_or_id;

    /* get json */
    $json = json_decode( file_get_contents( $url ), false );

    /* has likes or shares? */
    if( isset( $json->likes ) ) return (int) $json->likes;
    elseif( isset( $json->shares ) ) return (int) $json->shares;

    return 0; // otherwise zed
}
</script>
<div id="social"><!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style ">
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
<a class="addthis_button_tweet"></a>
<a class="addthis_button_pinterest_pinit"></a>
<a class="addthis_counter addthis_pill_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xa-51572bbd79133ec6"></script>
<!-- AddThis Button END -->
</div>


Saturday, 24 May 2014

Php code for number of hits on web page

<?php
// start at the top of the page since we start a session
session_name('hit_counter');
session_start();
//
$fn = 'hits_counter.txt';
$hits = 0;
// read current hits
if (($hits = file_get_contents($fn)) === false)
{
$hits = 0;
}
// write one more hit
if (!isset($_SESSION['page_visited_already']))
{
if (($fp = @fopen($fn, 'w')) !== false)
{
if (flock($fp, LOCK_EX))
{
$hits++;
fwrite($fp, $hits, strlen($hits));
flock($fp, LOCK_UN);
$_SESSION['page_visited_already'] = 1;
}
fclose($fp);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Hit Counter Code</title>
</head>
<body>
<p>Hits of page</p>
<div class="counter">
<p>This page has <span><?=$hits;?></span> hits</p>
</div>
</body>
</html>

How to see template position in joomla

First of all go to your Joomla! administration Extensions - Template Manager - click on Options icon and set:Preview Module Positions to Enabled. Save the options.

Then Go to  Frontend site and add the following text in URL: tp=1



How to uninstall module in Joomla 2.5

Its is very simple task to uninstall module , plugins, and components follow these steps..
If you want to uninstall an module,component and plugin to go in Joomla administrator area -> Extensions -> Extension Manager.
Open the Manage tab. Select Module,plugin or component from the Select Type drop-down menu. check the checkbox which you want to uninstall and Find the Uninstall icon in the upper right Joomla 2.5 menu and click on it to completely remove the chosen module.
Remember Joomla 2.5 core modules can not be uninstalled.