Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Apr 16, 2010

Individual Iteration 3

Well I was not as successful as I wanted to be for this iteration. My plan for my project was to use the Chronicling America API with the Google Maps API to display newspapers by location. This is how my site looked for iteration 2.



I started to parse the XML but I had a lot of difficulty getting it to work. The information would not display properly. I tried to parse the XML in JavaScript without success so I am now trying to parse in the PHP instead.

Besides completing the requirements for this course, I would still like to complete this iteration for myself. Creating Mashups and integrating web services is a great skill to have. I plan to continue working on my project and hope that I can get it to display successfully.

Mar 24, 2010

Dynamic Web Interfaces


As I am still working with my individual projects http requests, I have been looking for some more information out on the web.

Well I found this site that talks about http requests, XML, DOM and parsing all in one!
XML.com has several sub-chapters on topics near and dear to our hearts. But the one I found most interesting was the one on Ajax.

The article starts with the history of XML and its interplay with JavaScript. The codes examples start with the basics, then it turns to "The Form," "Handling the Input," "HTTP Heavy Lifting," and the "The Server Script." There are examples on the parsing, xmlDocloading, and server requests.

And as with all good teaching blogs, there is a link to a book for more reading. In this case the book is "No Nonsense XML Web Development With PHP" by Thomas Myer.

Mar 17, 2010

Parsing JSON response with PHP

We are currently trying to tie in the Yelp API into our group project so I thought I would post what we have learned in trying to parse the JSON response. Since JSON is the only response method that Yelp offers, it was imperative that we figure it out. First, the proxy part is the same, meaning that I obtained the response the same way that I did with all of my XML responses. To do this I use this but of code:




After that I use the json_decode() function to convert the data into a searchable format:


NOTE: One nice trick that I learned is to do a var_dump() of the data variable to your output destination. What this does is essentially show you the structure of the JSON response so that you can see the hierarchy of tags. This is similar to just putting your XML URL into firefox in order to see the layout. To do this I use the following snippet of code:



The output will look like this:



After that it is just a matter of figuring out which items you want to retrieve and then grabbing that information. Yelp puts everything under the heading of businesses, which means that I use the following code to access the elements:



So here is the output on the site:


Mar 9, 2010

Pulling Hair out over slow Server

Here I am pouring over my code looking for the tiniest things that could be wrong. I have doubled checked all my spellings to see if I had done something simple as that. I changed a couple words to ensure my div tag was spelled the same in the html file and in the javascript file. Then I notice that the file name isn't the same and Dreamweaver added some code in an effort to help me.

So Ok. I finally get the rss feed to pop in the box on load but it will not show up in my div tag. Back to the double checking my spelling. I start comparing line by line one of my team mates working code. I am not seeing any difference beyond my .php file being named differently. Then I notice he didn't have the php file in the scripts folder.

I try moving it to the main folder instead of it being in the scripts folder. After uploading it again, I tried it again. There is nothing showing on the screen. I am thinking what ELSE can be wrong. I put the laptop down and grab the AJAX book looking for any thing that would clue me in as to what I still had wrong.

I look back over at the laptop. My rss feed has popped in to my page in it's own sweet time. I have been pulling my hair out over a slow server response time. GEEEEZZZZ!

My code isn't much but it did work.
function getDetails() {
request = createRequest();
if (request == null) {
alert("Unable to create request");
return;
}
var url= "teaproxy.php";
request.open("GET", url, true);
request.onreadystatechange = displayDetails;
request.send(null);
}

function displayDetails() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById("content").innerHTML = request.responseText;
var test = request.responseXML
test.getElementsByTagName("item");
if (test) {
alert("It is valid XML");
}
}
}
}

function createRequest() {
try {
request = new XMLHttpRequest();
} catch (tryMS) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMS) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = null;
}
}
}
return request;
}

Mar 5, 2010

FixWire News API

So one of the other services that we wanted to provide on our group project was a local news service so I picked the FixWire API to do this. Documentation for the AP can be found Here. This API requires two steps. First you will need to find the Geo (as FixWire calls it) which is a location ID for all of the locations throughout the us. The URL for doing this is:

http://api.fwix.com/general/geos.xml

This provides the following output:



Once you have this output you can get the geoId for the locations that you want to search. From there you will need to provide three things for the search. The GeoID, a latitude and a longitude. You then form this into a url which will look like the following:

