3/31/2010

Show a messagebox By javascript

If you want to give a message to User thesn Simply right a javascript.Basically most of the websites uses this messagebox to show any kind of error or message to the User

To Show this Message simply write a script in header Section of your Html
I have Used this message to show when somebody clicks on a buton


This is the code you need to write in header section of your html

<script type="text\javascript">
function message(){
     alert("Type your message here");
}
</script>


Write this code into your body part

<input type="button" onclick="message();" value="click me" />

3/26/2010

CSS Hacks for Internet Explorer 8

Like IE6 and IE7,IE8 also needs some hacks .Let the css is something like given below

.style1{ width:320px;}

If this css will not show perfect only in IE8 then we need to write

.style1{ width:320px;width:300px\9;}

Using ( \9 ) sign indicates that this css will render by only in IE8 Browser not any browser will understand it's meaning.

3/20/2010

CSS Hacks for Internet Explorer 7

Like IE6 ,IE7 also needs some hacks some times.For that we need to write the css something like given below

.style1{ padding:10px 0 0 20px;}

If this css will have any problems in IE7 then we need to write the css like

.style1{ padding:10px 0 0 20px; !padding:10px 0 0 18px;}

Using ( ! ) sign indicates that this css will render by both IE7 and IE6 not in other browser.

CSS Hacks for Internet Explorer 6

Css Hacks is the most important things for all the designer,if they want to show a page perfect in every browser. Basically all browser show perfect design,But all IE Browser have some problems to show the actual view for that it needs to give some css hacks

Css hacks For IE6

when we give the width of a block level element by css maybe that width increase in IE6 or when we give padding or margin of an Element Ie6 may show some more Padding or margin.That time it needs to write the _padding or _margin and decrease the padding or margin or width;By writing _width or _padding will effect only in IE6 browser not in other browser. For Example

.style1{ width:500px;}

If this width will not show in IE6 perfectly then we need to write this class like

.style1{ width:500px;_width:490px;}

Ie6 will render the 2nd width but all browser will render the first width

3/14/2010

Show or hide an image by javascript

It is very easy to hide or show an image according to client's click.
simply call a js function in onclick event handler for example:-


Write this script into your header Tag


Write these code in to your body tag

3/05/2010

File Uploading by php

Uploading Files to server is not so hard it's very simple.
$dir="images/";  // Give your server path where to upload
$uploaddir=$dir.basename($_FILES['f1']['name']); // to Give a new file name
if(move_uploaded_file($_FILES['f1']['tmp_name'],$uploaddir))
    {
    }