Monday, September 14, 2026

Lucknow Mein Professional Website Ya Software Chahiye? — Imgaurav.in


Lucknow Mein Professional Website Ya Software Chahiye? — Imgaurav.in

Aaj ke digital zamane mein, koi bhi business — chahe wo Hazratganj ki ek chhoti si shop ho, Gomti Nagar ka ek startup ho, ya Indira Nagar ka koi coaching institute — agar uski online presence nahi hai, toh woh apne customers ka ek bada hissa miss kar raha hai. Lucknow mein jitne log Google par "website developer near me" ya "web designer in Lucknow" search karte hain, unka number har din badhta ja raha hai. Aur is zarurat ko poora karne ke liye Imgaurav.in aapke liye ek professional aur affordable solution lekar aaya hai.


Lucknow Mein Professional Website Ki Zarurat Kyon Hai?

Ek simple sawaal — jab aap koi naya restaurant, doctor, ya service dhundhte hain, toh sabse pehle kya karte hain? Google karte hain. Yahi aapke potential customers bhi karte hain.

Agar aapka business Aliganj mein hai ya Alambagh mein, Mahanagar mein hai ya Gomti Nagar mein — ek professional website hona aaj optional nahi, zaroori hai. Ek achhi website:

  • Aapko 24/7 online visible rakhti hai
  • Aapke business ko trustworthy aur credible dikhati hai
  • Google search mein aapko local customers tak pahunchati hai
  • Mobile users ko — jo Lucknow mein majority hain — ek smooth experience deti hai

Ek basic "builder" se bani website aur ek professionally developed website mein farq hota hai — design mein, speed mein, SEO mein, aur ultimately customers mein.


Website Developer in Lucknow Kaise Choose Karein?

Lucknow mein kaafi options hain — bade agencies, chhoti firms, aur freelancers. Lekin choose karte waqt kuch cheezein zaroor check karein:

  • Kya developer ko local business ki zaruraton ka samajh hai?
  • Kya website mobile-friendly aur fast hogi?
  • Kya SEO-friendly structure diya jayega?
  • Kya maintenance aur support milega?
  • Kya pricing transparent hai?

Ek freelance website developer in Lucknow jaisa Imgaurav.in ka advantage yeh hota hai ki aap directly us insaan se baat karte hain jo aapka kaam karta hai — koi middleman nahi, koi unnecessary delays nahi.


Imgaurav.in Se Kaun-Kaun Si Website Services Milti Hain?

Imgaurav.in ek full-service web development practice hai jo Lucknow ke businesses, professionals, aur organizations ke liye kaam karti hai. Services include karti hain:

Website Development:

  • Business aur corporate websites
  • E-commerce websites (online store with payment gateway)
  • WordPress website development
  • Custom website development (PHP / frameworks)
  • Landing pages aur portfolio websites
  • School, college aur coaching institute websites
  • Hospital aur medical website development
  • Government aur NGO websites
  • Responsive / mobile-friendly websites
  • Website redesign aur revamp

Technical Services:

  • Web application development
  • SEO-friendly website structure
  • Domain aur hosting assistance
  • Website security aur performance optimization
  • Website maintenance packages

Har project mein focus rehta hai ki website sirf sundar dikhe nahi — Google par rank bhi kare aur visitors ko customers mein convert kare.


Lucknow Businesses Ke Liye Custom Software Solutions

Sirf website nahi — Imgaurav.in custom software development in Lucknow bhi provide karta hai. Aaj Lucknow ke kai businesses manual processes ya outdated systems par kaam kar rahe hain, jahan custom software ek game-changer ho sakta hai.

Kuch examples:

  • School / College Management Software — admissions, fees, attendance, results — sab ek jagah
  • Hospital Management Software — patient records, billing, appointments
  • CRM Software — sales tracking, customer follow-ups, lead management
  • ERP Software — inventory, accounts, HR ek integrated system mein
  • Billing aur Inventory Software — retail shops, distributors ke liye
  • Coaching Institute Management — batch scheduling, fee collection, student tracking

Lucknow mein kai coaching institutes, medical colleges, NGOs aur small businesses ne pehle se iss tarah ke custom solutions ka benefit uthaya hai. Ek affordable custom software company in Lucknow se kaam karwane ka matlab hai — aapki actual business need ke according solution, na ki ek generic readymade product.