http://api.fwix.com/fetch/nearby.xml?geo_id=117&lat=34.2257255&lon=-77.9447102&radius=3

You will get an output that looks something like this:



I then took this data and parsed it using SimpleXML and Xpath methods to extract the stories and the data that I needed. I did it using a series of for loops and then formatted it using HTML in the PHP script before it was sent back to the Javascript. Here is the code:




What I did here was to create a function that grabbed only the first 250 characters of a story and then I checked to see if the XML had a image tag. If it did then I printed different HTML that included the image. Then I just went to a for loop to print out all the stories with their title, summary, and source, as well as the picture if it had one. Here is the final output.

Zillow Real Estate API

For our group project we wanted to provide some housing statistics for people who were looking to relocate.The API that we chose to do this was the Zillow API which is a real estate API that allows you to do all kinds of searches for housing information in different areas. The types of info I was looking for was median home prices as well as other pertinent info. I used the following URL to get the data:

$zip = $_REQUEST['zipID'];
$url = 'http://www.zillow.com/webservice/GetDemographics.htm?zws-id=X1-ZWz1c2hu5r9fd7_5f91a&zip=';
$fullUrl = $url.$zip;

This basically provides a XML output that I used to grab the data. Below is the output from the query.



Once I had the data I then grabbed the Zip code returned as well as all of the attribute tags and its child tags. I did this withe the following code.

$zip = $xml->xpath('/Demographics:demographics/response/region/zip/text()');

$attr = $xml->xpath('//attribute');

Once I had all of the attribute tags into the array I was able to access them by using a for loop in order to iterate through all of them and return them back to the Javascript code and finally to the users browser.

for($i=0; $i<10;>name
echo $attr[$i]->values->zip->value[0]
echo $attr[$i]->values->nation->value[0]
}

You can see that the Xpath methods use a object type of structure to access the child nodes. The -> denotes a child node and once you know the path you can traverse all of the tags. For instance the query echo $attr[$i]->values->zip->value[0] is used to access the following data:



Once you have grabbed all of the data you can simply use a series of echos from the PHP script to send the data to the Javascript in a nicely formated string.



Anyway, the final output looks like this. I is not to fancy but it provides the data necessary.

7 Day Forcast WeatherBug

For my individual project I used a simple current conditions search to retrieve the current conditions for an area. However, for our group project I wanted to provide a 5 or 7 day forcast. While this wasn't much different for getting the data, parsing through the results was much different as I had to create loops to search through the iterations. See my previous posts to see the code behind in order to return the data but for this post I'm going to show you how to search through the data and parse the XML. First I used the following URL to get the data.

http://A6357896562.api.wxbug.net/getForecastRSS.aspx?ACode=A6357896562&OutputType=1&zipCode=48189.

This returns the following data:




After I get the data it is time for parsing. I use the SimpleXML Xpath function to get the data into a searchable variable.

$xml = new SimpleXMLElement($data);

Then I simply create a for loop to iterate through the data and diplay the results in HTML format. Since there are HTML tags I can't cut and paste the text into the blog as it tries to interpret the tags. However, I have put up a screenshot of the for loop and the methods used to optain the XML tag info HERE.

Here is the final output:

More on Parsing XML

I have been working quite a bit more on the parsing portion of Iteration 3 for the projects and I have found that using Xpath is both a very simple as well as a effective method of parsing the XML. So far I have been able to find tons of documentation as well of examples of how to search for the tags that you need as well as using that data. I used the weather example in my last post but for this on I will use the CareerBuilder API as the example. Here is the beginning of the PHP script:

$zip = $_REQUEST['zipID']; //Here I get the variables from the Javascript
$job = $_REQUEST['jobID'];

$url = 'http://api.careerbuilder.com/v1/jobsearch?&DeveloperKey=WDhb6SR73QBGH8TTJV4T&Location=';
$url2 = '&Keywords=';
$fullUrl = $url.$zip.$url2.$job; //Here I concatenate the strings into one URL

Here I pass the PHP script two variables from my Javascirpt, a job to search for as well as a zip code to search within a given location. Here is the javascript so it makes a bit more sense. I pass the job variable as a parameter while the zip variable is a global so it can be accessed anywhere in the Javascript.

//*********************************************************************************

