Thursday, March 12, 2009

Radio Object Javascript

This example loops through a group of radio buttons all sharing the same
name, and returns the index number of the one that's checked:



<form name="test">

<input type="radio" name="myradio" />

<input type="radio" name="myradio" checked />


<input type="radio" name="myradio" />

</form>



<script type="text/javascript">

//a variable that will hold the index number of the selected radio button

for (i=0;i<document.test.myradio.length;i++){


if (document.test.myradio[i].checked==true)

theone=i

}

</script>

Wednesday, March 11, 2009

URL Validation In Javascript

function isUrl(url)
{
var RegexUrl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
return RegexUrl.test(url);
}

Monday, March 9, 2009

Decimal Point Of the Number

function formatmoney($Value)
{


$Result = split("[.]", $Value);
$Temp = substr($Result[1],0,2);
$Temp1 = str_pad($Temp,2,"0",STR_PAD_RIGHT);
$FinalResult = $Result[0] .'.'.$Temp1;
return $formatted = number_format($FinalResult, 2);
}

Saturday, March 7, 2009

What is PHP?


  • PHP, is Known as PHP: Hypertext Processor.
  • It is a server-side scripting language Means scripts are executed on the server. Means no one can steal your code.
  • It supports many databases like MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, Generic ODBC, etc.)
  • PHP is an open source software so it is free to download and use.
  • Used to create dynamic Web pages.
Basic Syntax:
  • file extension is ".php", ".php3", or ".phtml".
  • PHP Code is Written Between



or you can use another way



  • For Comments in PHP U can Following Syntax.
  • // This comment is used for single line
    /* This is a multi-line
    comment
    */