Skip to main content

Posts

Showing posts from 2018

get live location from ip and zip codes

<html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title></title>     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body>     <script type="text/javascript">         jQuery(document).ready(function($){                $.getJSON( "http://ip-api.com/json", function( data ) {               var items = [];               $.each( data, function( key, val ) {                 if ( key == 'zip' ){                 alert( key + ": " + val );                 }  ...

add multiple fields with add more button with date picker

 <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>                     <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.1/css/datepicker3.css" rel="stylesheet" />             <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.1/js/bootstrap-datepicker.js"></script>             <button class="add_field_button">Add More Fields</button>             <button type="button" class="remove_field_button">Remove Field</button>   ...

save cookies with javascript and jquery cookie

<script type="text/javascript"> function setCookie(cname,cvalue,exdays) {     var d = new Date();     d.setTime(d.getTime() + (exdays*24*60*60*1000));     var expires = "expires=" + d.toGMTString();     document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } jQuery(document).ready(function ($) {     $(".close").click(function () {         var text = $(this).attr('value');         setCookie("username7877", text, 30);         $("#note-ticker").hide();     }); }); </script> PHP////////// <?php $cookie_name = "user"; $cookie_value = "Alex Porter"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); ?>

Json to php array

$url = 'your url here';     $ch = curl_init();     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);     curl_setopt($ch, CURLOPT_HEADER, false);     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);     curl_setopt($ch, CURLOPT_URL, $url);     curl_setopt($ch, CURLOPT_REFERER, $url);     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);     $result = curl_exec($ch);     curl_close($ch); $my_array_data = json_decode($result, TRUE);

bootstrap image slider with carousel

    <div class="container">   <div class="row">     <h1>Bootstrap 3 lightbox hidden gallery using modal</h1>         <hr>         <div class="row">                                     <div class="col-12 col-md-4 col-sm-6">                     <a title="Image 1" href="#">                         <img class="thumbnail img-responsive" id="image-1" src="http://dummyimage.com/600x350/ccc/969696&amp;text=0xD10x810xD00xB50xD10x800xD10x8B0xD00xB9">                   ...