Website Development for Local Businesses in Lucknow

Chahe aap Hazratganj mein ek boutique chalate ho, Indira Nagar mein ek clinic ho, ya Gomti Nagar mein ek IT startup — aapke business ki website aapki locality aur audience ke hisaab se honi chahiye.

Local SEO ke liye website mein yeh cheezein zaroori hoti hain:

  • Location-specific content aur keywords
  • Google Maps integration
  • Fast loading speed (especially on mobile networks)
  • Clear contact information aur WhatsApp integration
  • Schema markup for local search visibility

Yeh sab Imgaurav.in ke website development process ka standard hissa hai — koi extra charge nahi.


Why Choose a Local Website Developer in Lucknow?

Kisi bade metro city ke agency ko kaam dene ki bajaye ek local web developer in Lucknow ko choose karne ke fayde:

  • Aapke business ko better samjha jayega — local market, local competition, local customers
  • Direct communication — call karein, milein, real-time updates lein
  • Long-term support — kuch bhi update karna ho, aasaani se ho sakta hai
  • Competitive pricing — metro cities ke comparison mein affordable rates

Imgaurav.in Lucknow aur aaspaas ke areas — Sitapur, Barabanki, Unnao — ke clients ke saath kaam karta hai aur inke digital growth mein seedha contribute karta hai.


📞 Contact Imgaurav.in

Lucknow mein website banwani hai, existing website redesign karwani hai, ya custom software develop karwana hai? Imgaurav.in se baat karein.

📞 9058108950
🌐 imgaurav.in

Aapke business ke requirement ke according professional website aur customized digital solution discuss karne ke liye aaj hi contact karein. Initial consultation bilkul free hai.


#WebsiteDeveloperLucknow #WebsiteDevelopmentLucknow #WebDeveloperLucknow #WebsiteCompanyLucknow #SoftwareDevelopmentLucknow #WebDesignLucknow #LucknowBusiness #Lucknow #SoftwareDeveloperLucknow #FreelanceDeveloperLucknow #CustomSoftwareLucknow #Imgaurav



Wednesday, July 26, 2017

Prevent Bootstrap Modal from disappearing when clicking outside or pressing escape?

If using JavaScript then:
<script>
$('#myModal').modal({
    backdrop: 'static',
    keyboard: false
})
</script>
and if HTML:

<a data-controls-modal="your_div_id" data-backdrop="static" data-keyboard="false" href="#">

Monday, July 10, 2017

short code for js in netbeans shortcut

Code 1:  

Type sc and press enter for script code 

Output:

<script type="text/javascript">      </script>

Code 2: 

Type d and press enter for document ready 

Output: 

<script type="text/javascript">
     $(document).ready(function(e) {   

       });
 </script>

Code 3: 

Type p and press enter for ajax post 

Output:

<script type="text/javascript">    
 $(document).ready(function (e) {  
       var post_data = {};       
        $.post("", post_data, function (res) {   
       });  
   }); 
</script>

Monday, July 3, 2017

Click button copy to clipboard using jQuery

 

// html code here 


<div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <br/>
                <h3 class="text-center">Capture Feedback</h3>
                <br/>
                <div class="col-md-8 col-sm-8 col-xs-12 col-md-offset-2 col-sm-offset-2">
                    <div class="col-md-8 col-sm-8 col-xs-12">
                        <input type="text" class="custom-url" placeholder="company rating link" value="https://www.google.co.in/" name="" id="copyTarget">
                    </div>
                    <div class="col-md-4 col-sm-4 col-xs-12">
                        <button class="custom-url color-red" id="copyButton">Copy URL</button>
                    </div>

                </div>
            </div>

        </div>

// Script code here 


<script type="text/javascript">
 document.getElementById("copyButton").addEventListener("click", function() {
    copyToClipboard(document.getElementById("copyTarget"));
    alert("Text copied");
});

