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
#8211 & 1080p 160 gb 4.3-inch acai berry accessible adsense adsense tricks affiliate affiliate partner ajax alstrasoft api application applications asp.net autocomplete automatic babies baby background backlinks battery bidvertiser black blog blogging bluetooth bonus bonuses browser business calendar camera cameras canon case mods casemods casio cctv video security camera systems charger cheat childbirth chronograph class classes classic classifieds cleaner clickbank clone cms code coldfusion collection color comments commission component conception control coupon codes coupons crack create cross-browser css database demo design digg digital discounts codes dishwasher div dj domain download drag & drag and drop dynamically easy effect element elements engine episode example examples extensions facebook features fetus flash flickr flora flora delivery florist florist delivery flower arrangement flower delivery forex framework free fresh flowers function functionality gallery games gold google google adsense gps hack hdtv health help hidden cameras home hoover how how to how to paint html ideas image images implementation infertility infrared illuminators ink input install interface internet invicta javascript javascript framework javascript library joomla joomlatemplatesme jquery jquery plugin json juegos layout layouts 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 light lightbox lightweight link links magellan make money making money moneymaker money maker adsense bidvertiser adbrite manual marketing master painting media medical men' menu mix modding mootools myspace mysql natural birth navigation navigator no-cd nutrition online open open source optimization options organization painting painting books painting classes painting dvds painting lessons painting lessons dvds painting tutorials panasonic photo photos php php script play player plug-in plugin plugins podcast popup portable portable gps pregnant producer products professional program programming progress promo codes prototype rails red release released resize review reviews rockettheme router rss ruby s samsung schumacher script script.aculo.us scriptaculous search search engine security cameras systems seo september series sharp shredder silver sims 2 sims crack site slider slideshow slr social networking social networking script software stainless stop style support system techniques template templates th the tom piper tooltip traffic training tutorial tutorials ultima ii 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 wordpress x xhtml xml yahoo youtube yui