Posts marked with "Posts" in posts

Jquery ExtAjax Plugin V 1.2: Submit forms to external files with preview using Jquery

If you don’t know what this plugin will do then visit the page of the previous version here.
The last version of Jquery ExtAjax plugin didn’t have preview feature. But in this version it have a preview feature.
The latest version is V 1.2

What’s New in this version

  • Faster
  • Preview feature. 

What should I do after downloading.

<div>
  <span style="color: #333333;"><span style="line-height: 16px;">After downloading upload "<b>extajax.js</b>", "<b>asdva.php</b>" to your server.</span></span>
</div>

<div>
  <span style="color: #333333;"><span style="line-height: 16px;">Before you do this configure the place in <b>JS</b>&nbsp;file&nbsp;where <b>asdva.php</b>&nbsp;is located.</span></span>
</div>

<h4 style="text-align: left;">
  <span style="color: #333333;"><span style="line-height: 16px;">&nbsp;<b>How can I configure ?</b></span></span>
</h4>

<div>
  <span style="color: #333333;"><span style="line-height: 16px;"><b>&nbsp;</b>Go to <b>extajax.js</b>&nbsp;file. Search for&nbsp;<b>var asdvafile&nbsp;</b>. Enter the location of the <b>asdva.php </b>if the file is not in the same folderas <b>extajax.js</b>.</span></span>
</div>

<div>
  <span style="color: #333333;"><span style="line-height: 16px;"><a name='more'></a><br /></span></span>
</div>

<p>
  <span style="color: #333333; font-family: inherit;"><span style="line-height: 16px;">Jquery Code :</span></span>
</p>

<blockquote class="tr_bq">
  <p>
    <span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><script></span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><br /></span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">$("</span><span style="background-color: white; color: red; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">#form</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">").submit(function(){</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">event.preventDefault();</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">$("</span><span style="background-color: white; color: red; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">#form</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">").extajax({target:"</span><span style="background-color: white; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><span style="color: red;">#preview</span></span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;">"});</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><br />});</span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><br /></span><span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"></script></span>
  </p>
</blockquote>

<p>
  <span style="background-color: white; color: #333333; font-family: Courier, monospace, 'Courier New'; font-size: 13px; font-weight: bold; line-height: 16px;"><br /></span><span style="font-size: large;"><span style="border: 2px solid black;"><span style="color: white;"><span style="background-color: #6aa84f;"><a href="http://subins.tk/labs/extajax/index.html" >View Demo</a></span></span></span>&nbsp; &nbsp; &nbsp; &nbsp;<span style="background-color: #6aa84f; border: 2px solid black;"><span style="color: white;"><a href="https://drive.google.com/uc?export=download&id=0B2VjYaTkCpiQbTJtY1ZyNmFjZUk" >Download(ZIP)</a></span></span>&nbsp; &nbsp; &nbsp; &nbsp;<span style="background-color: #6aa84f; border: 2px solid black; color: white;"><a href="https://drive.google.com/uc?export=download&id=0B2VjYaTkCpiQcXRreFNxLXRCam8" >Download(Javascript file)</a></span></span></div> </div>
... [READ MORE]

Storing JSON object in HTML5 Local Storage : Stringify

This tutorial will help you to store JSON Object in LocalStorage.

This method uses a function called stringify.
Suppose we have a JSON object like this :

var data = {name:’subin’,class:’8A’};

If we want to store this JSON object in Local Storage then use the function below:

localStorage[‘info‘]=JSON.stringify(data);

That’s it. JSON Object is now stored in your Local Storage.
... [READ MORE]

Subins Games : A new Game site from Subins

This is my 5th project. The Subins Games. This site is for playing games. 

Functions

  • Commenting
  • Score saving
  • Play History
  • Add your game
  • Game stats
 (And adding new ones!)
Like all the other projects this project has used Javascript Library Jquery and the server side language is PHP.
This site’s games is the combination of old PFOGB and G2E.
The main problem I faced was the merging of two blogs to one. It was very difficult to merge manually.
So I used WordPress in my localhost to import posts from blogger and exported the posts in XML format.
Then I used PHP to insert the XML file contents to MySql Database. Thankyou WordPress.
... [READ MORE]

The best method to find client’s IP Address in PHP.