function copyToClipboard(elem) {
 // create hidden text element, if it doesn't already exist
    var targetId = "_hiddenCopyText_";
    var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
    var origSelectionStart, origSelectionEnd;
    if (isInput) {
        // can just use the original source element for the selection and copy
        target = elem;
        origSelectionStart = elem.selectionStart;
        origSelectionEnd = elem.selectionEnd;
    } else {
        // must use a temporary form element for the selection and copy
        target = document.getElementById(targetId);
        if (!target) {
            var target = document.createElement("textarea");
            target.style.position = "absolute";
            target.style.left = "-9999px";
            target.style.top = "0";
            target.id = targetId;
            document.body.appendChild(target);
        }
        target.textContent = elem.textContent;
    }
    // select the content
    var currentFocus = document.activeElement;
    target.focus();
    target.setSelectionRange(0, target.value.length);
   
    // copy the selection
    var succeed;
    try {
     succeed = document.execCommand("copy");
    } catch(e) {
        succeed = false;
    }
    // restore original focus
    if (currentFocus && typeof currentFocus.focus === "function") {
        currentFocus.focus();
    }
   
    if (isInput) {
        // restore prior selection
        elem.setSelectionRange(origSelectionStart, origSelectionEnd);
    } else {
        // clear temporary content
        target.textContent = "";
    }
    return succeed;
}
</script>

Friday, June 30, 2017

Client Side Validation in Ckeditor or CKeditor Validation

Note: include JQuery  file and JQuery validation files

STEP NO : 1

<form action="#" method="post" id="formId">
<label>Description</label><textarea name="blog_description" class="required" id="editor1"></textarea>
            <script>
                CKEDITOR.replace('editor1');
            </script>

<input name="submit" type="submit" value="Submit Job" class="button" id="job-submit"/>
<input name="clear" type="reset" value="Clear Form"  class="button"/>
</form>

Thursday, June 22, 2017

How to get post image in worpdress or How to get post thumbnail in wordpress

//Default WordPress


// Thumbnail (150 x 150 hard cropped)


<?php    the_post_thumbnail( 'thumbnail' );       ?>

// Medium resolution (300 x 300 max height 300px)  
<?php the_post_thumbnail( 'medium' ); ?>  

 // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)    
<?php the_post_thumbnail( 'medium_large' ); ?> 

// Large resolution (1024 x 1024 max height 1024px)
<?php the_post_thumbnail( 'large' );  ?>    

// Full resolution (original size uploaded)
<?php the_post_thumbnail( 'full' );  ?>      


//With WooCommerce


// Shop thumbnail (180 x 180 hard cropped)


<?php the_post_thumbnail( 'shop_thumbnail' ); ?>  

// Shop catalog (300 x 300 hard cropped)
<?php the_post_thumbnail( 'shop_catalog' );  ?>   

 // Shop single (600 x 600 hard cropped)
<?php the_post_thumbnail( 'shop_single' ); ?>    

Tuesday, June 20, 2017

How to change dynamic background color

Script for change background color : Dynamic color 


<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<script>
    jQuery(function ($) {
        function changeColor(selector, colors, time) {
            var curCol = 0,
                    timer = setInterval(function () {
                        if (curCol === colors.length)
                            curCol = 0;
                        $(selector).css("background", colors[curCol]);
                        curCol++;
                    }, time);
        }
        $(window).load(function () {
            changeColor("#wrap", ["linear-gradient(to right, rgb(241, 242, 181), rgb(19, 80, 88))", "linear-gradient(to right, rgb(209, 145, 60), rgb(255, 209, 148))", "linear-gradient(to right, rgb(254, 172, 94), rgb(199, 121, 208), rgb(75, 192, 200))", "linear-gradient(to right, rgb(123, 67, 151), rgb(220, 36, 48))","linear-gradient(to right, rgb(112, 225, 245), rgb(255, 209, 148))","linear-gradient(to right, rgb(64, 59, 74), rgb(231, 233, 187))","linear-gradient(to right, rgb(58, 28, 113), rgb(215, 109, 119), rgb(255, 175, 123))","url('https://www.planwallpaper.com/static/images/Seamless-Polygon-Backgrounds-Vol2-full_Kfb2t3Q.jpg')"], 3000);
        });
    });
</script>

Monday, June 19, 2017

Only show current month of post in wordpress

<?php $current_month = date('m'); ?>

<?php $current_year = date('Y'); ?>

<?php query_posts("monthnum=$current_month&year=$current_year") ?>

