Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Monday, December 17, 2007

Create Your Own Hit Counter

<%
Application.Lock
Application("Count") = Application("Count") + 1
Application.Unlock
x=application("Count")
%>

<%=x%>

Search Engine Script

<html>

<title>CodeAve.com(JavaScript: Search Many Sites)</title>

<body bgcolor="#FFFFFF">



<script language="JavaScript">

<!--

function search_site()

{

// Build the destination url by placing the selection option first

var url =
document.search_form.site.options[document.search_form.site.selectedIndex].value


// Append the text box input to the search url for the selected site

url = url + document.search_form.u_search.value;

// Change the the browser location to the new url

window.location.href = url;

}

-->

</script>



<center>



<form name="search_form">

<input tpye="text" name="u_search">

<select name="site" size="1">

<option value="http://search.yahoo.com/bin/search?p=">Yahoo</option>

<option value="http://www.go.com/Titles?qt=">Go.com</option>

<option value="http://www.goto.com/d/search/?Keywords=">GoTo.com</option>

<option value="http://search.excite.com/search.gw?search=">Excite</option>

<option value="http://www.lycos.com/srch/?query=">Lycos</option>

<option value="http://hotbot.lycos.com/?MT=">HotBot</option>

<option value="http://www.altavista.com/cgi-bin/query?&q=">Alta Vista</option>

<option value="http://www.webcrawler.com/cgi-bin/WebQuery?searchText=">WebCrawler</option>

<option value="http://www.mamma.com/Mamma?&query=">Mamma.com</option>

<option value="http://search.aol.com/dirsearch.adp?query=">AOL.com</option>

<option value="http://search.msn.com/results.asp?q=">MSN.com</option>

</select>

<input type="button" value="Search" onClick="JavaScript:search_site()">

</form>



</center>

</body>

</html>

 



http://codeprogrammer.blogspot.com

Formatting Numbers : Currency

The function you need to format currency is FormatCurrency. It is very easy to use and has been outlined and explained below:

FormatCurrency(NumToBeFormatted[, NumOfDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers])
- returns a formatted currency from the number specified with the appropriate number of digits specified after the decimal
- the first parameter is the only one that is required, although I recommend that you use at least include the second parameter.
- the last two parentheses are tristate values which means you need to specify a -1 for true, 0 for false, or -2 to use the computers regional settings.
- the IncludeLeadingDigit parameter is used to specify whether or not you want a leading zero to be displayed when the number is a fractional value.
- the UseParensForNegativeNumbers parameter is pretty self explanatory, if set to true it will put parentheses around negative numbers.
- this function also adds a '$' sign at the beginning of the output for you.

Example:

var1 = 5443.354
var2 = -877743.2345
Response.Write("var1 formatted = " & FormatCurrency(var1, 2, -1, -1) & "
")
Response.Write("var2 formatted = " & FormatCurrency(var2, 1, -1, -1))

Result:

var1 formatted = $5,443.35
var2 formatted = ($877,743.2)

http://yudhisuhendro.blogspot.com