function getJob(job) { //Here I'm passing the job variable to the function
jbRequest = jobRequest();
if (jbRequest == null) {
return;
}

url= "scripts/career.php?zipID=" + escape(zip) +"&jobID=" + escape(job); //Passing to PHP
jbRequest.open("GET", url, true);
jbRequest.onreadystatechange = displayJob;
jbRequest.send(null);

}


Once in the PHP script I do the standard request for the data

$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $fullUrl); //Here is the full URL variable
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch); //Here I put the request return into the data variable
curl_close($ch);


Next I use SimpleXML to get the $data variable into an accessible variable.

$xml = new SimpleXMLElement($data);

Next I start searching for the data. Here is the output from the URL that is passed to the API.

http://api.careerbuilder.com/v1/jobsearch?&DeveloperKey=WDhb6SR73QBGH8TTJV4T&Location=48189&Keywords=Computer%20Programmer




Next I begin the the search. Here I search for all tags=JobSearchResults

$attr = $xml->xpath('//JobSearchResult'); //Search for all tags JobSearchResults and put them in an Array

This data is put into an array called $attr (for attributes) I made this up and it can be anything that you want. Once the data is there I can begin getting the info that I need.

$count = count($attr); //Count the number of results and use that in the for loop

for($i=0; $i<$count; $i++){ echo $attr[$i]->Company; //Access the data in the JobSearchResults/Company tag
echo $attr[$i]->JobTitle /Access the data in the JobSearchResults/JobTitle
echo $attr[$i]->Pay
echo $attr[$i]->Location

}

Well I hope that this information is helpful for someone. Here is the output from the parse.



Multiple API requests

So one of the problems that I ran into when working on my iteration 2 was that when I was creating multiple proxy requests, I could only get one of the API to return data. After some research and talking with professor Drake, he was able to point out that it was possibly because I was using the same createRequest() function to make the calls. After thinking about it for a bit, it became perfectly clear. The createRequest() function uses global variable and what was happening was that I was overwriting the globals with the second results when calling the function twice. So what I had to do was this. Create a function for the weather request.

function weatherRequest() {
try {
weatRequest = new XMLHttpRequest();
} catch (tryMS) {
try {
weatRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMS) {
try {
weatRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
weatRequest = null;
}
}
}
return weatRequest;
}

I then had to create another function with different global variables.

function descriptionRequest() {
try {
descRequest = new XMLHttpRequest();
} catch (tryMS) {
try {
descRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMS) {
try {
descRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
descRequest = null;
}
}
}
return descRequest;
}

Once this was accomplished I also had to create a different proxy script for each API that I wanted to call. This is because of the fact that each proxy is returning data and if you try to use the same proxy you either need to create all new variable and requests within the proxy script or you just need to have separate proxy files for each request. I chose the latter for simplicity and separation fo the code for troubleshooting purposes.

//*********************************************************************************

function getDesc(itemName) {
descRequest = descriptionRequest();
if (descRequest == null) {
return;
}
//alert("getDesc()");
url= "scripts/description.php?ImageID=" + escape(itemName);
descRequest.open("GET", url, true);
descRequest.onreadystatechange = displayDetails;
descRequest.send(null);

}

//*********************************************************************************

function getWeather(zip) {
weatRequest = weatherRequest();
if (weatRequest == null) {
return;
}

url= "scripts/weather.php?zipID=" + escape(zip);
weatRequest.open("GET", url, true);
weatRequest.onreadystatechange = displayWeather;
weatRequest.send(null);

}

Then it was just a matter of displaying the results to each of the div tags assigned. This was also accomplished using separate functions.

//*********************************************************************************

function displayDetails() {
if (descRequest.readyState == 4) {
if (descRequest.status == 200) {

document.getElementById("description").innerHTML = descRequest.responseText;
}
}
}

//*********************************************************************************

function displayWeather() {
if (weatRequest.readyState == 4) {
if (weatRequest.status == 200) {
//alert(request.responseText);

document.getElementById("weather").innerHTML = weatRequest.responseText;
}
}
}

That's it. So essentially for each API that you use you will need to have a set of separate functions to handle the requests and the displaying of the data all with different global variable. You can check out the results of this HERE.

SimpleXML Paring the Data

In my last post I should you how I was able to get the data from the xml dump to be displayed in the browser. The problem with that was that it was just data. It was unorganized and in no logical format that the user could discern, well all that is about to change. While it took a little time for me to understand how to parse the data, once I figured it out, things moved along fairly quickly. I chose to parse the data using SimpleXML and Xpath in my PHP proxy function. I found that was the easiest way to get the data formatted for proper display. More can be found on the Internet about SimpleXML and Xpath.