<?php if ( have_posts() ) : ?>

<?php while ( have_posts() ) : the_post(); ?>

<?php the_content(); ?>

<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

Wednesday, May 10, 2017

Make div 100% height of browser window

How can this be used to make a divider fill the height of the browser?


For this question, we can make use of vh: 1vh is equal to 1% of the viewport's height. That is to say, 100vh is equal to the height of the browser window, regardless of where the element is situated in the DOM tree:

HTML
<html>
<head>
<title>Make div 100% height of browser window <title>
</head>
<div> </div>
<html>

CSS
<style>
div {
    height:100vh;
background:#ddd;
}
</style>

Tuesday, April 18, 2017

How to change the color of header bar and address bar in mobile (Responsive )

You need to add a <meta> tag in your <head> containing name="theme-color", with your HEX code as the content value.   For example:
<meta name="theme-color" content="#999999" />

You actually need 3 meta tags to support Android, iPhone and Windows Phone
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#4285f4">
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#4285f4">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#4285f4">


Monday, April 10, 2017

BOOTSTRAP GALLERY CODE

HTML CODE  HERE 


<div class="row">

    <div class="col-lg-12">
        <h1 class="page-header">Thumbnail Gallery</h1>
    
            <div class="col-lg-3 col-md-4 col-xs-6 thumb">
            <a class="thumbnail" href="#" data-image-id="" data-toggle="modal" data-title="This is my title" data-caption="Some lovely red flowers" data-image="http://onelive.us/wp-content/uploads/2014/08/flower-delivery-online.jpg" data-target="#image-gallery">
                <img class="img-responsive" src="http://onelive.us/wp-content/uploads/2014/08/flower-delivery-online.jpg" alt="Short alt text">
            </a>
        </div>
            <div class="col-lg-3 col-md-4 col-xs-6 thumb">
            <a class="thumbnail" href="#" data-image-id="" data-toggle="modal" data-title="The car i dream about" data-caption="If you sponsor me, I can drive this car" data-image="http://www.picturesnew.com/media/images/car-image.jpg" data-target="#image-gallery">
                <img class="img-responsive" src="http://www.picturesnew.com/media/images/car-image.jpg" alt="A alt text">
            </a>
        </div>
            <div class="col-lg-3 col-md-4 col-xs-6 thumb">
            <a class="thumbnail" href="#" data-image-id="" data-toggle="modal" data-title="Im so nice" data-caption="And if there is money left, my girlfriend will receive this car" data-image="http://upload.wikimedia.org/wikipedia/commons/7/78/1997_Fiat_Panda.JPG" data-target="#image-gallery">
                <img class="img-responsive" src="http://upload.wikimedia.org/wikipedia/commons/7/78/1997_Fiat_Panda.JPG" alt="Another alt text">
            </a>
        </div>
</div>


<div class="modal fade" id="image-gallery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" id="image-gallery-title"></h4>
            </div>
            <div class="modal-body">
                <img id="image-gallery-image" class="img-responsive" src="">
            </div>
            <div class="modal-footer">

                <div class="col-md-2">
                    <button type="button" class="btn btn-primary" id="show-previous-image">Previous</button>
                </div>

                <div class="col-md-8 text-justify" id="image-gallery-caption">
                    This text will be overwritten by jQuery
                </div>

                <div class="col-md-2">
                    <button type="button" id="show-next-image" class="btn btn-default">Next</button>
                </div>
            </div>
        </div>
    </div>
</div>


JS CODE HERE 

$(document).ready(function(){

    loadGallery(true, 'a.thumbnail');

    //This function disables buttons when needed
    function disableButtons(counter_max, counter_current){
        $('#show-previous-image, #show-next-image').show();
        if(counter_max == counter_current){
            $('#show-next-image').hide();
        } else if (counter_current == 1){
            $('#show-previous-image').hide();
        }
    }


    function loadGallery(setIDs, setClickAttr){
        var current_image,
            selector,
            counter = 0;

        $('#show-next-image, #show-previous-image').click(function(){
            if($(this).attr('id') == 'show-previous-image'){
                current_image--;
            } else {
                current_image++;
            }

            selector = $('[data-image-id="' + current_image + '"]');
            updateGallery(selector);
        });

        function updateGallery(selector) {
            var $sel = selector;
            current_image = $sel.data('image-id');
            $('#image-gallery-caption').text($sel.data('caption'));
            $('#image-gallery-title').text($sel.data('title'));
            $('#image-gallery-image').attr('src', $sel.data('image'));
            disableButtons(counter, $sel.data('image-id'));
        }

        if(setIDs == true){
            $('[data-image-id]').each(function(){
                counter++;
                $(this).attr('data-image-id',counter);
            });
        }
        $(setClickAttr).on('click',function(){
            updateGallery($(this));
        });
    }

});

