Resize bigger images with javascritpts

I found nice way to re size bigger images to fit in page using java scripts as resizing images with php is resource hungry and bandwidth eating process. Can't process each image from external servers!
We all know html code for image.

<img src="http://i49.tinypic.com/28tglyr_th.jpg">

Now here added one function on onload event of image tag.

<img id="random_uniq_id" src="http://i49.tinypic.com/28tglyr_th.jpg" onload="resize(this.width,this.height,this.id);">

So what's inside this function?


<script>

function (real_width,real_height,uniq_id)
{
var d = document.getElementById(uniq_id);
var new_width, new_height;
if(real_width >= 600) { new_width = real_width/3; new_height = real_height/3;
d.width = new_width;
d.height = new_height;
}
if(real_height >= 500) { new_width = real_width/3; new_height = real_height/3;
d.width = new_width;
d.height = new_height;
}
}
</script>


This is simple way to re size images from client side! It's easy.

PS: always call functions in head section.

PHP mysql Connection!

In PHP always we required mysql connection. So i have developed my own way of creating connection. Here we go!


<?php
$host = "localhost";
$user = "root";
$pass = "";
$db = "test_db";

$cc = mysql_connect($host,$user,$pass);
$select_db = ($cc,$db);
$qry = "select * from table_abc";
---
--- Process ---
---

mysql_close($cc);
?>;


This is the simple way to make php mysql database connection. We can add additional error message if some process failed! using if not i.e !

CSS Uppercase / All Caps

Need to know how to make text all uppercase or in all caps with CSS? Add the following to your CSS stylesheet:

div.uppercase { text-transform: uppercase; }

That will take all the letters and capitalize them. If you only want the first letter of each word to be in upper case, then use capitalize in the text-transform property.

div.caps { text-transform: capitalize; }

wow! nice dmain name!

hey it nice i got this blog address! orkut trends. Just entered query orkut+trends and redirected to official orkut blog post about orkut trends.
http://en.blog.orkut.com/2007/09/posted-by-ellen-spertus-research.html Anyways starting blog posting here!! keep visiting!