The most important part of this process is to get the data into a variable so it can be parsed. If you look at my last post you will see the process of creating the curl session. Once the session is complete you need to take that $data variable and use it to create the $xml variable.

$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $fullUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$data = curl_exec($ch);
curl_close($ch);

$xml = new SimpleXMLElement($data);

This simple line takes the $data returned from the curl session and puts it into a SimpleXML format so that we can parse it. THe next step is to look through your xml by taking the url in your request and putting that into the firefox browser. This will show you the tags and their attributes that are returned so you can figure out what you need. For this instance I used:

http://a6357896562.api.wxbug.net/getLiveWeatherRSS.aspx?ACode=A6357896562&OutputType=1&zipCode=48189

I ended up with the following output:




From here I can start to figure out the tags I want to grab. I do this by using a object type structure. I created variables in the PHP script to hold the resutls of the query. In this one $zip = $xml->xpath('//aws:city-state/@zipcode'); I search for the aws:city-state tag and then I grab the attribute "zipcode".

$timezone = $xml->xpath('//aws:time-zone/@text');
$temphigh = $xml->xpath('/aws:weather/aws:ob/aws:temp-high/text()');
$templow = $xml->xpath('/aws:weather/aws:ob/aws:temp-low/text()');
$feelslike = $xml->xpath('/aws:weather/aws:ob/aws:feels-like/text()');
$city = $xml->xpath('/aws:weather/aws:ob/aws:city-state/text()');
$zip = $xml->xpath('//aws:city-state/@zipcode');
$current_temp = $xml->xpath('/aws:weather/aws:ob/aws:temp /text()');
$elevation = $xml->xpath('/aws:weather/aws:ob/aws:elevation/text()');
$wind = $xml->xpath('/aws:weather/aws:ob/aws:wind-speed/text()');
$lat = $xml->xpath('/aws:weather/aws:ob/aws:latitude/text()');
$long = $xml->xpath('/aws:weather/aws:ob/aws:longitude/text()');
$icon = $xml->xpath('//aws:current-condition/@icon');

Once I had all the data that I need I then format the data into a nice presentable form by using a series of HTML Table tags. This allows me to creat the format and then just hand the JAvascript function something that it needs to spit out. Unfortunately the blog is freaking out and wont let me upload a picture so I put it on my emich site instead Here...Good Luck

Here is the finished Product:

Weatherbug Proxy Pass through

So I managed to get the proxy pass through working and returning data for iteration 2 of the individual project. Since it took me a while to figure it out I thought that I would pass on my experience in case others are running into the same difficulties. I used the WeatherBug API, and the documentation can be found at WeatherBug.

The first thing I did was to use the createRequest method that was provided to us in class.



Next I had to create the getWeather function to call the proxy. I handed it a zip as a parameter so it could find the weather for a location.




Next I created the proxy script. I did this a bit differently than professor Drake showed us but I was able to find quite a bit of documentation and sample code out there to choose from. This one first takes the zip code that I passed to it and puts it in the zip variable. It then takes the cll url and puts it into the $url vaiable. Then I append the zip to the end of the $url variable by concatenating the strings $fullUrl = $url.$zip. The reset is the call to the API and thn it puts the data into the $data variable.




I then just echo the $data variable and it then sends that data to the displayWeather() function in my javascript.




This function then takes the return data variable and then displays it in my web page in the div id=weather tag. While it took me a while to figure out how to get this to work, it was pretty easy to recreate for my other APIs. I literaly just needed to change all of the global variables and then just call the different URL. I was able to use this same code with 3 other APIs for the group project.

Feb 4, 2010

My Iteration 1


So I decided to talk a little bit about iteration 1 for the individual project. Suffice to say that I ran into quite a few challenges but the experience gave me a much better understanding of what AJAX is capable of. My theme is a ski conditions web site that will allow you to click on a ski resort icon, located on the left hand side and display information about the resort.

On the first iteration I wanted to accomplish getting the trail map of the resort to load in a separate div tag along with the description of the resort. For the most part this is my first experience with extensive css so it was a struggle to try and understand what i needed to do in order to accomplish my goal. I followed chapter one very closely as it was very similar to me objectives. Load a page and load some image files to speed up the process of clicking on them. I also wanted to have a description box that listed the details for the resort. While it took me nearly 10 hours to get it all working the site is going as planned.

