Tuesday, 28 March 2017

Using Google Robot reCAPTCHA on localhost

It's so easy:
  1. Go to your google reCaptcha admin panel
  2. Add localhost & 127.0.0.1 to domains of a new site like the following image.



Saturday, 25 March 2017

Html 5 Mobile Number Validation

HTML





<form action=""> 

    <input type="text" maxlength="10" pattern="[0-9]{10}" title="Enter your mobile number"
required> <input type="submit">

 </form>



Thursday, 23 March 2017

jquery position scroll div fixed and height fix and bottom remove

HTML

<div id="f">
    I'm going to follow you only so far...
</div>

https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />
https://hemant9807.blogspot.in/<br />


JS 

var windw = this;

$.fn.followTo = function(pos) {
    var $this = this,
        $window = $(windw);

    $window.scroll(function(e) {
        if ($window.scrollTop() > pos) {
            $this.css({
                position: 'absolute',
                top: pos
            });
        } else {
            $this.css({
                position: 'fixed',
                top: 0
            });
        }
    });
};

$('#f').followTo(250);


CSS

#f {
    background:#ace;
    padding:20px;
    width:200px;
    position:fixed; top:0; left:0;
}

Wednesday, 8 March 2017

yii2 limit offset

limit()


$model = User::find()->limit(10)->all();

 
$model = User::find()->where('userid > 1 and isactive=1')->limit(2)->all(); 

offset()

$model = User::find()->limit(5)->offset(10)->all();

Thursday, 2 March 2017

how to share url linkedin in php


https://www.linkedin.com/shareArticle?mini=true&url=YOUR_URL&title=YOUR_TITLE&summary=YOUR_SUMMARY


how to share url linkedin in php

how to share url Twitter in php

https://twitter.com/intent/tweet?text=YOUR_TITLE&url=YOUR_URL&related=YOUR_COMPANY_NAME




how to share url Twitter in php

how to share url facebook in php

https://www.facebook.com/sharer/sharer.php?u=YOUR_URL


how to share url facebook in php

how to share url google plus in php

https://plus.google.com/share?url=YOUR_URL