PHP Quick Tips

What is the difference between window.onload and document.ready ?

The ready event occurs after the HTML document has been loaded, while the onload event occurs later, when all content (e.g. images) also has been loaded.

The onload event is a standard event in the DOM, while the ready event is specific to jQuery. The purpose of the ready event is that it should occur as early as possible after the document has loaded, so that code that adds funcionality to the elements in the page doesn’t have to wait for all content to load.

PHP Coding for find your IP Address
<?php
//Gets the IP address
$ip = getenv(“REMOTE_ADDR”) ;
echo “Your IP is ” . $ip;
?>

PHP coding for Browser info..

<?php
echo $_SERVER[‘HTTP_USER_AGENT’] . “\n\n”;

$browser = get_browser(null, true);
print_r($browser);
?>

Go thru this link too.. click

CSS Tips:

To display image in center use

style=”display: block; margin: 0 auto; ”

Image Zoom like E-commerce site using multizoom.js

<script type="text/javascript" src="jquery.min.js">
</script>
<script type="text/javascript" src="multizoom.js">
</script>
<script type="text/javascript">
jQuery(document).ready(function($){
 $('#image1').addimagezoom({ 
  zoomrange: [3,3],
  magnifiersize: [300,300],
  magnifierpos: 'right',
  cursorshade: false,
  largeimage: ''
 })
})

</script>

<h3>Demo</h3>
<img id="image1" border="0" src="logo.jpg" style="width:200px;height:120px">