For the second part I would like to integrate google maps api as well as a weather api that when a resort icon is clicked it displays the trail map, the map of the mountains location, as well as the current weather conditions. While I'm confident that I will be able to accomplish this I'm still very lost as to how these api's are integrated into the site. My hope is that as we progress through the class I will have a better understanding of the process. The one thing that I will say is that after spending weeks reading about AJAX without a whole lot of success understanding how it worked. I feel like rolling up my sleeves and writing the code was the best way for me to understand the concepts as well as the help of Google, when it came to searching things I wanted to accomplish. While i looked through many javascript sites like W3Schools.com, I had much better luck doing google searches for things like "loading images on startup javascript". When I did stuff like that I found excellent examples of how others had coded similar objectives.

Nov 16, 2009

Building your Proxy Pass-Through URL

Like some of you, I started working on Iteration 3 which involves adding another API to our group website. I thought I would start off with the “easy” stuff and go from there. I had three goals:

1) Figure out how to iterate through the DOM to get multiple events.
2) Figure out how to display the events.
3) See if there is a way to build a URL with a variable that I can change based on a City.

Well, I started with the first problem and found that using my proxy pass-through I got all the information I needed. The DOM contained everything and if I indexed each element I could see multiple event information. I spent quite a bit of time trying to get that information with a for loop and that part may even work. However, I found when I went to the second part and tried to display the information using the innerHTML property it only displayed the last event. I spent quite a bit of time trying separate DIVs with hard coded indexes just to see if it would work. I never got that to work. After emailing one of my group members (James) suggested another soulution which I have not looked at yet. (Mainly because I am a little frustrated with that) Anyway, I decided to move on the difficult goal (number 3). I was surprised that I got that to work in a short time because that seemed to be the most difficult part of everything I was trying to do.

So, if you want to pass a variable into your php proxy pass-through (build the URL) here is how you can do it:

The first thing I did was to adjust my "active.php" file by hacking off the end of the original URL and making it a varible. It was the key text which I have to supply to use the API. Also, note that the part I want to change is just before the key: dma="the city I want to change" then the key follows with an &api_key=... So, the only thing I changed initially was to hack off the key and make it a varible $key = '&api_key=xxxxxxxxxxxxxx' Then you will notice I just apppended it to the original string which was HOSTNAME + path + key which actually was done with the "." php append charater. Which you can see in my example. Once I knew that worked all I had to do was figure out how to supply the "path" as an input varible. This was much simpler than I thought. I spent a lot of time looking on the Internet but ended up just experimenting and figuring it out.

This is my original php:

define ('HOSTNAME', 'http://api.amp.active.com/assets/cycling?dma=Detroit&api_key=xxxxxxxxxxxxxxxxxxxxxx');


$path = ($_POST['path']) ? $_POST['path'] : $_GET['path'];

$url = HOSTNAME.$path;

This has the HOSTNAME, path and my new "key" varible

define ('HOSTNAME', 'http://api.amp.active.com/assets/cycling?dma=');
$path = ($_POST['path']) ? $_POST['path'] : $_GET['path'];

$key = '&api_key=xxxxxxxxxxxxxxxxxxxxx';

This is where everything gets "appended" to make the URL

$url = HOSTNAME.$path.$key;

Once I realized that I didn't have to do any more with the php script I started playing with the js to see what I needed to do to get the 'path' varible to be the city I wanted to get information about. This is what I ended up doing in my js file.



As you can see I created a varible "event_City" and assigned Detroit to it. Then I add that varible to the url which gets passed in as 'path' and ultimately gets appended to the HOSTNAME and then the key gets appended to that to complete the string. This is what I get when I get events for Detroit:




Now that I have this out of the way all I need to do is figure out the first two "easy" parts and I will be good.

Nov 14, 2009

PHP Proxy Pass-Through using several keywords

While working on our group project, we had some problems with our PHP Proxy when we handed over keywords, seperated by spaces. The result of the CURL request was an error that Google Translate was not able to process the request.

To solve this problem, we tried it with escape(variable), or manually by exchanging the space by "%20" in the script. After some research we found out that the proxy interprets the "%20" to space. So we had to find a solution within the proxyfile, and here it is:

$rk = $_REQUEST['rk'];
$token = strtok($rk, " "); //tries to split $rk into several parts
// by cutting everywhere where a space is used as delimiter
$test=""; // the new string that will be created
$test1="%20"; // the new delimiter
while ($token != false) //iteration over the parts
{
$test=$test.$token.$test1; // value assignment to $test
$token = strtok(" "); //next part of $rk will be assigned to $token
}
$rk = $test;



We use the PHP function strtok(string,delimiter) do initialize the splitting process. With strtok(delimiter) we will get the next part of the string. This was the only way that allowed us the replacements of spaces with its entity.
I guess some of you could use this.

Nov 7, 2009

PHP Proxy Pass-Through using the “Foreach” Loop and Pointers

During my iteration #2 presentation I demonstrated the use of a “foreach” loop in my PHP proxy pass-through and wanted explain it a little further. I figured the best way would be to do it with a blog posting.

My proxy pass-through is passed a variable labeled “input”, this is variable passed from a javascript function that excepts the user input from a textbox. Currently this function isn’t terribly robust as it doesn’t check from non-letter characters, but is shown below:


Then the php file associates the value that was passed into the variable “$name_query” using the GET command. This variable is then used to load the XML file that is being parsed for our search request. Once the file has been loaded, the “foreach” loop searches through the requested XML file for the label “location” using a pointer command and assigns the results to a new variable named “$_location”. With each found result it then uses a pointer to get the locations child elements for the reviewlink, name, address and phone information while putting the results in a nicely formatted manner.

The loop continues through the results, stacking the result information nicely on the web page in it’s own empty DIV for the user to review. This is a rather simple and clean way to search and display results from an XML file using PHP and a loop. Below is the PHP code used:

And here is the final result as shown for iteration #2.

http://people.emich.edu/jaltmann/beer2.html

Oct 2, 2009

Why learn PHP?

After completing chapter two of our book and completing the lab I became more interested in the specifics of PHP; when to use it and what it can do. I've never used it in the past and began to wonder when it would be most advantageous to use versus other scripting languages. First, PHP is a recursive acronym which stands for PHP: Hypertext Preprocessor. Originally PHP stood for Personal HomePage. It is defined as a "general-purpose scripting language that is especially suited for Web development and can be embedded into HTML" (php.net). While PHP is a scripting language it is different from client side Java in that it is executed on the server. It's also a very easy language to learn from what I understand. PHP.net provides a basic tutorial.

What is PHP capable of doing? Well, as we learned from our book and lab, php is capable of server-side scripting. It can take a static web page and make it dynamic. It can also be used for command line scripting for text processing. The best known feature about this language is its compatability with many databases and ODBC.

Why use PHP? Probably one of the best reasons is that it's a simple language to learn compared to other languages such as ASP. This allows for one to quickly enable an interactive web site. This is the second best thing about PHP, it's interactive with website visitors.

I also learned that PHP is commonly used as the online shopping carts. Here is a list of five more useful examples found from a "Top Ten" on php.about.com:

1) Send E-mail From a Form

2) Host a Web Forum

3) Add a Poll

4) Create a Calendar

5) Count Visitors

PHP provides more functionality than I imagined. Now that I'm aware of the many uses, I plan to take advantage of this scripting language on the job.

Sep 17, 2009

Editors and References

It’s been a couple years since I've had to write HTML and CSS from scratch. I currently maintain our company website but that is much easier than starting from scratch. I decided to go looking for a good "free" html editor and found a LONG list. “This page lists free HTML editors, Web editors, WYSIWYG editors, web site builders, as well as specialized editors optimized for Cascading Style Sheets (CSS) or even the numerous web scripting languages such as PHP, Perl, Java, JavaScript, ASP, etc.” Not only are there a number of editors but there are, of course, more links to other editors and more free stuff.

After finding this site and looking at all the choices I decided to just stick with Notepad++ rather than trying something new. Notepad++ offers so many good features:


  • The text is displayed in different colors depending on what it is
  • When you select an opening the closing is automatically highlighted.
  • There are line numbers which come in handy when you get an error that references a particular line number.


    I am sure there are many other benefits to using Norepad++ but one of the main reasons I like it is because it doesn't add any extra space(s) or code to your project. The code is as neat and clean as you make it.

    Also, I stumbled on a few good reference sites while I was looking for an HTML editor. It still amazes me how much good information is on the web! I found quite a few good explanations and references for JavaScript, CSS and XHTML. I also found a nice reference site for php while trying to figure out how to comment out a number of lines of code.