Sunday, March 26, 2017

how to make a search form with multiple search options in php

Suppose These are fields:-

$user_name = $_POST[‘user_name’]$city = $_POST[‘city’]

Take a variable:-

$sql = ‘SELECT * FROM USER_TABLE WHERE 1=1’;

(i)   Now if user fills something in user_name:-

If(!empty($user_name))Then :-$sql = $sql . ‘AND user_name = ’.$user_name;

(ii) Now if user fills something in city:-

If(!empty($city))Then :-$sql = $sql . ‘AND city = ’.$city;And then run this query :- mysql_query($sql) 

Thursday, March 9, 2017

Equal height js

equalheight = function (container) {

var currentTallest = 0,
currentRowStart = 0,
rowDivs = new Array(),
$el,
topPosition = 0;
$(container).each(function () {

$el = $(this);
$($el).height('auto')
topPostion = $el.position().top;

if (currentRowStart != topPostion) {
for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
rowDivs.length = 0; // empty the array
currentRowStart = topPostion;
currentTallest = $el.height();
rowDivs.push($el);
} else {
rowDivs.push($el);
currentTallest = (currentTallest < $el.height()) ? ($el.height()) : (currentTallest);
}
for (currentDiv = 0; currentDiv < rowDivs.length; currentDiv++) {
rowDivs[currentDiv].height(currentTallest);
}
});
}

.... add your  class .... 

$(window).load(function () {
equalheight('.equal .pray');
});
$(window).resize(function () {
equalheight('.equal .pray');
});

Saturday, February 4, 2017

Jquery events not working on ajax loaded content

It's because you are binding the event on document ready. You have to use a delegate in order for this to work. Like on. It's because .header isn't on the page on the page when it's loaded. So no event is attached.
Your code should look some along the lines of this:

$('body').on('click','.heading',function(){
     $(this).css('color','red');  
});   
It doesn't have to be body, but an element which isn't loaded after document ready, which is a parent of .heading.

Saturday, January 14, 2017

PHP CURL POST & GET Examples – Submit Form using PHP CURL

PHP CURL POST & GET Examples – Submit Form using PHP CURL


In PHP CURL POST tutorial, I have explained how to send HTTP GET / POST requests with PHP CURL library.

Below are the examples covered in this article.
1) Send HTTP GET Request with CURL
2) Send HTTP POST Requests with CURL
3) Send Random User-Agent in the Requests
4) Handle redirects (HTTP 301,302)
5) Handle Errors.


Why we need PHP CURL ?

 
To send HTTP GET requests, simply we can use file_get_contents() method.
file_get_contents('http://gauravyadav94.blogspot.in/');

But sending POST request and handling errors are not easy with file_get_contents().

Sending HTTP requests is very simple with PHP CURL.You need to follow the four steps to send request.

 
step 1). Initialize CURL session    


$ch = curl_init();


step 2). Provide options for the CURL session   


curl_setopt($ch,CURLOPT_URL,"http://gauravyadav94.blogspot.in/");
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//curl_setopt($ch,CURLOPT_HEADER, true); //if you want headers


CURLOPT_URL -> URL to fetch
CURLOPT_HEADER -> to include the header/not
CURLOPT_RETURNTRANSFER -> if it is set to true, data is returned as string instead of outputting it.

For full list of options, check this PHP Documentation.

step 3). Execute the CURL session  
$output=curl_exec($ch);


step 4). Close the session  
curl_close($ch);

Note: You can check whether CURL enabled/not with the following code.    
if(is_callable('curl_init')){
   echo "Enabled";
}
else
{
   echo "Not enabled";
}


1.PHP CURL GET Example

You can use the below code to send GET request.
   
