Any IE Compitiblity Modes..

Today I faced problem with IE 7 and i really does not have IE7 on my PC but i can inject IE7 on installed any version of IE which is really good.

Here you perfect sentence,just integrate on header part of page..that’s it..Your IE behavior like which you inject IE..

Now, i can work with any IE with putting extra line..

Posted in Browsers, Categories, Internet Explorer | Comments Off on Any IE Compitiblity Modes..

Migrating from PHP 5.2 to 5.3

Now PHP 5.2 has no longer support split and ereg function. Most of programmers are using these two functions .They should have go to each and every self-made function where these deprecated functions are used and replace them…

Notes: Don’t forget to enable error reporting…error_reporting(E_ALL & ~E_NOTICE)

List of updates :–

1. Do not use session_register(), session_is_registered() and session_unregister().you must have to replace with $_SESSION.

For example :- session_register($sValue) –>$_session[$sValue]

2. Replace Long array name with short name.

For example:-$HTTP_GET_VARS = $_GET

$HTTP_POST_VARS=$_POST

$HTTP_SERVER_VARS=$_SERVER etc……

3.  Assigning the return value of new by reference is deprecated” error

$this->metatags = & new products(…parameters…), $this); // <<— WRONG
$this->metatags = new products(…parameters…), $this); // <<— RIGHT

List of deprecated function in PHP.

http://us.php.net/manual/en/reference.pcre.pattern.posix.php

List of POSIX to PCRE regex conversions and their equivalent functions in 5.3 .Most of global function and INI configuration.

http://us.php.net/manual/en/reference.pcre.pattern.posix.php

Hopefully you will get off 5.2 version of PHP.

Posted in Categories, PHP | Comments Off on Migrating from PHP 5.2 to 5.3

Rounded Corner in CSS3

The CSS3 border-radius property allows web developers to easily utilise rounder corners in their design elements, without the need for corner images or the use of multiple div tags, and is perhaps one of the most talked about aspects of CSS3.


border-top-left-radius: 10px;

border-top-right-radius: 10px;

border-bottom-left-radius:10px;

border-bottom-right-radius: 10px;


Declarations in Mozilla:

-moz-border-radius: 10px;   /*Produces Fully Rounded Effect*/
-moz-border-radius-topleft:10px;    /*Top Left Corner Rounded*/
-moz-border-radius-topright:10px;   /*Top Right Corner Rounded*/
-moz-border-radius-bottomleft:10px;   /*Bottom Left Corner Rounded*/
-moz-border-radius-bottomright:10px;   /*Bottom right Corner Rounded*/
Declarations in Safari:
-webkit-border-radius: 10px;  /*Produces fully rounded effect*/
-webkit-border-top-left-radius:10px;  /*Top Left Corner Rounded*/
-webkit-border-top-right-radius:10px;  /*Top Right Corner Rounded*/
-webkit-border-bottom-left-radius:10px;;  /*Bottom Left Corner Rounded*/
-webkit-border-bottom-right-radius:10px;  /*Bottom Right Corner Rounded*/

Another solution:—You can as well try the FlexiPanels CSS – a Dreamweaver extension that generated rounded corner Css boxes without coding. It’s not CSS3, but works on most browsers, including IE6.

But I personally prefer css3 code without extend my dreamweaver…

Posted in Categories, CSS3 | Comments Off on Rounded Corner in CSS3

Difference between shadow effect in css2 to css3

Creating shadow in css2 is little beat tuff.we do not have stright attribute to make shadow and make our life easier in css2.Instead of  we have to do .png image along with one special div defined before any other content/divs on your webpage.

New Attribute in CSS3 is box-shadow which allows nice shadow effect.

Mozilla Firefox 3.1 Beta (Not Mozilla Firefox 3) and Safari 3 + will display the shadow effect that the box-shadow displays but If you using Internet Explorer then your screwed.

Css3 Example


.Content {
width:300px;
background:#eeeeee;
color:#444;
border:1px solid #DEDEDE;
-moz-box-shadow: 15px 15px 0px #999;
padding: 5px 20px 5px 20px;
-webkit-box-shadow: 15px 15px 0px #999;
}

Css3 Menu,http://css3menu.com/ along with css3 rounded corners and gradients.

Posted in Categories, CSS3 | 1 Comment

PNG images in IE

As you know IE has lots of issues related to CSS and now I got one more problem related to transparent image[png].Some reason,I could not able to see my png images on IE,Its display onle black image instead of colorful images.After I searched a lot and found that IE has problem with PNG images.

After nightmare work,IE published one script to support transparent png images.we just interegrate this code in our webpage.

<!–[if lte IE6]>
<style>.png {behaviour:url(‘css/htc/iepngfix.htc’)}</style>
<link type=”text/css” media=”all” href=”css/coreie6.css” ref=”stylesheet”>
<![endif]–>

<!–[if  IE 7]>
<link type=”text/css” media=”all” href=”css/coreie7.css” ref=”stylesheet”>
<![endif]–>

And you can get supported .htc file from this link http://www.twinhelix.com/css/iepngfix/

Posted in Browsers, Categories, Internet Explorer | Comments Off on PNG images in IE