This simple function will help you to find the client’s IP. You could use $_SERVER[‘REMOTE_ADDR’] , but this method will not returns the actual IP address.

To get the real IP address use this method.

function getUserIpAddr(){
    if (!empty($_SERVER[‘HTTP_CLIENT_IP’])){
        return $_SERVER[‘HTTP_CLIENT_IP’];
    }else if (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])){
        $ite=explode(‘,’,$_SERVER[‘HTTP_X_FORWARDED_FOR’]); return str_replace(" ",",$ite[0]);
    }else{
        return $_SERVER[‘REMOTE_ADDR’];
    }
} $cip=getUserIpAddr();

... [READ MORE]

How to view or Download Google Drive files on your site

Many of you wanted to show images, videos etc… on your site which is uploaded on your Google Drive.

The link of the file will not be the same at all times due to security reasons. 
So Google provides another method to show or download a file.
For this method you need to get the file id. For that open your file. 
Look at the url box of your browser.
As shown in the image you should select the word before /edit and after d/.
This selected text will be the file id. Copy the file id.

To View

https://drive.google.com/uc?export=view&id=fileid

... [READ MORE]

Finding Client’s IP address, Country, State, City using NetIP.de api in PHP

If you want to get client’s IP address you will use $_SERVER[‘REMOTE_ADDR’] function in PHP.
But you will not get the real IP address of the client. To get the real IP address You can use the method I used.
Also With this method you can also find the City, State, Country client’s in.
The code is pretty simple. With the help of NetIP.de it was pretty easy.