function httpGet($url)
{
    $ch = curl_init(); 

    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//  curl_setopt($ch,CURLOPT_HEADER, false);

    $output=curl_exec($ch);

    curl_close($ch);
    return $output;
}

echo httpGet("
http://gauravyadav94.blogspot.in/");


2.PHP CURL POST Example

PHP CURL POST & GET Examples
You can use the below code to submit form using PHP CURL.
   
function httpPost($url,$params)
{
  $postData = '';
   //create name value pairs seperated by &
   foreach($params as $k => $v)
   {
      $postData .= $k . '='.$v.'&';
   }
   $postData = rtrim($postData, '&');

    $ch = curl_init(); 

    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($ch,CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_POST, count($postData));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);   

    $output=curl_exec($ch);

    curl_close($ch);
    return $output;

}

How to use the function:
   
$params = array(
   "name" => "Ravishanker Kusuma",
   "age" => "32",
   "location" => "India"
);


echo httpPost("http://
http://gauravyadav94.blogspot.in/examples/php/curl-examples/post.php",$params);


3.Send Random User-Agent in the Requests

You can use the below function to get Random User-Agent.  
function getRandomUserAgent()
{
    $userAgents=array(
        "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6",
        "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)",
        "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)",
        "Opera/9.20 (Windows NT 6.0; U; en)",
        "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; en) Opera 8.50",
        "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.1) Opera 7.02 [en]",
        "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; fr; rv:1.7) Gecko/20040624 Firefox/0.9",
        "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/48 (like Gecko) Safari/48"      
    );
    $random = rand(0,count($userAgents)-1);

    return $userAgents[$random];
}

Using CURLOPT_USERAGENT, you can set User-Agent string.
1  
curl_setopt($ch,CURLOPT_USERAGENT,getRandomUserAgent());


4.Handle redirects (HTTP 301,302)

To handle URL redirects, set CURLOPT_FOLLOWLOCATION to TRUE.Maximum number of redirects can be controlled using CURLOPT_MAXREDIRS.

curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE);
curl_setopt($ch,CURLOPT_MAXREDIRS,2);//only 2 redirects


5.How to handle CURL errors

we can use curl_errno(),curl_error() methods, to get the last errors for the current session.
curl_error($ch) -> returns error as string
curl_errno($ch) -> returns error number
You can use the below code to handle errors.  
function httpGetWithErros($url)
{
    $ch = curl_init(); 

    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);

    $output=curl_exec($ch);

    if($output === false)
    {
        echo "Error Number:".curl_errno($ch)."<br>";
        echo "Error String:".curl_error($ch);
    }
    curl_close($ch);
    return $output;
}

For the full list of errors, refer CURL errors

 

Wednesday, January 4, 2017

How They Hack Your Website

SQL Injection

SQL Injection involves entering SQL code into web forms, eg. login fields, or into the browser address field, to access and manipulate the database behind the site, system or application.When you enter text in the Username and Password fields of a login screen, the data you input is typically inserted into an SQL command. This command checks the data you've entered against the relevant table in the database. If your input matches table/row data, you're granted access (in the case of a login screen). If not, you're knocked back out.


The Simple SQL Injection Hack

In its simplest form, this is how the SQL Injection works. It's impossible to explain this without reverting to code for just a moment. Don't worry, it will all be over soon.

Suppose we enter the following string in a Username field:

' OR 1=1

double-dash-txt.png
The authorization SQL query that is run by the server, the command which must be satisfied to allow access, will be something along the lines of:

SELECT * FROM users WHERE username = ?USRTEXT '
AND password = ?PASSTEXT?

...where USRTEXT and PASSTEXT are what the user enters in the login fields of the web form.

