Changing javascript date/time to server date/time using php

Simple way to change JavaScript date/time to server date/time, first we are going to pass php date format into javascript date function.

<script language="javascript">
var serverDate = new Date("<?php echo date("Y/m/d");?>");
var systemDate = new Date();

function currentDateTime() {	
	document.getElementById("divCurrentSYSTEMDate").innerHTML = systemDate;
	document.getElementById("divCurrentSERVERDate").innerHTML = serverDate;	
}
</script>

Now we are going to call currentDateTime function inside the body, which will display the current system and server date/time.

Current SYSTEM date/time <div id="divCurrentSYSTEMDate"></div><br /><br />
Current SERVER date/time <div id="divCurrentSERVERDate"></div><br /><br />

<script>currentDateTime();</script>

[ Download ] | [ Demo ]

hide and show div tag using jquery and javascript

first we are going to include jquery library for show and hide the div tag

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

we are going to show and hide the div tag using jquery function

<script language="javascript">
$(document).ready(function() {
    $("#showID").click(function() { $("#divMsg").show(1000);});
    $("#hideID").click(function() { $("#divMsg").hide(1000);});
});
</script>

creating two link to show and hide based on the link ids

<div><a href="javascript:;" id="showID">Show</a> | 
<a href="javascript:;" id="hideID">Hide</a></div>

next we are going to create div tag which display show and hide the content from it

<div id="divMsg">Your content will comes here...</div>

Read the rest of this entry »

search engine result page using curl php

Configuration script which will have domain, function for url validate and check the keywords.

<?php
	define("domain","http://www.google.com");

	function getValidateLink($url) {
		if(!filter_var($url, FILTER_VALIDATE_URL,FILTER_FLAG_QUERY_REQUIRED)) {
			echo domain.$url;
		}
	}

	$strKeywords = '';
	if(isset($_GET["q"])) {
		$strKeywords = (isset($_GET["q"])) ? $_GET["q"] : "codeasearch.com";
	}
?>

Read the rest of this entry »