Greetings and welcome to an all-new tutorial series, Peter's Webdev Workshop. This tutorial series will focus on web development, mainly focusing on using PHP as a server-side language, but I'm not ruling out having a crack at Python or Ruby, ASP.NET/Mono C# or something like that. This series will also look at JavaScript on the client side and we'll be using XHTML for all the markup.

Before I jump into today's topic, there's a bit of admin and introduction I need to do to start up the new series. See you after the jump!

All the code examples I use in this series will be released under the Modified BSD Licence (unless I mention otherwise), meaning that you're free to take the code examples, modify them and/or use them in your application, whether open or closed source, provided you mention me (there are a couple of other minor things too). Of course if you get inspired by my code and write something equivalent that does the same job, you can do what you want with it, it's yours. For reference, you can read the whole licence here.

Unlike Beginner's Linux, this series will expect you to be familiar with (X)HTML and to have some basic skills with PHP and some JavaScript knowledge. I won't start with too difficult things and as this series evolves we'll probably see some introductions and other groundwork.

This tutorial, however, throws you in at the level of building your first ever Ajax application in PHP. So for this one, you need a working knowledge of PHP and a good grasp of programming basics.

Ajax - isn't that some kind of cleaner?

No, not that Ajax. Ajax, or Asynchronous JavaScript and XML, is a new web technology that allows you, basically, to utilise JavaScript to get data from a server without reloading the whole webpage. This comes in handy for many things and is powering all of the new 'rich web applications' that are popping up now (Google Maps, Y!Mail Beta, Writely/Zoho Writer).

Basically Ajax means you can have elements of the page dynamically loaded without a page reload (asynchronously to the reloading), meaning you can update elements of the page without receiving the whole page again and without affecting the rest of the page. The XML part comes in when you get data from the server in XML format, then use JavaScript to parse that XML and do something useful with it.
Ajax works with any server-side technology, including PHP, Perl, ASP(.NET), Python, Ruby, ColdFusion, SSI, JSP... you get the idea, anything. We'll of course be using PHP.

Right, so how do I start?

For this demo, we're going to keep it simple and have two files. index.php is our main file that is loaded in the normal way by the user, and ajax.php is the script that JavaScript will call and will deliver some information.

So what are we actually going to do? Well, let's break it down:

* index.php will contain a form where the user can enter their name.
* When submitted, the form will talk to ajax.php and determine whether that name is in a predefined list.
* If it is, we will say 'Welcome back'. If not, we will say 'Nice to meet you, stranger!'.

Now this isn't particularly groundbreaking. If you wanted, you could do it in JavaScript alone, but that's not the point. Once you know how to do this, you can adapt this to do something a bit more interesting.


Comments


Log in to comment or register here.
Intro Top Scripts Live Feed

About Scriptremix.com

Scriptremix.com is a online web script content site powered by people like you which aims to collect the best resources, tips, and ideas about CSS, HTML, SEO, JavaScript, AJAX, PHP, ASP, .net, linux, XML, CMS, BLOG, Prototypes, Browser Compatibility and much more in online web.

You can submit and share your favorite web script here in just few easy step.

Submit Script

Top Search Tag Cloud
1080p adsense adsense tricks affiliate affiliate partner ajax alstrasoft api application applications asp.net autocomplete automatic autosuggest baby battery birth black blog blogging bluetooth bonus bonuses books browser business calendar cameras canon cartridges case mods casemods casio cctv video security camera systems charger chronograph class classes classifieds cleaner clickbank clone cms code coldfusion collection color comments commission community software component control create cross-browser css daniel farley database demo developer digg digital discount display div dj documentation dom domain doulas download drag and drop dynamic easy effect element elements elledub embryo engine episode erotickг© example examples expecting extensions facebook features firefox flash flickr flora flora delivery florist florist delivery flower arrangement flower delivery forex forms framework free fresh flowers function functionality gallery games getting pregnant gold google gps guitar lessons hdtv health help hidden cameras home hoover how how to how to paint html ideas image images implementation infrared illuminators ink input install insurance interface internet invicta invitrofertilization iscripts javascript javascript framework javascript library joomla joomlatemplatesme jquery jquery plugin json juego labor and delivery layout lcd learn learn & learn and master painting learn and master painting review learn painting learn painting at home learn to paint learning painting led library lightbox lightweight link links magellan make money marketing master painting media medical men' menu message microwave miscarriage mix modding module mootools multiple myspace mysql navigation navigator nutrition online open open source optimization options organization painting books painting classes painting dvds painting lessons painting lessons dvds painting tutorials panasonic pay per click photo php php script play player plug-in plugin plugins podcast popup portable portable gps pregnancy prenatal producer professional program programming progress prototype rails red released review reviews rockettheme router ruby ruby on rails s samsung schumacher script script.aculo.us scriptaculous search search engine searching security cameras systems seo september series sharp silver silverlight site slider slideshow slr social networking social networking script software stainless steel stop style suite support system techniques template templates th the thumbnails tooltip traffic training tutorial tutorials ultima ii unobtrusive update upright using vacuum validation version video video surveillance cameras viral visit x visit-x visitx visitx girls visitx webmaster watch web web application web applications webmaster website widescreen widget window windows wordpress wysiwyg x xhtml xml yahoo youtube yui zune