Archive | PHP RSS feed for this section

ajax Beginnings

1 Jun

I just completed a tutorial at http://www.tizag.com/ajaxTutorial/ in order to get a quick look at ajax…

The tutorial goes fairly fast and gives you the basic understanding of how ajax works. Overall ajax in itself is fairly simple. I would recommend going to the 3w site for the specification.

In general there are only a few key steps to use basic ajax:

  • Create the Object for the browser to use
  • Most browsers:

      ajaxRequest = new XMLHttpRequest();

    IE browsers:

      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");

    OR

      ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");

  • Create a listener function for the state change
  • ajaxRequest.onreadystatechange = function(){ . . . }

  • Open and Send the request to your server side code
  • ajaxRequest.open("GET", "serverTime.php", true);
    ajaxRequest.send(null);

PHP Beginnings

1 Jun

Once you have PHP installed and setup to run with you web server you can begin coding PHP. PHP reminds me a lot of other scripting languages, mostly javascript with a C syntax flair. PHP is designed to run server-side and serve up the page that was described in your PHP/HTML. This is much like Win-Forms for Microsoft developers.

I managed to go through the rather lengthy tutorial at http://www.tizag.com/phpT/. The tutorial was a good introduction to the language and went into some basic programming concepts as well. I was still hankering to apply the newly learned language, so I decided to work through the example, as well.

The example had a few deprecated pieces of code, that was easily addressed by Googling the deprecated value. I spent a little time adding session and cookies to see how they were working on the server and in the browser. Then I took advantage of Macromedia Dreamweaver’s IDE to look through the various functions that were available to me, and coded up the ones that I thought were interesting. Macromedia Dreamweaver worked well for the PHP development.

I am off to take a look at AJAX for now…

Follow

Get every new post delivered to your Inbox.