Latest...
Learning PHP
[06/04/2008]
I’ve begun learning PHP! Well to start with it does seem a bit like Javascript in writing functions and creating arrays and such but it is much more powerful and you can do a whole lot more as you developers out there will know. And you don’t need to worry about browser compatibility etc, brilliant!
So far without learning databases and connectivity with them, I’ve been looking at creating templates, like header and footer files and then each individual page is simply the main content area with a single header and footer file included. For such things as seo people might say that is not good as every page will have the same titles and descriptions but this is no the case. Using these handy variables, each page can still have its own title. There really are many benefits to working this way like adding new menu items, or changing the menu, you just need to change one file.
Some other things I’ve been using PHP for is to create a slideshow [opens new window] which can be automatic or manual, and then there is an image gallery [opens new window] which enlarges the image using just css. Basically the thumbnails are created from drawing all the images in from one folder, put into an array and them display how ever you like. For this gallery I’ve decided to use css to enlarge the actually image which with the method I’ve used in this example is currently not compatible with IE6 on windows.
My greatest achievement so far with learning PHP has to be the alternative to the LightBox Javascript [opens new window], my PHP LightBox, although not as flashy as its Javascript counterpart it does the same job and you do not need to worry about compatibility issues etc.
Although I like this PHP stuff I think people will find the Javascript much easier to implement and it is not platform dependent either. They don’t even really need to learn much about Javascript either so as some thing that could be boxed up for masses I don’t think this PHP thing will go that far but I like it and I know how to implement it so I will be sticking with it. But I must say I really do not know all that much about PHP, I’ve still lots to learn and there a loads of other things I still need to discover so watch this space.
To round thing up for this part of the topic, I think I should address the server side versus the client side thing. PHP is server side which has many great advantages over Javascript, and with Javascript being client side I would say there is a lot more things that need to be considered and so a lot more things that could go wrong too. But in saying that some things have to be client side and to achieve some of the great effects with Javascript you need to be collecting some bits of information that can only be done client side.
I think with this in mind I will probably look into creating these PHP functions that will work with PHP alone but also implement some Javascript elements that could add so little extras but not need to worry if Javascript is turned off etc as the functions will be built to work on their own, well lets see ay.
Some useful resources that I've been using to help me learn what I have so far in PHP are:
- www.w3schools.com/php/ [opens new window]
- www.php.net [opens new window]
Replacing Javascript
[10/02/2008]
Javascript can add a lot of extras and enjoyment to a website and I like this but there are websites that depend on it to function. This is believe is bad! I use it and I like it but you’re website shouldn’t really depend on it if it doesn’t really need to.
In this day and age most do have Javascript enabled on their computers but I’m sure there are still a large number that don’t and this could be for many reasons, security for one maybe. So to provide alternative content or to use a different method is a must, don’t you think.
Not that I want to see Javascript fall, be replaced or become obsolete, I still use it, but as a challenge that I have set myself I have been looking at creating alternatives to different Javascript’s. For this I’ve been looking at PHP. Now I am a web designer and not a developer so I don’t really know PHP so I guess my first challenge is to actually learn it, and then can I begin my search to create alternatives.
I must point out that I’m not trying to find alternatives to replace Javascript altogether but merely to see if it can actually be done. Though if I like what I find I might well end up replacing Javascript after all.
Latest
Archive
- January 08
- Accessibility part 2
- CSS 3
- December 07
- Teaching Web Design
- Learning Javascript
- November 07
- Web browser support/ compatibility
- Accessibility part 1
- October 07
- xhtml/ html validity
- September 07
- Volunteering