So entering `OR 1=1 -- as your username, could result in the following actually being run:

SELECT * FROM users WHERE username = ?' OR 1=1 -- 'AND password = '?

Two things you need to know about this:
['] closes the [username] text field.

'

double-dash-txt.png
' is the SQL convention for Commenting code, and everything after Comment is ignored. So the actual routine now becomes:
SELECT * FROM users WHERE username = '' OR 1=1

1 is always equal to 1, last time I checked. So the authorization routine is now validated, and we are ushered in the front door to wreck havoc.

Tuesday, January 3, 2017

How do I get a YouTube video thumbnail from the YouTube API?

Each YouTube video has 4 generated images. They are predictably formatted as follows:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
https://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/hqdefault.jpg
There is also a medium quality version of the thumbnail, using a url similar to the HQ:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/mqdefault.jpg
For the standard definition version of the thumbnail, use a url similar to this:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/sddefault.jpg
For the maximum resolution version of the thumbnail use a url similar to this:

https://img.youtube.com/vi/<insert-youtube-video-id-here>/maxresdefault.jpg
All of the above urls are available over http too. Additionally, the slightly shorter hostname i3.ytimg.com works in place of img.youtube.com in the example urls above.

Thursday, November 10, 2016

Onclick javascript to make browser go back to previous page

1. First Method

 <a href="javascript: history.go(-1)">Go Back</a></div>

2. Second Method

<a href="##" onClick="history.go(-1); return false;">Go back</a> \

3.Third Method

<input name="action" type="submit" value="Cancel" onclick="window.history.back();"/>

if we want to more than one step back then increase

For going 2 steps back history.go(-2)
For going 3 steps back history.go(-3)
For going 4 steps back history.go(-4)
and so on.......

Friday, November 4, 2016

Jquery validation Rule List

Rule Format

To add rules to your input elements follow this format:
data-rule-[rule name separate by dashes]="true" 
Here are some examples:
  • Required - data-rule-required="true"
  • Email - data-rule-email="true"
  • Minimum Length = data-rule-minlength="6"

Message Format

By default the jQuery Validation Plugin will add it’s owne messages, but you can customize them to be whatever you want using another data attribute. To specify messages for each rule with data attributes follow this format:
data-msg-[rule name separate by dashes]="The message you want."
Here are some examples:
  • Required - data-msg-required="Madam/sir, this field is required."
  • Email - data-msg-email="Let us spam you, enter a valid email address."

Rule List:

If you want to know exactly what the validators are available and what they do look at the code for the validators in core or browse the additional validators.
Here is a list of them that I compiled by looking at the source on GitHub. I marked them with what part of the framework they’re from, and whether or not I tested them:
(Tested, core)
  • data-rule-required=”true”
  • data-rule-email=”true”
(Untested, core, but should work)
  • data-rule-url=”true”
  • data-rule-date=”true”
  • data-rule-dateISO=”true”
  • data-rule-number=”true”
  • data-rule-digits=”true”
  • data-rule-creditcard=”true”
  • data-rule-minlength=”6”
  • data-rule-maxlength=”24”
  • data-rule-rangelength=”5,10”
  • data-rule-min=”5”
  • data-rule-max=”10”
  • data-rule-range=”5,10”
  • data-rule-equalto=”#password”
  • data-rule-remote=”custom-validatation-endpoint.aspx”
(Untested, additional, but should work)
  • data-rule-accept=””
  • data-rule-bankaccountNL=”true”
  • data-rule-bankorgiroaccountNL=”true”
  • data-rule-bic=””
  • data-rule-cifES=””
  • data-rule-creditcardtypes=””
  • data-rule-currency=””
  • data-rule-dateITA=””
  • data-rule-dateNL=””
  • data-rule-extension=””
  • data-rule-giroaccountNL=””
  • data-rule-iban=””
  • data-rule-integer=”true”
  • data-rule-ipv4=”true”
  • data-rule-ipv6=”true”
  • data-rule-mobileNL=””
  • data-rule-mobileUK=””
  • data-rule-lettersonly=”true”
  • data-rule-nieES=””
  • data-rule-nifES=””
  • data-rule-nowhitespace=”true”
  • data-rule-pattern=””
  • data-rule-phoneNL=”true”
  • data-rule-phoneUK=”true”
  • data-rule-phoneUS=”true”
  • data-rule-phonesUK=”true”
  • data-rule-postalcodeNL=”true”
  • data-rule-postcodeUK=”true”
  • data-rule-require_from_group=””
  • data-rule-skip_or_fill_minimum=””
  • data-rule-strippedminlength=””
  • data-rule-time=””
  • data-rule-time12h=””
  • data-rule-url2=””
  • data-rule-vinUS=””
  • data-rule-zipcodeUS=”true”
  • data-rule-ziprange=””