CDATA in XML

Now time to learn some XML features.I have been using CDATA in my XML files.CDATA section is not allow to parse XML text by parser.Normally XML Parser parse all text in XML document but CDATA section provide some advance feature to ignore XML parsing.

<People>

<person id=”1″>

<Name>Ankita</Name>

<text><![CDATA[ <p>You can check XML advance future using<br />example.</p> ]]></text>

</person>

</People>

That is useful on XML metadata and passing any description with HTML elements…..

Posted in Categories, XML | 1 Comment

Flash embedding without Javascript

Today I came on Flash integration in my web page and I have found one interesting method called “Twice-Cooked Method” which support flash integration without JavaScript.I try to avoid

JavaScript embedding of Flash (especially the Adobe version supplied in Dream weaver, it’s exhaustive code)

<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″ width=”500″ height=”560″>

<param name=”movie” value=”swf/test.swf” />

<!–[if !IE]>–>

<object type=”application/x-shockwave-flash” data=”swf/test.swf” width=”500″ height=”560″>

<!–<![endif]–>

<p>You do not have Flash!</p>

<!–[if !IE]>–>

</object>

<!–<![endif]–>

</object>

http://www.alistapart.com/articles/flashsatay

Cheer..::))

Posted in Categories, Flash | 1 Comment

PHP Filter for santizing and validating user input.

A PHP filter is used to validate and filter data coming from insecure sources.By using filters you can be sure your application gets the correct input type.

*  filter_var() – Filters a single variable with a specified filter

* filter_var_array() – Filter several variables with the same or different filters

* filter_input – Get one input variable and filter it

* filter_input_array – Get several input variables and filter them with the same or different filters

These filter useful for  Validating filters(used to validate user input) and  Sanitizing filters(used to allow or disallow specified characters in a string)

http://www.w3schools.com/php/php_filter.asp

http://www.php.net/manual/en/ref.filter.php

Remove all fashion functions to santize and validate user input.

Posted in Categories, PHP | 7 Comments

Crossbrowser CSS dropshadows and Blur effects

In past,I had problem with blur effect so I added mootool in my website and some css3 property which was not working in IE. but now I can use CSS filter without any JavaScript.

First of all, the blur filter allows you to blur elements in IE

<div style=’background:blue;height:100px;width:100px;

filter:progid:DXImageTransform.Microsoft.Blur(pixelradius=5);

-ms-filter:”progid:DXImageTransform.Microsoft.Blur(pixelradius=5)”;’>

</div>

Moreover,you can Create the drop shadow and Inner shadow in IE which is very nice..

.black-shadow {

-moz-box-shadow: 4px 4px 8px #000;

-webkit-box-shadow: 4px 4px 8px #000;

box-shadow: 4px 4px 8px #000;

filter: progid:DXImageTransform.Microsoft.Shadow (color=#000000,direction=90,strength=8)

progid:DXImageTransform.Microsoft.Shadow (color=#000000,direction=180,strength=8)

}

http://dev.opera.com/articles/view/cross-browser-box-shadows/

http://samples.msdn.microsoft.com/workshop/samples/author/filter/blur.htm

Posted in Categories, CSS3 | 3 Comments

Prevent XSS[Cross-Site Scripting] Attacks

Cross site scripting (also known as XSS) occurs when a web application gathers malicious data from a user.

Often attackers will inject JavaScript, VBScript, ActiveX, HTML, or Flash into a vulnerable application to fool a user (Read below for further details) in order to gather data from them

Persistent Attack Example

<script>document.location=’http://www.google.com/'</script>

Non-Persistent Attack Example

http://portal.example/index.php?sessionid=12312312&username=<script>document.location=’http://google.com'</script>

DOM-based Attack Example

http://www.vulnerable.site/welcome.html?name=<script>alert(document.cookie)</script>

XSS is different from, but similar in spirit to SQL injection. SQL injection is where SQL commands are not cleaned from inputs and thus able to do malicious things to a database. Using HTTPS cannot help with either XSS or SQL injection. HTTPS only protects data in transit over networks.

Best way to solve XSS is filter your input variable.For SQL injection,you should use mysql_real_escape_string to prevent sql injection.

Using apache htaccess XSS Protection,sounds like scary but once it done,you would not worry about any code…

Just add these to your .htaccess file and modify to suitable…

# redirect from non www. domain to www. to prevent duplicate listings for SEO

RewriteEngine On

RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]

RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

# Anti XSS protection

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]

RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]

RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})

RewriteRule ^(.*)$ index_error.php [F,L]

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)

RewriteRule .* – [F]

# Anti cross site tracing – protection

RewriteEngine On

RewriteCond %{REQUEST_METHOD} ^TRACE

RewriteRule .* – [F]

# prevent image theft / hotlinking

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?yoursite.com.com/.*$ [NC]

RewriteCond %{HTTP_USER_AGENT} !(googlebot-image|msnbot|psbot|yahoo-mmcrawler|cavalla_bot) [NC]

RewriteRule \.(gif|jpg)$ – [F]

Posted in Categories, XSS | 5 Comments