Thursday, 28 January 2016

Download image from url php curl

From Curl we can request to other site to grab all data which is in form of JS html and so on
in this example i want to shows that how to fetch images from other URL
By CURL we can get all HTML from other URL then i substracted that all images from that content and display data and image both in Proper way in our page without redirect on other sites

From cURL

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, "WEBSITE URL");
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    $data = curl_exec($ch);

which return to us data in form on Html  ,

    $info = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);

Like










How To Add Google Map ?

Add Google map for contact page or any page when we want to only simply display
This example is related to only display Google Map on your page.
---------------------------------------------------------------------------------------------------------
1. need to import one Js for giving some Parameter for screen,size, Layout

Make  a page Of HTML and Copy code of below

<html>
<head>
    <title>Google Map</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAtpJ5OJBnShEv8OFU7y-AbhQ__7sFaDpuL65txGVh-wixYcRGXBRwzC2C_FJISzU_cTyQfTSoDlZNaw" type="text/javascript"></script>
    <script src="maps.js" type="text/javascript"></script>
    <style type="text/css">
        body { font-family: Arial, sans-serif; }
    </style>
</head>
<body onload="MapLoad()" onunload="MapUnload()">
<div>
    <img id="map_52.202_0.1281"
        width="500"
        height="400"
        src="map.gif"
        alt="Map"
        />
</div>

</body>
</html>

Download Source Code