$response=@file_get_contents(‘http://www.netip.de’);if (empty($response)){throw new InvalidArgumentException("Error contacting Geo-IP-Server");}$patterns=array();$patterns["state"] = ‘#State/Region: (.*?);$patterns["IP"] = ‘#IP: (.*?) #i’;$patterns["country"] = ‘#Country: (.*?) #i’;$patterns["city"] = ‘#City: (.*?) $pattern){$ipInfo[$key] = preg_match($pattern,$response,$value) && !empty($value[1]) ? $value[1] : ‘not found’;} $uct=$ipInfo["state"];$uip=$ipInfo["IP"];$uci=$ipInfo["city"];$ipInfo=explode(‘-‘,$ipInfo["country"]);$ucs=$ipInfo[0];$uco=$ipInfo[1];

... [READ MORE]

Vishnu – I will never forget you.

He was a closest friend of mine. He always told other people about me. He was so so nice to me. I am very sad. I don’t know what to say. Just Sad. Very Sad. I saw his face and it melted my heart.

He may have died But he will always be in my heart.Vishnu Vijayan You will always be in my heart forever. I will not forget you.


He died in this cheerful Christmas which make my Christmas the worst. I was so sad but then I realised that some things will happen for a reason.

May GOD bless his soul.
... [READ MORE]

Make Snowfall on your site/blog using Javascript

It’s Christmas. It’s time for snowing. Want to have a snowfall on your site just like in my blog. Here’s the Java script for snowing.
Note – This code is for websites. Code for blogger is below this code

<blockquote class="tr_bq">
  <p>
    <script><br />&nbsp; //Configure below to change URL path to the snow image<br />&nbsp; var snowsrc="http://subins.hp.af.cm/files/images/snow.gif"<br />&nbsp; // Configure below to change number of snow to render<br />&nbsp; var no = 20;<br />&nbsp; // Configure whether snow should disappear after x seconds (0=never):<br />&nbsp; var hidesnowtime = 0;<br />&nbsp; // Configure how much snow should drop down before fading ("windowheight" or "pageheight")<br />&nbsp; var snowdistance = "pageheight";<br />///////////Stop Config//////////////////////////////////<br />&nbsp; var ie4up = (document.all) ? 1 : 0;<br />&nbsp; var ns6up = (document.getElementById&&!document.all) ? 1 : 0;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>function iecompattest(){<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />&nbsp; var dx, xp, yp; &nbsp; &nbsp;// coordinate and position variables<br />&nbsp; var am, stx, sty; &nbsp;// amplitude and step variables<br />&nbsp; var i, doc_width = 800, doc_height = 600;<br />&nbsp; if (ns6up) {<br />&nbsp; &nbsp; doc_width = self.innerWidth;<br />&nbsp; &nbsp; doc_height = self.innerHeight;<br />&nbsp; } else if (ie4up) {<br />&nbsp; &nbsp; doc_width = iecompattest().clientWidth;<br />&nbsp; &nbsp; doc_height = iecompattest().clientHeight;<br />&nbsp; }<br />&nbsp; dx = new Array();<br />&nbsp; xp = new Array();<br />&nbsp; yp = new Array();<br />&nbsp; am = new Array();<br />&nbsp; stx = new Array();<br />&nbsp; sty = new Array();<br />&nbsp; snowsrc=(snowsrc.indexOf("subins.hp.af.cm")!=-1)? "http://subins.hp.af.cm/files/images/snow.gif" : snowsrc<br />&nbsp; for (i = 0; i < no; ++ i) { <br />&nbsp; &nbsp; dx[i] = 0; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// set coordinate variables<br />&nbsp; &nbsp; xp[i] = Math.random()*(doc_width-50); &nbsp;// set position variables<br />&nbsp; &nbsp; yp[i] = Math.random()*doc_height;<br />&nbsp; &nbsp; am[i] = Math.random()*20; &nbsp; &nbsp; &nbsp; &nbsp; // set amplitude variables<br />&nbsp; &nbsp; stx[i] = 0.02 + Math.random()/10; // set step variables<br />&nbsp; &nbsp; sty[i] = 0.7 + Math.random(); &nbsp; &nbsp; // set step variables<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if (ie4up||ns6up) {<br />&nbsp; &nbsp; &nbsp; if (i == 0) {<br />&nbsp; &nbsp; &nbsp; &nbsp; document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><a href="http://sag-3.blogspot.com/2012/12/snowfall-using-js.html"><img src='"+snowsrc+"&#8216; border="0&#8243;></a></div>");<br />&nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; document.write("<div id="dot"+ i +"" style="POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;"><img src='"+snowsrc+"&#8216; border="0&#8243;></div>");<br />&nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; }<br />&nbsp; function snowIE_NS6() { &nbsp;// IE and NS6 main animation function<br />&nbsp; &nbsp; doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? &nbsp;iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;<br />&nbsp; &nbsp; for (i = 0; i < no; ++ i) { &nbsp;// iterate for every dot<br />&nbsp; &nbsp; &nbsp; yp[i] += sty[i];<br />&nbsp; &nbsp; &nbsp; if (yp[i] > doc_height-50) {<br />&nbsp; &nbsp; &nbsp; &nbsp; xp[i] = Math.random()*(doc_width-am[i]-30);<br />&nbsp; &nbsp; &nbsp; &nbsp; yp[i] = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; stx[i] = 0.02 + Math.random()/10;<br />&nbsp; &nbsp; &nbsp; &nbsp; sty[i] = 0.7 + Math.random();<br />&nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; dx[i] += stx[i];<br />&nbsp; &nbsp; &nbsp; document.getElementById("dot"+i).style.top=yp[i]+"px";<br />&nbsp; &nbsp; &nbsp; document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px"; <br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; snowtimer=setTimeout("snowIE_NS6()", 25);//Set Timeout<br />&nbsp; }<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>function hidesnow(){<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if (window.snowtimer) clearTimeout(snowtimer)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<span class="Apple-tab-span" style="white-space: pre;"> </span>if (ie4up||ns6up){<br />&nbsp; &nbsp; snowIE_NS6();<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>if (hidesnowtime>0)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>setTimeout("hidesnow()", hidesnowtime*1000)<br /><span class="Apple-tab-span" style="white-space: pre;"> </span>}<br /></script>
  </p>
</blockquote>

Blogger Code

Go to Template -> Edit HTML
Paste this code after tag.

... [READ MORE]

FriendsHood – A new Social Network from Subins

Friendshood is vulnerable to MySQL Injection and shouldn’t be used anymore. Please see my latest project : http://subinsb.com/2013/12/open-an-open-source-social-network-is-released
Original Post :
Many of you now know the project I’ve been working on. In that project I have created a social Network called FriendsHood. I created this social network because my friends have been telling me to create a social network. They told me because School said to block Facebook and no student should use Facebook.

... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab