<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Freelance Web Developers &#187; Web Applications</title>
	<atom:link href="http://www.myowndeveloper.com/category/web-apps/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.myowndeveloper.com</link>
	<description>The best Filipino freelance web development provider</description>
	<lastBuildDate>Tue, 26 Jan 2010 07:08:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>45+ New jQuery Techniques For Good User Experience</title>
		<link>http://www.myowndeveloper.com/2009/10/03/45-new-jquery-techniques-for-good-user-experience/</link>
		<comments>http://www.myowndeveloper.com/2009/10/03/45-new-jquery-techniques-for-good-user-experience/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 05:00:45 +0000</pubDate>
		<dc:creator>Yevonsouls</dc:creator>
				<category><![CDATA[News and Updates]]></category>
		<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[sem]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.myowndeveloper.com/?p=183</guid>
		<description><![CDATA[
			
				
			
		
JavaScipt libraries have made huge leaps and bounds in helping developers write code and develop products more quickly. jQuery is one of the most popular JavaScript frameworks, with powerful tools that improve the user’s interaction with Web applications. jQuery has an additional advantage in that it allows developers to select elements on a page using [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;source=myowndev&amp;style=normal&amp;service_api=http%3A%2F%2Fwww.myowndeveloper.com%2Fblog" height="61" width="50" /><br />
			</a>
		</div>
<p>JavaScipt libraries have made huge leaps and bounds in helping developers write code and develop products more quickly. <strong>jQuery</strong> is one of the most popular JavaScript frameworks, with powerful tools that improve the user’s interaction with Web applications. jQuery has an additional advantage in that it allows developers to select elements on a page using CSS-like syntax.</p>
<p>To help you take it up a notch, we share below some methods that can help you give visitors to your website an amazing user experience. Here are <strong>over 45 impressive jQuery plug-ins and techniques</strong> that have been recently created and that could make the development of your next website an easier and more interesting experience than the last.</p>
<p>You may want to take a look at the following related posts:</p>
<ul>
<li><a href="http://www.smashingmagazine.com/2008/09/16/jquery-examples-and-best-practices/">jQuery and JavaScript Coding: Examples and Best Practices</a></li>
<li><a href="http://www.smashingmagazine.com/2008/09/11/75-really-useful-javascript-techniques/">75 (Really) Useful JavaScript Techniques</a></li>
<li><a href="http://www.smashingmagazine.com/2007/06/20/ajax-javascript-solutions-for-professional-coding/">80+ AJAX-Solutions For Professional Coding</a></li>
<li><a href="http://www.smashingmagazine.com/2008/04/15/60-more-ajax-and-javascript-solutions-for-professional-coding/">60 More AJAX- and Javascript Solutions For Professional Coding</a></li>
</ul>
<p><span id="more-183"></span></p>
<h3>Dynamic Content</h3>
<p><a href="http://nettuts.com/javascript-ajax/build-a-top-panel-with-jquery/">1. Build A Login Form With jQuery</a><br />
In this tutorial, we’ll create a sliding panel, that slides in to reveal more content, using JQuery to animate the height of the panel. In this case, we will be creating a hypothetical login for the new tutsplus area that’s coming soon.</p>
<p><a href="http://nettuts.com/javascript-ajax/build-a-top-panel-with-jquery/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery08.gif" alt="jQuery" width="500" height="252" /></a></p>
<p><a href="http://css-tricks.com/examples/SpoilerRevealer/">2. Spoiler Revealer with jQuery</a><br />
A simple technique that hides some content first and fades it in once a link is clicked.</p>
<p><a href="http://css-tricks.com/examples/SpoilerRevealer/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/spoiler.gif" alt="jQuery" width="500" height="181" /></a></p>
<p><a href="http://valums.com/projects/ajax-upload/">3. AJAX Upload</a><br />
This AJAX file upload plug-in allows users to easily upload multiple files without having to refresh the page. In addition, you can use any element to trigger the file selection window. The plug-in creates a semi-transparent file input screen over the button you specify, so when a user clicks on the button, the normal file selection window is shown. After the user selects a file, the plug-in submits the form that contains the file input to an iFrame. So it isn’t true AJAX but provides the same user experience.</p>
<p><a href="http://valums.com/s/p/ajax-upload/demo.htm"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery05.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.emposha.com/javascript/jquery/jquerymultiselect.html">4. FCBKcomplete</a><br />
Give your users fancy Facebook-like dynamic inputs, with auto-complete and pre-added values.</p>
<p><a href="http://www.emposha.com/javascript/jquery/jquerymultiselect.html"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery06.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.filamentgroup.com/lab/creating_accessible_charts_using_canvas_and_jquery">5. Create Accessible Charts Using Canvas and jQuery</a><br />
This tool is proof that you can use the &lt;canvas&gt; element to illustrate HTML table data. The idea is a good one: putting the data in a table allows it to remain accessible, while the chart can be shown for visual enhancement.</p>
<p><a href="http://www.filamentgroup.com/lab/creating_accessible_charts_using_canvas_and_jquery"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery08.jpg" alt="jQuery" /></a></p>
<h3>Form Manipulation</h3>
<p><a href="http://www.protofunc.com/scripts/jquery/checkbox-radiobutton/">6. Radio Button and Check Box Replacement</a><br />
This jQuery tool replaces radio buttons and check boxes with a more appealing display.</p>
<p><a href="http://www.protofunc.com/scripts/jquery/checkbox-radiobutton/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery07.jpg" alt="jQuery" /></a></p>
<p><a href="http://nettuts.com/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/">7. Submit a Form without a Page Refresh</a></p>
<p><a href="http://nettuts.com/demos/contactform/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery28.jpg" alt="jQuery" /></a></p>
<p><a href="http://midmodesign.com/news/coding/jquery-ajax-contact-form-with-honeypot/">8. jQuery AJAX Contact Form</a><br />
Here is a quick and easy way to make a jQuery AJAX contact form with a “honeypot” to foil email bots, load success and error messages dynamically without leaving the page and provide descriptive error messages detailing why submitted values have failed validation.</p>
<p><a href="http://midmodesign.com/downloads/ajaxcontactformv1/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery29.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.willjessup.com/sandbox/jquery/form_validator/form_validate.html">9. Simple jQuery Form Validation</a><br />
This jQuery form shows live form-input validators both server-side and browser-side.</p>
<p><a href="http://www.willjessup.com/sandbox/jquery/form_validator/form_validate.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery33.jpg" alt="jQuery" /></a></p>
<h3>Navigation Menus</h3>
<p><a href="http://abeautifulsite.net/notebook/80">10. jQuery Context Menu</a><br />
A context menu plug-in for jQuery that features easy implementation, keyboard shortcuts, CSS styling and control methods.</p>
<p><a href="http://abeautifulsite.net/notebook_files/80/demo/jqueryContextMenu.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery21.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.jeremymartin.name/projects.php?project=kwicks">11. Kwicks for jQuery</a><br />
Kwicks for jQuery started off as a port of the incredibly attractive MooTools framework, but has evolved into a highly customizable and versatile widget.</p>
<p><a href="http://www.jeremymartin.name/examples/kwicks.php?example=1"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery15.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu">12. jQuery iPod-style Drilldown Menu</a><br />
“We created an iPod-style drilldown menu to help users traverse hierarchical data quickly and with control. It’s especially helpful when organizing large data structures that don’t translate well into traditional dropdown or fly-out menus.”</p>
<p><a href="http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery41.jpg" alt="jQuery" /></a></p>
<p><a href="http://abeautifulsite.net/notebook.php?article=58">13. jQuery File Tree</a><br />
The jQuery File Tree is a configurable AJAX file-browser plug-in for jQuery. You can create a customized, fully-interactive file tree with as little as one line of JavaScript code.</p>
<p><a href="http://abeautifulsite.net/notebook_files/58/demo/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery16.jpg" alt="jQuery" /></a></p>
<p><a href="http://nettuts.com/html-css-techniques/how-to-create-a-mootools-homepage-inspired-navigation-effect-using-jquery/">14. How to Create a MooTools Home Page-Inspired Navigation Effect</a><br />
In this tutorial, you’ll recreate the same effect seen in MooTools’s menu, but in jQuery!</p>
<p><a href="http://nettuts.s3.amazonaws.com/004_Moo/tutorial/demo/demo.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery17.jpg" alt="jQuery" /></a></p>
<p><a href="http://alistapart.com/articles/sprites2">15. CSS Sprites2</a><br />
This tutorial demonstrates how to implement inline CSS Sprites2 using jQuery.</p>
<p><a href="http://alistapart.com/d/sprites2/examples/example6-function.html"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery19.jpg" alt="jQuery" /></a></p>
<h3>Manipulating Content</h3>
<p><a href="http://nettuts.com/tutorials/javascript-ajax/create-an-amazoncom-books-widget-with-jquery-and-xml/">16. jQuery books widget</a><br />
With some custom JavaScript and jQuery magic you can create some interesting widgets. A good way to demonstrate this functionality is by building a browsable Amazon.com books widget.</p>
<p><a href="http://nettuts.com/tutorials/javascript-ajax/create-an-amazoncom-books-widget-with-jquery-and-xml/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery07.gif" alt="jQuery" width="500" height="252" /></a></p>
<p><a href="http://nettuts.com/tutorials/javascript-ajax/use-the-jquery-ui-to-control-the-size-of-your-text/">17. Text Size Slider</a><br />
This tutorial explains how to use a slider to control the text size of an article on a page. This lets the user control exactly the size that suits them, and is also a pretty impressive feature to have on a site.</p>
<p><a href="http://nettuts.com/tutorials/javascript-ajax/use-the-jquery-ui-to-control-the-size-of-your-text/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery09.gif" alt="jQuery" width="500" height="252" /></a></p>
<p><a href="http://plugins.jquery.com/project/pagination">18. Pagination</a><br />
Create navigational elements: when you have a large number of items, you can group them into pages and present navigational elements that allow users to move from one page to another.</p>
<p><a href="http://d-scribe.de/webtools/jquery-pagination/demo.htm"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery34.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.ndoherty.com/demos/coda-slider/1.1.1/">19. Coda-Slider</a><br />
As with the last tool, groups items together using navigational elements that allow users to move from one page to another.</p>
<p><a href="http://www.ndoherty.com/demos/coda-slider/1.1.1/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery35.jpg" alt="jQuery" /></a></p>
<p><a href="http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/">20. Creating a Slick Auto-Playing Featured-Content Slider</a><br />
If you love the <a href="http://www.ndoherty.com/demos/coda-slider/">Coda-Slider plug-in</a> for jQuery, then you will find this plug-in very useful for displaying lots of content in a small area. This nice plug-in adds some features not found in the original Coda-Slider, such as slowly cycling through panels, auto-playing different types of custom content. An arrow indicator serves as a visual indication of which panel you are currently viewing.</p>
<p><a href="http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery01.jpg" alt="jQuery" /></a></p>
<ul>
<li>Demo can be found <a href="http://css-tricks.com/examples/FeaturedContentSlider/">here</a>.</li>
<li>Download files <a href="http://css-tricks.com/examples/FeaturedContentSlider.zip">here</a>.</li>
</ul>
<p><a href="http://letmehaveblog.blogspot.com/2007/10/haccordion-simple-horizontal-accordion.html">21. haccordion</a><br />
A simple horizontal accordion plug-in for jQuery.</p>
<p><a href="http://letmehaveblog.blogspot.com/2007/10/haccordion-simple-horizontal-accordion.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery36.jpg" alt="jQuery" /></a></p>
<h3>Tabular Data and Grids</h3>
<p><a href="http://pure-essence.net/stuff/webTips/jqueryTableRowCheckboxToggle.html">22. Table Row Checkbox Toggle</a><br />
This tool generically adds a toggle function to any table row you specify based on a CSS class name. It will, by default, toggle on any check boxes within that table row.</p>
<p><a href="http://pure-essence.net/stuff/webTips/jqueryTableRowCheckboxToggle.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery37.jpg" alt="jQuery" /></a></p>
<p><a href="http://tablesorter.com/docs/">23. Tablesorter</a><br />
Tablesorter is a jQuery plug-in that turns a standard HTML table with &lt;th&gt; and &lt;td&gt; tags into a sortable table without the need for page refreshes. Tablesorter can successfully parse and sort many types of data, including linked data, in a cell.</p>
<p><a href="http://tablesorter.com/docs/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery39.jpg" alt="jQuery" /></a></p>
<p><a href="http://dev.iceburg.net/jquery/tableEditor/demo.php">24. TableEditor</a><br />
TableEditor provides flexible in-place editing of HTML tables. User-defined handler functions can easily be dropped in to update, for example, a data source via an AJAX request.</p>
<p><a href="http://dev.iceburg.net/jquery/tableEditor/demo.php"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery40.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.webtoolkit.info/scrollable-html-table-plugin-for-jquery.html">25. Scrollable HTML Table</a><br />
This JavaScript code can be used to convert ordinary HTML tables into scrollable ones.</p>
<p><a href="http://www.webtoolkit.info/demo/jquery/scrollable/demo.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery38.jpg" alt="jQuery" /></a></p>
<h3>Lightbox Techniques</h3>
<p><a href="http://css-tricks.com/revealing-photo-slider/">26. Revealing Photo Slider</a><br />
Learn how to create a thumbnail photo gallery, where clicking a button reveals the entire photo and more information about that photo.</p>
<p><a href="http://css-tricks.com/revealing-photo-slider/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery04.gif" alt="jQuery" width="378" height="357" /></a></p>
<p><a href="http://fancy.klade.lv/">27. FancyBox</a><br />
FancyBox was born to automatically scale large images to fit in windows, adding a nice drop-shadow under the zoomed item. It can be used to group related items and add navigation between them (using a pre-loading function). FancyBox is totally customizable through settings and CSS.</p>
<p><a href="http://fancy.klade.lv/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery09.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm">28. Facebox Image and Content Viewer </a><br />
Facebox is a lightweight Facebook-style Lightbox that can display images, divs, and even entirely remote pages (via AJAX) inline on a page and on demand. It uses the compact jQuery library as its engine, unlike Lightbox v2.0, which uses Prototype.</p>
<p><a href="http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery22.jpg" alt="jQuery" /></a></p>
<p><a href="http://herr-schuessler.de/blog/jquerypopeye-an-inline-lightbox-alternative/">29. jQuery.popeye</a><br />
jQuery.popeye is a plug-in that transforms an unordered list of images into a simple image gallery. When an image is clicked, it enlarges Lightbox-style. The images are displayed in a box with “Previous” and “Next” controls, and information about the images can be included.</p>
<p><a href="http://dev.herr-schuessler.de/examples/jquery-popeye/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery23.jpg" alt="jQuery" /></a></p>
<h3>Image Galleries and Viewers</h3>
<p><a href="http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm">30. Simple Controls Gallery</a><br />
Simple Controls Gallery rotates and displays each image by fading it into view over the previous one, with navigation controls that pop up when the mouse hovers over the gallery. The controls allow the user to play, pause or jump to a specific image in the gallery.</p>
<p><a href="http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery04.jpg" alt="jQuery" /></a></p>
<p><a href="http://code.google.com/p/agile-carousel/">31. Agile Carousel</a><br />
This jQuery plug-in allows you to easily create a custom carousel. Use the jQuery UI to enable many different types of transition. The plug-in uses PHP to call images from the folder you specify. Configure many different options including controls, slide timer length, easing type, transition type and more!</p>
<p><a href="http://www.5bosses.com/examples/agile_carousel/multi_example/carousel.html"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery10.jpg" alt="jQuery" /></a></p>
<h3>Browser Tweaks</h3>
<p><a href="http://www.filamentgroup.com/lab/setting_equal_heights_with_jquery/">32. Setting Equal Heights with jQuery</a><br />
A script to equalize the heights of boxes within the same container and create a tidy grid.</p>
<p><a href="http://www.filamentgroup.com/examples/equalHeights/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery13.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.emposha.com/javascript/jquery-ie6-png-transperency-fix.html">33. jQuery IE6 PNG Transparency Fix</a><br />
Another IE6 PNG fix that uses jQuery selectors to automatically fix all PNG images on a page.</p>
<p><a href="http://plugins.jquery.com/project/bgiframe">34. BGI frame</a><br />
This tool helps ease the pain of dealing with IE z-index issues. You can find a demo <a href="http://brandonaaron.net/jquery/plugins/bgiframe/test/">here</a>.</p>
<p><a href="http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/">35. Fix Overflow</a><br />
IE puts scroll bars inside overflowing elements, and if an element is only one line, the scroll bar will cover it. This plug-in fixes that issue.</p>
<p><a href="http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery30.jpg" alt="jQuery" /></a></p>
<p><a href="http://plugins.jquery.com/project/lazyload">36. Lazy Load</a><br />
Lazy Load delays the loading of images below the fold on long pages. As the user scrolls down, the images are loaded as needed. Check out the demo <a href="http://www.appelsiini.net/projects/lazyload/enabled.html">here</a>.</p>
<p><a href="http://remysharp.com/2008/06/30/maxlength-plugin/">37. Maxlength</a><br />
It’s a fairly common design practice to limit the number of characters a user can input in a field while giving feedback on how many spaces are left. This plug-in automates that task.</p>
<p><a href="http://remysharp.com/demo/maxlength.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery32.jpg" alt="jQuery" /></a></p>
<h3>Animation Effects</h3>
<p><a href="http://www.flowplayer.org/tools/scrollable.html">38. Scrollable</a><br />
Scrollable is a flexible and lightweight (3.9 KB) jQuery plug-in for creating scrollable content. Scrollable items can contain any HTML, such as text, images, forms, video or any combination of them. You can make items scroll horizontally or vertically and decide how many items are visible at once.</p>
<p><a href="http://www.flowplayer.org/tools/scrollable.html"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery24.jpg" alt="jQuery" /></a></p>
<p><a href="http://css-tricks.com/learning-jquery-fading-menu-replacing-content/">39. jQuery Fading Menu – Replacing Content</a><br />
“Instead of thinking about CSS as page layout and a way to style your page when it loads, you can use in animation and change it on-the-fly to react to events that happen on your page. Take for example a menu. You can take the “click” event that happens when clicking on a menu to do lots of stuff.”</p>
<p><a href="http://css-tricks.com/learning-jquery-fading-menu-replacing-content/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery02.gif" alt="jQuery" width="500" height="149" /></a></p>
<p><a href="http://css-tricks.com/jquery-robot/">40. Build an Animated Cartoon Robot with jQuery</a><br />
This effect simulates a faux 3-D animated background reminiscent of old-school side-scrolling video games (and not unlike the parallax effect). This effect is created by layering several empty divs over each other, with transparent PNGs as background images. The backgrounds are animated at different speeds using jQuery.</p>
<p><a href="http://robot.anthonycalzadilla.com/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery27.jpg" alt="jQuery" /></a></p>
<p><a href="http://lab.smashup.it/flip">41. Flip</a><br />
Flip is a plug-in for jQuery that “flips” page elements in four directions. Compatible with Firefox 2+, Internet Explorer 6+, Safari 3.1 (for Windows) and Google Chrome.</p>
<p><a href="http://lab.smashup.it/flip"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery02.jpg" alt="jQuery" /></a></p>
<ul>
<li>Download files <a href="http://lab.smashup.it/flip/files/jquery.flip-0.4.1.zip">here</a>.</li>
</ul>
<p><a href="http://snook.ca/archives/javascript/jquery-bg-image-animations/">42. Use jQuery for Background Image Animations</a><br />
Animate your menu whenever a user hovers over an item with this effect.</p>
<p><a href="http://snook.ca/technical/jquery-bg/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery18.jpg" alt="jQuery" /></a></p>
<h3>Image Manipulation</h3>
<p><a href="http://deepliquid.com/content/Jcrop.html">43. Jcrop</a><br />
Jcrop is the quick and easy way to add image-cropping functionality to your Web application. It combines the ease of use of a typical jQuery plug-in with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications.</p>
<p><a href="http://deepliquid.com/projects/Jcrop/demos.php"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery11.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.mind-projects.it/projects/jqzoom/">44. jQZoom</a><br />
JQZoom is a JavaScript image magnifier that makes it really easy to magnify what you want. It is easy to customize and works on all modern browsers.</p>
<p><a href="http://www.mind-projects.it/projects/jqzoom/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery25.jpg" alt="jQuery" /></a></p>
<h3>Miscellaneous</h3>
<p><a href="http://www.filamentgroup.com/lab/update_date_range_picker_with_jquery_ui/">45. Date Range Picker</a><br />
A rich date-range widget that uses the jQuery UI’s date picker and some additional custom interaction.</p>
<p><a href="http://www.filamentgroup.com/lab/update_date_range_picker_with_jquery_ui/"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery14.jpg" alt="jQuery" /></a></p>
<p><a href="http://www.shopdev.co.uk/blog/sortable-lists-using-jquery-ui/">46. Sortable Lists</a><br />
Unordered lists are commonly used to structure a website’s navigation. Having the ability to re-order such lists would be extremely useful. Here is a method to easily save and reload the list element order without getting lost as the page is refreshed.</p>
<p><a href="http://www.shopdev.co.uk/blog/sortables.html"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery20.jpg" alt="jQuery" /></a></p>
<p><a href="http://yensdesign.com/2008/12/create-an-amazing-music-player-using-mouse-gestures-hotkeys-in-jquery/">47. Amazing Music Player Using Mouse Gestures and Hotkeys</a><br />
Learn how to create an amazing music player, coded in XHTML and jQuery, that makes use of mouse gestures and hotkeys. You can click and drag the mouse to interact with the music player’s interface or use directional keys and the space bar instead of the mouse.</p>
<p><a href="http://yensdesign.com/tutorials/musicplayer/"><img src="http://media1.smashingmagazine.com/images/jquery-scripts-tutorials/jquery26.jpg" alt="jQuery" /></a></p>
<p><a href="http://iso-100.com/blog/post/updated-script-for-tracking-outbound-links-in-google-analytics-with-jquery/">48. Script for Tracking Outbound Links in Google Analytics with jQuery</a><br />
This code snippet uses Google Analytics and jQuery to automatically track outbound links. This interesting script enhances behavior by comparing the link’s domain to the current page’s domain and, if they are different, triggering the behavior. This is helpful when using a CMS or other tool that generates full URLs, including the “http://,” instead of relative ones.</p>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">view plain</a><a onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">copy to clipboard</a><a onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">print</a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">?</a></div>
</div>
<ol>
<li>&lt;script type=&#8221;text/javascript&#8221;&gt;</li>
<li> $(&#8216;#content a:not(.popupwindow)&#8217;).filter(function() {</li>
<li> var theHref = this;</li>
<li> if (theHref.hostname &amp;&amp; theHref.hostname !== location.hostname) {</li>
<li> $(theHref).not(&#8220;.noAutoIcon&#8221;).addClass(&#8220;offSite&#8221;);</li>
<li> $(theHref).not(&#8220;.noAutoLink&#8221;).attr(&#8216;target&#8217;,'_blank&#8217;).bind(&#8216;click keypress&#8217;, function(event) {</li>
<li> var code=event.charCode || event.keyCode;</li>
<li> if (!code || (code &amp;&amp; code == 13)) {</li>
<li> if(pageTracker){</li>
<li> var fixedLink = this.href;</li>
<li> fixedLink = fixedLink.replace(/https?:\/\/(.*)/,&#8221;$1&#8243;);</li>
<li> fixedLink = &#8217;/outgoing/&#8217;   fixedLink;</li>
<li> pageTracker._trackPageview(fixedLink);</li>
<li> };</li>
<li> };</li>
<li> });</li>
<li> };</li>
<li> });</li>
<li>&lt;/script&gt;</li>
</ol>
</div>
<div>
<div>
<div><a onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">view plain</a><a onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">copy to clipboard</a><a onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">print</a><a onclick="dp.sh.Toolbar.Command('About',this);return false;" href="http://www.smashingmagazine.com/2009/01/15/45-new-jquery-techniques-for-a-good-user-experience/#">?</a></div>
</div>
<ol>
<li>&lt;script type=&#8221;text/javascript&#8221;&gt;</li>
<li> $(&#8216;#content a:not(.popupwindow)&#8217;).filter(function() {</li>
<li> var theHref = this;</li>
<li> if (theHref.hostname &amp;&amp; theHref.hostname !== location.hostname) {</li>
<li> $(theHref).not(&#8220;.noAutoIcon&#8221;).addClass(&#8220;offSite&#8221;);</li>
<li> $(theHref).not(&#8220;.noAutoLink&#8221;).attr(&#8216;target&#8217;,'_blank&#8217;).bind(&#8216;click keypress&#8217;, function(event) {</li>
<li> var code=event.charCode || event.keyCode;</li>
<li> if (!code || (code &amp;&amp; code == 13)) {</li>
<li> if(pageTracker){</li>
<li> var fixedLink = this.href;</li>
<li> fixedLink = fixedLink.replace(/https?:\/\/(.*)/,&#8221;$1&#8243;);</li>
<li> fixedLink = &#8217;/outgoing/&#8217;   fixedLink;</li>
<li> pageTracker._trackPageview(fixedLink);</li>
<li> };</li>
<li> };</li>
<li> });</li>
<li> };</li>
<li> });</li>
<li>&lt;/script&gt;</li>
</ol>
</div>
<pre style="display: none;">&lt;script type="text/javascript"&gt;
	$('#content a:not(.popupwindow)').filter(function() {
		var theHref = this;
		if (theHref.hostname &amp;&amp; theHref.hostname !== location.hostname) {
			$(theHref).not(".noAutoIcon").addClass("offSite");
			$(theHref).not(".noAutoLink").attr('target','_blank').bind('click keypress', function(event) {
				var code=event.charCode || event.keyCode;
				if (!code || (code &amp;&amp; code == 13)) {
					if(pageTracker){
						var fixedLink = this.href;
						fixedLink = fixedLink.replace(/https?:\/\/(.*)/,"$1");
						fixedLink = '/outgoing/'   fixedLink;
						pageTracker._trackPageview(fixedLink);
					};
				};
			});
		};
	});
&lt;/script&gt;</pre>
<p><a href="http://www.stanlemon.net/projects/jgrowl.html">49. jGrowl</a><br />
jGrowl is a jQuery plug-in that delivers unobtrusive messages within the browser, similar to the way that OS X’s <a href="http://growl.info/">Growl Framework</a> works.</p>
<p><a href="http://www.stanlemon.net/projects/jgrowl.html"><img src="http://media2.smashingmagazine.com/images/jquery-scripts-tutorials/jquery12.jpg" alt="jQuery" /></a></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;partner=sociable" title="Print"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience&amp;bodytext=JavaScipt%20libraries%20have%20made%20huge%20leaps%20and%20bounds%20in%20helping%20developers%20write%20code%20and%20develop%20products%20more%20quickly.%20jQuery%20is%20one%20of%20the%20most%20popular%20JavaScript%20frameworks%2C%20with%20powerful%20tools%20that%20improve%20the%20user%E2%80%99s%20interaction%20with%20Web%20applic" title="Digg"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience&amp;notes=JavaScipt%20libraries%20have%20made%20huge%20leaps%20and%20bounds%20in%20helping%20developers%20write%20code%20and%20develop%20products%20more%20quickly.%20jQuery%20is%20one%20of%20the%20most%20popular%20JavaScript%20frameworks%2C%20with%20powerful%20tools%20that%20improve%20the%20user%E2%80%99s%20interaction%20with%20Web%20applic" title="del.icio.us"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;t=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience" title="Facebook"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience&amp;annotation=JavaScipt%20libraries%20have%20made%20huge%20leaps%20and%20bounds%20in%20helping%20developers%20write%20code%20and%20develop%20products%20more%20quickly.%20jQuery%20is%20one%20of%20the%20most%20popular%20JavaScript%20frameworks%2C%20with%20powerful%20tools%20that%20improve%20the%20user%E2%80%99s%20interaction%20with%20Web%20applic" title="Google Bookmarks"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience&amp;source=Freelance+Web+Developers+The+best+Filipino+freelance+web+development+provider&amp;summary=JavaScipt%20libraries%20have%20made%20huge%20leaps%20and%20bounds%20in%20helping%20developers%20write%20code%20and%20develop%20products%20more%20quickly.%20jQuery%20is%20one%20of%20the%20most%20popular%20JavaScript%20frameworks%2C%20with%20powerful%20tools%20that%20improve%20the%20user%E2%80%99s%20interaction%20with%20Web%20applic" title="LinkedIn"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience" title="Reddit"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myowndeveloper.com/feed/" title="RSS"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;title=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience" title="StumbleUpon"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F" title="Technorati"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience%20-%20http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F" title="Twitter"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F10%2F03%2F45-new-jquery-techniques-for-good-user-experience%2F&amp;t=45%2B%20New%20jQuery%20Techniques%20For%20Good%20User%20Experience&opener=bm&amp;ei=UTF-8&amp;d=JavaScipt%20libraries%20have%20made%20huge%20leaps%20and%20bounds%20in%20helping%20developers%20write%20code%20and%20develop%20products%20more%20quickly.%20jQuery%20is%20one%20of%20the%20most%20popular%20JavaScript%20frameworks%2C%20with%20powerful%20tools%20that%20improve%20the%20user%E2%80%99s%20interaction%20with%20Web%20applic" title="Yahoo! Bookmarks"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>

	Tags: <a href="http://www.myowndeveloper.com/tag/cms/" title="CMS" rel="tag nofollow">CMS</a>, <a href="http://www.myowndeveloper.com/tag/css/" title="CSS" rel="tag nofollow">CSS</a>, <a href="http://www.myowndeveloper.com/tag/sem/" title="sem" rel="tag nofollow">sem</a>, <a href="http://www.myowndeveloper.com/tag/web-application/" title="web application" rel="tag nofollow">web application</a>, <a href="http://www.myowndeveloper.com/tag/xhtml/" title="xhtml" rel="tag nofollow">xhtml</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.myowndeveloper.com/2009/10/03/6-new-web-technologies-of-2008-you-need-to-use-now/" title="6 New Web Technologies of 2009 You Need to Use Now (October 3, 2009)">6 New Web Technologies of 2009 You Need to Use Now</a> (1)</li>
	<li><a href="http://www.myowndeveloper.com/2009/10/04/top-10-ajax-applications/" title="Top 10 AJAX Applications (October 4, 2009)">Top 10 AJAX Applications</a> (0)</li>
	<li><a href="http://www.myowndeveloper.com/2009/09/23/the-beauty-of-css/" title="The Beauty of CSS (September 23, 2009)">The Beauty of CSS</a> (1)</li>
	<li><a href="http://www.myowndeveloper.com/2009/09/23/php-_server-variables-are-not-safe-for-use-in-forms-links/" title="PHP $_SERVER variables are not safe for use in forms, links (September 23, 2009)">PHP $_SERVER variables are not safe for use in forms, links</a> (1)</li>
	<li><a href="http://www.myowndeveloper.com/2009/10/04/dos-and-donts-in-web-site-building/" title="Do&#8217;s and Dont&#8217;s in web site building (October 4, 2009)">Do&#8217;s and Dont&#8217;s in web site building</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.myowndeveloper.com/2009/10/03/45-new-jquery-techniques-for-good-user-experience/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP $_SERVER variables are not safe for use in forms, links</title>
		<link>http://www.myowndeveloper.com/2009/09/23/php-_server-variables-are-not-safe-for-use-in-forms-links/</link>
		<comments>http://www.myowndeveloper.com/2009/09/23/php-_server-variables-are-not-safe-for-use-in-forms-links/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 14:06:12 +0000</pubDate>
		<dc:creator>Yevonsouls</dc:creator>
				<category><![CDATA[Web Applications]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[congratulations]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[launched]]></category>
		<category><![CDATA[mod news]]></category>
		<category><![CDATA[mod updates]]></category>
		<category><![CDATA[w3c compliance]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[website launching]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.myowndeveloper.com/?p=95</guid>
		<description><![CDATA[
			
				
			
		


A common security mistake I see WordPress plugin authors (and PHP coders in general) make is using $_SERVER['PHP_SELF'] or $_SERVER['REQUEST_URI'] as the action of a form or part of an anchor’s href attribute. This is not safe to do, and opens your code up to XSS (cross-site scripting) exploits.
Common example:


&#60;form action="&#60;?php echo $_SERVER['PHP_SELF']; ?&#62;"&#62;


Another example:


&#60;a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;source=myowndev&amp;style=normal&amp;service_api=http%3A%2F%2Fwww.myowndeveloper.com%2Fblog" height="61" width="50" /><br />
			</a>
		</div>
<div>
<div>
<p>A common security mistake I see WordPress plugin authors (and PHP coders in general) make is using <code>$_SERVER['PHP_SELF']</code> or <code>$_SERVER['REQUEST_URI']</code> as the action of a form or part of an anchor’s <code>href</code> attribute. This is not safe to do, and opens your code up to XSS (cross-site scripting) exploits.</p>
<p>Common example:</p>
<div id="highlighter_692548">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>action="</code><code>&lt;?</code><code>php </code><code>echo</code> <code>$_SERVER</code><code>[</code><code>'PHP_SELF'</code><code>]; </code><code>?&gt;</code><code>"&gt;</code></span></div>
</div>
</div>
<p>Another example:</p>
<div id="highlighter_528801">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>href="</code><code>&lt;?</code><code>php </code><code>echo</code> <code>$_SERVER</code><code>[</code><code>'PHP_SELF'</code><code>]' </code><code>?&gt;</code><code>?foo=bar"&gt;link title&lt;/</code><code>a</code><code>&gt;</code></span></div>
</div>
</div>
<p>Here are my two rules regarding <code>$_SERVER['PHP_SELF']</code> or <code>$_SERVER['REQUEST_URI']</code> in forms:</p>
<ul>
<li>Do not use them</li>
<li>If you use one of them, escape it with <code>esc_url()</code></li>
</ul>
<p><span id="more-95"></span>Most uses of <code>$_SERVER['PHP_SELF']</code> and <code>$_SERVER['REQUEST_URI']</code> are in HTML forms. If you want the <code>action</code> attribute to point to the current URL, <strong>leave it blank</strong>. URI references that are blank point to the current resource.</p>
<div id="highlighter_929104">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>action</code><code>=</code><code>""</code><code>&gt;</code></span></div>
</div>
</div>
<p>If you do want to specify the action (and there are good reasons for wanting to do that, such as stripping the query string from the current URL), you <strong>must</strong> run it through <code>esc_url()</code>.</p>
<div id="highlighter_29450">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>action="</code><code>&lt;?</code><code>php </code><code>echo</code> <code>esc_url( </code><code>$_SERVER</code><code>[</code><code>'PHP_SELF'</code><code>] ); </code><code>?&gt;</code><code>"&gt;</code></span></div>
</div>
</div>
<p>The same applies to links… run the <code>href</code> attribute through <code>esc_url()</code>.</p>
<div id="highlighter_700183">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>a</code> <code>href="</code><code>&lt;?</code><code>php </code><code>echo</code> <code>esc_url( </code><code>$_SERVER</code><code>[</code><code>'PHP_SELF'</code><code>] . </code><code>'?foo=bar'</code> <code>); </code><code>?&gt;</code><code>"&gt;link title&lt;/</code><code>a</code><code>&gt;</code></span></div>
</div>
</div>
<p>A quick search through the WordPress Plugin Directory showed that this problem is far too common.</p>
<p><strong>Updates:</strong></p>
<p>Examples of URLs that could exploit this for double-quoted actions:</p>
<p><code>script.php/"%20onmouseover='alert(document.cookie)'</code></p>
<p>And single-quoted actions:</p>
<p><code>script.php/'%20onmouseover='alert(document.cookie)'</code></p>
<p>No, just using a plain old <code>htmlentities()</code> wrapper is not going to help! That’s still vulnerable to XSS in certain situations. If you’re not using WordPress, you should copy the WordPress escaping functions (just remove the <code>apply_filters()</code> portions).</p>
<p>If you are using the <code>base</code> tag, Safari will apply that base to the blank <code>action</code> attribute. So if you use the <code>base</code> tag (I never do), a blank <code>action</code> isn’t going to be for you. Use what you’ve been using, but escape it.</p>
<p>Lester Chan has a handy snippet for the form action of WordPress plugin settings pages:</p>
<div id="highlighter_931086">
<div>
<div><span style="margin-left: 0px ! important;"><code>&lt;</code><code>form</code> <code>action="</code><code>&lt;?</code><code>php </code><code>echo</code> <code>admin_url( </code><code>'admin.php?page='</code> <code>. plugin_basename( </code><code>__FILE__</code> <code>) ); </code><code>?&gt;</code><code>"&gt;</code></span></div>
</div>
</div>
<p><code>admin_url()</code> takes care of escaping for you, and is an easy way to create a full WP admin URL from a <code>wp-admin</code>-relative URL.</p>
<p>Source:  <a title="http://markjaquith.wordpress.com/2009/09/21/php-server-vars-not-safe-in-forms-or-links/" href="http://markjaquith.wordpress.com/2009/09/21/php-server-vars-not-safe-in-forms-or-links/" target="_blank">http://markjaquith.wordpress.com/2009/09/21/php-server-vars-not-safe-in-forms-or-links/</a></div>
</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 823px; width: 1px; height: 1px;">
<div class="main">
<div class="snap_preview">
<p>A common security mistake I see WordPress plugin authors (and PHP coders in general) make is using <code>$_SERVER['PHP_SELF']</code> or <code>$_SERVER['REQUEST_URI']</code> as the action of a form or part of an anchor’s <code>href</code> attribute. This is not safe to do, and opens your code up to XSS (cross-site scripting) exploits.</p>
<p>Common example:</p>
<div id="highlighter_692548" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">form</code> <code class="plain">action="</code><code class="script">&lt;?</code><code class="plain">php </code><code class="functions">echo</code> <code class="variable">$_SERVER</code><code class="plain">[</code><code class="string">'PHP_SELF'</code><code class="plain">]; </code><code class="script">?&gt;</code><code class="plain">"&gt;</code></span></span></div>
</div>
</div>
<p>Another example:</p>
<div id="highlighter_528801" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">a</code> <code class="plain">href="</code><code class="script">&lt;?</code><code class="plain">php </code><code class="functions">echo</code> <code class="variable">$_SERVER</code><code class="plain">[</code><code class="string">'PHP_SELF'</code><code class="plain">]' </code><code class="script">?&gt;</code><code class="plain">?foo=bar"&gt;link title&lt;/</code><code class="keyword">a</code><code class="plain">&gt;</code></span></span></div>
</div>
</div>
<p>Here are my two rules regarding <code>$_SERVER['PHP_SELF']</code> or <code>$_SERVER['REQUEST_URI']</code> in forms:</p>
<ul>
<li>Do not use them</li>
<li>If you use one of them, escape it with <code>esc_url()</code></li>
</ul>
<p>Most uses of <code>$_SERVER['PHP_SELF']</code> and <code>$_SERVER['REQUEST_URI']</code> are in HTML forms. If you want the <code>action</code> attribute to point to the current URL, <strong>leave it blank</strong>. URI references that are blank point to the current resource.</p>
<div id="highlighter_929104" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">form</code> <code class="color1">action</code><code class="plain">=</code><code class="string">""</code><code class="plain">&gt;</code></span></span></div>
</div>
</div>
<p>If you do want to specify the action (and there are good reasons for wanting to do that, such as stripping the query string from the current URL), you <strong>must</strong> run it through <code>esc_url()</code>.</p>
<div id="highlighter_29450" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">form</code> <code class="plain">action="</code><code class="script">&lt;?</code><code class="plain">php </code><code class="functions">echo</code> <code class="plain">esc_url( </code><code class="variable">$_SERVER</code><code class="plain">[</code><code class="string">'PHP_SELF'</code><code class="plain">] ); </code><code class="script">?&gt;</code><code class="plain">"&gt;</code></span></span></div>
</div>
</div>
<p>The same applies to links… run the <code>href</code> attribute through <code>esc_url()</code>.</p>
<div id="highlighter_700183" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">a</code> <code class="plain">href="</code><code class="script">&lt;?</code><code class="plain">php </code><code class="functions">echo</code> <code class="plain">esc_url( </code><code class="variable">$_SERVER</code><code class="plain">[</code><code class="string">'PHP_SELF'</code><code class="plain">] . </code><code class="string">'?foo=bar'</code> <code class="plain">); </code><code class="script">?&gt;</code><code class="plain">"&gt;link title&lt;/</code><code class="keyword">a</code><code class="plain">&gt;</code></span></span></div>
</div>
</div>
<p>A quick search through the WordPress Plugin Directory showed that this problem is far too common.</p>
<p><strong>Updates:</strong></p>
<p>Examples of URLs that could exploit this for double-quoted actions:</p>
<p><code>script.php/"%20onmouseover='alert(document.cookie)'</code></p>
<p>And single-quoted actions:</p>
<p><code>script.php/'%20onmouseover='alert(document.cookie)'</code></p>
<p>No, just using a plain old <code>htmlentities()</code> wrapper is not going to help! That’s still vulnerable to XSS in certain situations. If you’re not using WordPress, you should copy the WordPress escaping functions (just remove the <code>apply_filters()</code> portions).</p>
<p>If you are using the <code>base</code> tag, Safari will apply that base to the blank <code>action</code> attribute. So if you use the <code>base</code> tag (I never do), a blank <code>action</code> isn’t going to be for you. Use what you’ve been using, but escape it.</p>
<p>Lester Chan has a handy snippet for the form action of WordPress plugin settings pages:</p>
<div id="highlighter_931086" class="syntaxhighlighter nogutter ">
<div class="lines">
<div class="line alt1"><code class="number">1.</code><span class="content"><span class="block" style="margin-left: 0px ! important;"><code class="plain">&lt;</code><code class="keyword">form</code> <code class="plain">action="</code><code class="script">&lt;?</code><code class="plain">php </code><code class="functions">echo</code> <code class="plain">admin_url( </code><code class="string">'admin.php?page='</code> <code class="plain">. plugin_basename( </code><code class="constants">__FILE__</code> <code class="plain">) ); </code><code class="script">?&gt;</code><code class="plain">"&gt;</code></span></span></div>
</div>
</div>
<p><code>admin_url()</code> takes care of escaping for you, and is an easy way to create a full WP admin URL from a <code>wp-admin</code>-relative URL.</div>
</div>
</div>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  target="_blank" href="http://www.printfriendly.com/print?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;partner=sociable" title="Print"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links&amp;bodytext=%0D%0A%0D%0A%0D%0AA%20common%20security%20mistake%20I%20see%20WordPress%20plugin%20authors%20%28and%20PHP%20coders%20in%20general%29%20make%20is%20using%20%24_SERVER%5B%27PHP_SELF%27%5D%20or%20%24_SERVER%5B%27REQUEST_URI%27%5D%20as%20the%20action%20of%20a%20form%20or%20part%20of%20an%20anchor%E2%80%99s%20href%20attribute.%20This%20is%20not%20safe%20to%20do%2C%20and%20open" title="Digg"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://delicious.com/post?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links&amp;notes=%0D%0A%0D%0A%0D%0AA%20common%20security%20mistake%20I%20see%20WordPress%20plugin%20authors%20%28and%20PHP%20coders%20in%20general%29%20make%20is%20using%20%24_SERVER%5B%27PHP_SELF%27%5D%20or%20%24_SERVER%5B%27REQUEST_URI%27%5D%20as%20the%20action%20of%20a%20form%20or%20part%20of%20an%20anchor%E2%80%99s%20href%20attribute.%20This%20is%20not%20safe%20to%20do%2C%20and%20open" title="del.icio.us"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;t=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links" title="Facebook"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links&amp;annotation=%0D%0A%0D%0A%0D%0AA%20common%20security%20mistake%20I%20see%20WordPress%20plugin%20authors%20%28and%20PHP%20coders%20in%20general%29%20make%20is%20using%20%24_SERVER%5B%27PHP_SELF%27%5D%20or%20%24_SERVER%5B%27REQUEST_URI%27%5D%20as%20the%20action%20of%20a%20form%20or%20part%20of%20an%20anchor%E2%80%99s%20href%20attribute.%20This%20is%20not%20safe%20to%20do%2C%20and%20open" title="Google Bookmarks"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links&amp;source=Freelance+Web+Developers+The+best+Filipino+freelance+web+development+provider&amp;summary=%0D%0A%0D%0A%0D%0AA%20common%20security%20mistake%20I%20see%20WordPress%20plugin%20authors%20%28and%20PHP%20coders%20in%20general%29%20make%20is%20using%20%24_SERVER%5B%27PHP_SELF%27%5D%20or%20%24_SERVER%5B%27REQUEST_URI%27%5D%20as%20the%20action%20of%20a%20form%20or%20part%20of%20an%20anchor%E2%80%99s%20href%20attribute.%20This%20is%20not%20safe%20to%20do%2C%20and%20open" title="LinkedIn"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links" title="Reddit"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.myowndeveloper.com/feed/" title="RSS"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;title=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links" title="StumbleUpon"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://technorati.com/faves?add=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F" title="Technorati"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="http://twitter.com/home?status=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links%20-%20http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F" title="Twitter"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  target="_blank" href="" title="Twitthis"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/" title="Twitthis" alt="Twitthis" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  target="_blank" href="http://bookmarks.yahoo.com/toolbar/savebm?u=http%3A%2F%2Fwww.myowndeveloper.com%2F2009%2F09%2F23%2Fphp-_server-variables-are-not-safe-for-use-in-forms-links%2F&amp;t=PHP%20%24_SERVER%20variables%20are%20not%20safe%20for%20use%20in%20forms%2C%20links&opener=bm&amp;ei=UTF-8&amp;d=%0D%0A%0D%0A%0D%0AA%20common%20security%20mistake%20I%20see%20WordPress%20plugin%20authors%20%28and%20PHP%20coders%20in%20general%29%20make%20is%20using%20%24_SERVER%5B%27PHP_SELF%27%5D%20or%20%24_SERVER%5B%27REQUEST_URI%27%5D%20as%20the%20action%20of%20a%20form%20or%20part%20of%20an%20anchor%E2%80%99s%20href%20attribute.%20This%20is%20not%20safe%20to%20do%2C%20and%20open" title="Yahoo! Bookmarks"><img src="http://www.myowndeveloper.com/wp-content/plugins/sociable/images/yahoomyweb.png" title="Yahoo! Bookmarks" alt="Yahoo! Bookmarks" class="sociable-hovers" /></a></li>
</ul>
</div>

	Tags: <a href="http://www.myowndeveloper.com/tag/congratulations/" title="congratulations" rel="tag nofollow">congratulations</a>, <a href="http://www.myowndeveloper.com/tag/css/" title="CSS" rel="tag nofollow">CSS</a>, <a href="http://www.myowndeveloper.com/tag/launched/" title="launched" rel="tag nofollow">launched</a>, <a href="http://www.myowndeveloper.com/tag/mod-news/" title="mod news" rel="tag nofollow">mod news</a>, <a href="http://www.myowndeveloper.com/tag/mod-updates/" title="mod updates" rel="tag nofollow">mod updates</a>, <a href="http://www.myowndeveloper.com/tag/w3c-compliance/" title="w3c compliance" rel="tag nofollow">w3c compliance</a>, <a href="http://www.myowndeveloper.com/tag/web-design/" title="Web Design" rel="tag nofollow">Web Design</a>, <a href="http://www.myowndeveloper.com/tag/website-launching/" title="website launching" rel="tag nofollow">website launching</a>, <a href="http://www.myowndeveloper.com/tag/xhtml/" title="xhtml" rel="tag nofollow">xhtml</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.myowndeveloper.com/2009/08/11/hello-world/" title="My Own Developer Launching! (August 11, 2009)">My Own Developer Launching!</a> (3)</li>
	<li><a href="http://www.myowndeveloper.com/2009/09/23/960-gridder-easy-to-use-layout-design-tool/" title="960 Gridder: Easy to use layout design tool (September 23, 2009)">960 Gridder: Easy to use layout design tool</a> (0)</li>
	<li><a href="http://www.myowndeveloper.com/2009/09/23/the-beauty-of-css/" title="The Beauty of CSS (September 23, 2009)">The Beauty of CSS</a> (1)</li>
	<li><a href="http://www.myowndeveloper.com/2009/10/03/6-new-web-technologies-of-2008-you-need-to-use-now/" title="6 New Web Technologies of 2009 You Need to Use Now (October 3, 2009)">6 New Web Technologies of 2009 You Need to Use Now</a> (1)</li>
	<li><a href="http://www.myowndeveloper.com/2009/10/04/dos-and-donts-in-web-site-building/" title="Do&#8217;s and Dont&#8217;s in web site building (October 4, 2009)">Do&#8217;s and Dont&#8217;s in web site building</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.myowndeveloper.com/2009/09/23/php-_server-variables-are-not-safe-for-use-in-forms-links/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
