Posts Tagged ‘load’

Display an Alert Message on Web Page Load

Monday, July 14th, 2008

If you would like an alert box to display when your page loads, place the following code within the HTML of your web page between your <HEAD> and </HEAD> tags.

<script language=”Javascript”>
<!–
alert (”Alert Message”)
//–>
</script>

Change the text indicated in red to the message you would like to display.

Although you can use the above HTML code to display an alert box when your web page loads, please use it cautiously, as you don’t want to irritate your visitors.

PHP:safe_dl — Safely Load a PHP extension at runtime

Monday, June 30th, 2008

<?php
$extension = “php_domxml”;
var_dump(safe_dl($extension));
/**
* Loads extension safely
*
* Checks whether the extension is already loaded, if so does not try to reload it.
* Depending ot current OS it will try to load “.dll” or “.so” file.
* Some checks are made for GD library.
*
* @param    string    extension the extension that will be loaded
* @author RAJI <raji.peaceful@gmail.com>
* @author RAJI
*/
function safe_dl($extension)
{
$res = 0;
$extension = strtolower(trim($extension));
// if these is an extension supplied remove it
if (($posit = strpos($extension, “.”)) !== false)
$extension = substr($extension, 0, $posit);
// special check for gd1 & gd2
if ($extension == ‘gd’ || $extension == ‘gd2′ )
{
$ar = @gd_info();
if (is_array($ar)
&& !empty($ar["GD Version"])
&& (
// gd1
( ($extension == ‘gd’ && strpos($ar["GD Version"], “1.”) !== false)
||
// gd2
$extension == ‘gd2′&& strpos($ar["GD Version"], “2.”) !== false)
)
)
return true;
else
return false;
}
// if already loading return true
if (!empty($extension)
&& extension_loaded($extension))
return true;
// if not extension not loaded try to load it
if ( !empty($extension) &&
!extension_loaded($extension) &&
( @ini_get(”enable_dl”) == 1 ||
strtolower(@ini_get(”enable_dl”) ) == “on”)
)
{
// depending on OS load appopriate extension
$res = @dl($extension . “.”
. (strpos(strtolower(PHP_OS), “win”) !== false
? ‘dll’
: ’so’));
}
return $res
? true
: false;
}
?>

PHP:Random Loading

Saturday, June 28th, 2008

You can load random stuff by using this code. For this example, I load random color code:
$selectnumber = rand (1, 5);
if($selectnumber==1) $pagebg=”#990000″;
if($selectnumber==2) $pagebg=”#0000FF”;
if($selectnumber==3) $pagebg=”#00AAAA”;
if($selectnumber==4) $pagebg=”#000099″;
if($selectnumber==5) $pagebg=”#DDDD00″;

Basic Seo Tips for Web Designer

Monday, June 23rd, 2008

After designing a layout for a web site, we obviously start converting it into HTML during this session as a web designer we mainly concentrate on cross browser compatibility but we also need to concentrate on some basic seo things like…

1. Using Correct Doctype.

2. Using Meta Content and Meta Keywords.

3. Using Alt tags for Images.

4. Using Valid HTML and CSS code.

5. Make your web site load fast.

1. Why to Use Doctype and what does correct doctype means?

Document type defination(DTD) is also know as Doctype, doctype informs the browser how to interpret the content of the page. If the the doctype is not declared, the browser assumes you don’t know how to code, and goes into quirks mode. If you know what you are doing and include a correct HTML doctype, your page will be rendered in standards mode.

Some Recommended DTDs to use in your Web document.

Use correct doctype, for example your using strict doctype and you use used align in in div tag or in p tag then doctype you used is not correct because align attribute is deprecated in strict doctype.

2. Using Meta Content and Meta Keywords.

Use proper keywords and content relate to your web site, that helps search engine to crawl your web site.

3. Using Alt tags for Images.

Specify alt tag for image and that alt tag should be a keyword related to web site, because images you have placed on site can be seen by visitors but not by search engines, so alt tag help search engines to read, with the help of alt tags search engines display the image results.

4. Using Valid HTML and CSS code.

Validate your html and css code and make your code w3c standard.

validate your html code here

http://validator.w3.org

validate your css code here

http://jigsaw.w3.org/css-validator

5. Make your web site load fast.

Don’t mess up your site with heavy images that makes your site heavy and slow, try to optimize images that reduces weight and helps to load fast.