Wednesday, June 11, 2008

How to get String Length in JavaScript

Getting String Length in JavaScript is pretty easy.
look at the following code:

var str_length = document.form1.textbox_name1.value;

alert(str_length.length); // get length


first store the text box value into a variable. then simply using the .length method you can get the string length.


Get custom programming done at GetAFreelancer.com!

Wednesday, June 4, 2008

How to select a random row from mysql table

Are you looking a way to get a random record from a mysql table?, want to do it by single and a simple query? if the answer is yes, here it is


SELECT * FROM table_name ORDER BY RAND() LIMIT 0,1



You can use mysql rand() function to easily get a random data row.
but be warned that for large data tables this function is said to be slow.

If you like to learn more about SLIIT please visit www.sliit.lk

 Subscribe To My Blog

Tuesday, June 3, 2008

How to get a random number in PHP

Looking a way to generate a random number using a PHP function.
Here how it's done, pretty easy to get a random number



<?php

echo rand();

?>



to see more options in rand() function visit www.php.net/rand


Get custom programming done at GetAFreelancer.com!

Saturday, May 24, 2008

Marquee that slows/pause on mouse over - Simple image filmstrip/scroller

Lets see how we can create a simple image filmstrip or scroller using HTML Marquee tags.


<marquee onMouseover="this.scrollAmount=1" onMouseout="this.scrollAmount=4">
Scrolling text here. Scrolling text/images goes here
</marquee>


If you want to retrieve images dynamically using PHP here is the logic,



<marquee onMouseover="this.scrollAmount=3" onMouseout="this.scrollAmount=6">
<?php
//database connection
//retrive image names from database
//get full image path
?>
<img src="<?php echo $image_path; ?>" />
</marquee>




Subscribe To My Blog

Monday, May 12, 2008

Why Use Other When You Have Free Aptana Studio - Must For a Web Developer

Aptana Studio is one of the best free IDE around for writing AJAX code.
Aptana IDE has addon support for PHP, Ruby on Rails, Apple iPhone and Adobe® AIR™.
simply fantastic, Aptana has a very good support for Javascript programming with really powerful intellisense. I personally use Aptana studio with the php addon for my web development work.

Aptana.com


Get custom programming done at GetAFreelancer.com!

Wednesday, April 30, 2008

PHP - Learn Your HTML Table Skills

PHP is done with lot of html
All page layouts base on tables.
So be sure to master HTML table tags properly.
One small missing tag will result in a bad mess.



<table>
<tr>
<td>
write something
</td>
</tr>
</table>




If you like to learn more about SLIIT please visit www.sliit.lk

 Subscribe To My Blog

Sunday, April 27, 2008

How To Post Code Samples In Blogspot (Blogger) - Blog Posts

Need to write a code sample in your blog post?
Tried it and got a error?
It's simple than you think, you only need to encode your script, you can freely encode your code sample here put the code in the 'Input' and you will get the encoded code, just copy and paste it into your blog post.

example:


<php
echo 'Hello Blogpost';
?>



That's how you insert code examples into your blogger blog post :)

If you like to learn more about SLIIT please visit www.sliit.lk

 Subscribe To My Blog

Wednesday, April 2, 2008

SLIIT Together 2008 - Well... I'm Sad

I didn't come for the SLIIT Together 2008 bcos I had a funeral to attend.
first I was sad that I was not there but now I'm happy that I never came
Whats wrong with you people fighting like animals????
yako kawanam biuwanma athal aran gedara palyan anith unta pau denne nathuwa

If you like to learn more about SLIIT please visit www.sliit.lk

 Subscribe To My Blog