Friday 29 July 2011

check database for array of values.

example:UPDATE tableName SET someColumn = "updated" WHERE id IN(1, 88, 99, 152)

so it can be done by



for($i = 0; $i < count($arrayOfIDs) $i++)
{
if($i == 0)
$concatenatedIDs .= $arrayOfIDs[$i];
else
$concatenatedIDs .= ',' . $arrayOfIDs[$i];
}

$query = 'UPDATE tableName SET someColumn = "updated" WHERE id IN(' . $concatenatedIDs . ')';


Tuesday 26 July 2011

stop web pages from refreshing or disable menu bar and status bar and tool bar in browser and disable right click

hello frnds
basically refreshing is depend on browser
so one cant say that, that code stop browsers from refreshing

here is the code

/////////////////////first file


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">

function getWin(url,winName,w,h,top,left){
//you can change the status of these variables by punting yes
var newWin = window.open(url,winName,'menubar=no,statusbar=no,location=no,directories=no,width='+w+',height='+h+ ',top='+((screen.height-h)/5)+',left='+((screen.width-w)/2.1));
newWin.focus();
}

</script>
</head>

<body>
<a href="javascript:getWin('stoprefresh.php','win1','500','350','top','left');void(0);">Open</a>

</body>
</html>




////////////////////////////////////stoprefresh.php


<script type="text/javascript">
function showKeyCode(e)
{
/*alert("Inside function showKeyCode(e)");
*/var keycode =(window.event) ? event.keyCode : e.keyCode;

if(keycode == 116)
{
event.keyCode = 0;
event.returnValue = false;
return false;
window.document.statusbar.enable = false;
}
}
</script>

With Body section

<body  onKeyDown ="showKeyCode();" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
</body>



this is the whole code
which run exactly on CROME
and IE


Friday 22 July 2011

increasing date or how to get next date to current date or date in loop

for applying date in a loop
you have to increasing date according to your condition.
so there is a way

       $date = date ("Y-m-d", strtotime ("+1 day", strtotime($date)));

difference b/w html and html5


HTML5 has several goals which differentiate it from HTML4.
The primary one is consistent, defined error handling. As you know, HTML purposely supports 'tag soup', or the ability to write malformed code and have it corrected into a valid document. The problem is that the rules for doing this aren't written down anywhere. When a new browser vendor wants to enter the market, they just have to test malformed documents in various browsers (especially IE) and reverse-engineer their error handling. If they don't, then many pages won't display correctly (estimates place roughly 90% of pages on the net as being at least somewhat malformed).
So, HTML5 is attempting to discover and codify this error handling, so that browser developers can all standardize and greatly reduce the time and money required to display things consistently. As well, long in the future after HTML has died as a document format, historians may still want to read our documents, and having a completely defined parsing algorithm will greatly aid this.
The secondary goal of HTML5 is to develop the ability of the browser to be an application platform, via HTML, CSS, and Javascript. Many elements have been added directly to the language that are currently (in HTML4) Flash or JS-based hacks, such as <canvas>, <video>, and <audio>. Useful things such as Local Storage (a js-accessible browser-builtin sql database, for storing information beyond what cookies can hold), new input types such as date for which the browser can expose easy user interface (so that we don't have to use our js-based calendar date-pickers), and browser-supported form validation will make developing web applications much simpler for the developers, and make them much faster for the users (since many things will be supported natively, rather than hacked in via javascript).
There are many other smaller efforts taking place in HTML5, such as better-defined semantic roles for existing elements (<strong> and <em> now actually mean something different, and even <b> and <i> have vague semantics that should work well when parsing legacy documents) and adding new elements with useful semantics - <article>, <section>, <header>, <aside>, and <nav> should replace the majority of <div>s used on a web page, making your pages a bit more semantic, but more importantly, easier to read. No more painful scanning to see just what that random </div> is closing - instead you'll have an obvious </header>, or </article>, making the structure of your document much more intuitive.