Top Questions:

  • 3 years-4 months

    Date Before 3 Days

    • Category : php
    • Location : Chandigarh
    • Posted On :
    • Posted by : Guley

    echo  date('Y-m-d', strtotime('-3 days'));

  • 3 years-4 months

    Reset Autoincrement to 1

    • Category : php
    • Location : Chandigarh
    • Posted On :
    • Posted by : Guley
    ALTER TABLE tablename AUTO_INCREMENT = 1
  • 3 years-4 months

    Picture onupload button

    • Category : php
    • Location : Chandigarh
    • Posted On :
    • Posted by : Guley
    <label for="fileToUpload"><img src="images/fileupload.png" id="blah1" width="50" height="50"/></label><input type="file" name="exmaple" id="fileToUpload" onchange="$('#blah1')[0].src = window.URL.createObjectURL(this.files[0])"  required>
    <style>
    .image-upload > input[type=file]
    {
        display: none !important;
     z-index: 0 !important;
    }
    </style>

     

  • 5 years-11 months

    .htaccess Tricks To Speed Up Your Website

    • Category : htaccess
    • Location : Chandigarh, India
    • Posted On :
    • Posted by : Vikas

    Speed-up your website with these simple .htaccess tricks

    # Do not remove this line or mod_rewrite rules and search engine friendly URLs will stop working
    RewriteBase /
    
    # BEGIN Cache-Control Headers
    <ifModule mod_headers.c>
     <filesMatch ".(ico|jpe?g|png|gif|swf)$">
       Header set Cache-Control "public"
     </filesMatch>
     <filesMatch ".(css)$">
       Header set Cache-Control "public"
     </filesMatch>
     <filesMatch ".(js)$">
       Header set Cache-Control "private"
     </filesMatch>
     <filesMatch ".(x?html?|php)$">
       Header set Cache-Control "private, must-revalidate"
     </filesMatch>
    </ifModule>
    # END Cache-Control Headers
    
    <ifmodule mod_expires.c>
    <Filesmatch "\.(jpg|jpeg|png|gif|js|css|swf|ico|woff|mp3)$">
        ExpiresActive on
        ExpiresDefault A2592000
    </Filesmatch>
    </ifmodule>
    
  • 5 years-11 months

    how to post data using ajax

    • Category : php
    • Location : Chandigarh, India
    • Posted On :
    • Posted by : Vikas

    1 Answers

    View More

    vikas image

    Name: vikas

    Experiance: 5 years-11 months

    answered
    Dec 08, 2015 at 11:00

    create file result.php

    <?php
    if( $_REQUEST["name"] ) {
    
       $name = $_REQUEST['name'];
       echo "Welcome ". $name;
    }
    
    ?>

    create your html file with this code

    <html>
    
       <head>
          <title>The jQuery Example</title>
          <script type = "text/javascript" 
             src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
       
          <script type = "text/javascript" language = "javascript">
             $(document).ready(function() {
          
                $("#driver").click(function(event){
           
                   $.post( 
                      "result.php",
                      { name: "Zara" },
                      function(data) {
                         $('#stage').html(data);
                      }
                   );
             
                });
           
             });
          </script>
       </head>
     
       <body>
     
          <p>Click on the button to load result.html file %u2212</p>
        
          <div id = "stage" style = "background-color:cc0;">
             STAGE
          </div>
        
          <input type = "button" id = "driver" value = "Load Data" />
       
       </body>
      
    </html>

  • 5 years-11 months

    how to get zip to address

    • Category : php
    • Location : Chandigarh, India
    • Posted On :
    • Posted by : Vikas

    1 Answers

    View More

    vikas image

    Name: vikas

    Experiance: 5 years-11 months

    answered
    Dec 07, 2015 at 15:33

    <?php
    class ZiptoAddress()
    {
    function getLnt($zip)
    {
    $url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$zip."&sensor=false";
    $result_string = file_get_contents($url);
    $result = json_decode($result_string, true);
    //$result1[]=$result['results'][0];
    //$result2[]=$result1[0]['geometry'];
    //$result3[]=$result2[0]['location'];
    //return $result[0];
    //return $result['results'][0]['geometry']['location'];
    return $result['results'][0];
    //print_r($result1[0]['formatted_address']);
    }
    }
    $val = getLnt('90001');
    echo "Address: ".$val['formatted_address']."<br>";
    echo "Latitude: ".$val['geometry']['location']['lat']."<br>";
    echo "Longitude: ".$val['geometry']['location']['lng']."<br>";
    ?>

     

  • 5 years-11 months

    explode an array php not working

    • Category : php
    • Location : Chandigarh, India
    • Posted On :
    • Posted by : Vikas
    array(6) { 
    [0]=> string(0) "" 
    [1]=> string(21) " Subject Hello World " 
    [2]=> string(57) " Bonjour se jserais base sdf sdf sd f sqdf qsfd " 
    [3]=> string(22) " martial@gironde.com2 " 
    [4]=> string(12) " hello byee " 
    [5]=> string(11) " loul fund " } 
    
  • 5 years-11 months

    php explode not working correctly

    • Category : php
    • Location : Chandigarh, India
    • Posted On :
    • Posted by : Vikas

    After wordpress login redirect page but not refresh so please try to add these lines in the top of the your wordpress theme file like header.php or wp-config.php https://www.youtube.com/watch?v=ItTjUrTZ_JE

    <?php
    str = "Hello world. It's a beautiful day.";
    print_r (explode(" "$str));
    ?>
    

    1 Answers

    View More

    vikas image

    Name: vikas

    Experiance: 5 years-11 months

    answered
    Aug 23, 2015 at 13:36

    error in 3rd line

    write this :

    <?php
    $a="how work php,wordpress";
    $b=explode(',',$a);
    print_r($b);
    // or 
    echo $b[0]; // $b[1]
    // output
    // $b[0] = how work php
    // $b[1] = wordpress
    ?>