November 3, 2008

Last Hoorah

My Web site is finally complete, well except for the sending an email part which is not quite working jut yet. Here is the URL:

http://dmtsar.0fees.net/ladi/

I’ve managed to incorporate some Javascript and PHP code in my web site.  One of the PHP components connects and retrieves data from a MySQL database. It was pretty straight forward without much drama. I also used PHP include files for the component components in the web site, eg Navigation menu. Doing this saved a lot of duplication specially when later I decided to make some more tweeks. The form validation on the send enquiry form is also written in PHP. I can’t seem to get the email function working however. I’m not sure if this is a coding issue, or a web host server issue as I can’t send normal emails to it either. ( I have tonight to try and figure it out! ).

In hindsight, I regret that I didn’t get to play around with javascript too much. The Lightbox effect on the gallery page was something I just downloaded from the web – ie, not actually my code.

My final report (and all the draft versions)  will be located here (click on Final Report link):

http://dmtsar.0fees.net/

It’s not 100% complete just yet, but there are some stuff up there now.

Good luck to everyone!

October 31, 2008

PHP Debugging – “=” vs “==”

I spent about 3 hours debugging my php code all over a missing “=” !!!

One “=” is a variable assignment, and two “==” is a test condition. Something like…

$var = false;   // a boolean variable, assign a value of false

if ($var == true) { do something } ;

But what I was doing instead was …

if ($var = true) { do something } ;  // Ie, one “=”

The affect of doing this is the variable $var is being assigned the value of “true”. PHP doesn’t give you an error or a warning even though it actually doesn’t make sense to do an assign value in a conditional test!! So I spent 3 hours in frustration trying to figure out where in my code my variable is mysteriously being changed back to true when it should be false ! Aaargghhh.

End of vent.

October 7, 2008

System Plan

Here’s a link to my System Plan: http://dmtsar.0fees.net/system_plan.html

There doesn’t seem to be a discussion forum setup yet on UTS Online.

Also, I can’t get it to 100% Validate due to the (annoying) Analytics code the hosting appends to end of the page, which I can’t turn off.

October 1, 2008

How do you respond to comments on your blog?

I suppose you can add a comment on the commenters blog, or make a comment on the blog that has a comment ….

Anyways, Angela, to answer your question… I used Photoshop to do the tiled background image as well as the banner, which is actually a photo of my bedside table lamp. And the rest of the layout, well, because I’ve restarted so many times, I’ve gotten the hang of the whole {position: fixed vs position: relative}  thing. Designing in Photoshop helped as it was eaiser to visually play around with background images, colours and sizing (specially sizing). A lesson I learnt the hard way. Powerpoint would be just as affective I suspect if you don’t have Photoshop.

As for the lighbox effect, in UTS Online, Week 8, there’s a link to Lightbox where you can download the scripts and instructions on how to use it. It was pretty simple I thought and didn’t take too long to setup. The layout of the little thumbnail images with descriptions underneath, is from w3schools.

Hope that’s been helpful!

October 1, 2008

Dropdown Menus

After trolling through what seems like hundreds of examples and tutorials, I finally found a pretty simple method of applying a dropdown menu. Basically, what I was after was when the mouse hovered over a link from a horizontal menu, a dropdown vertical menu appears. If not for an IE bug, you can pertty much accomplish this with just purely CSS.  A little bit of javascript is required. There’s some pretty complex examples out there, but this article, Suckerfish Dropdowns, from A List Apart is by bar the simplest in my opinion. It still uses javascript, and although I don’t quite fully understand what it’s doing (specially the javascript bit) it was pretty easy to apply for my own purposes.

Here’s my sample. Pretty simple, but it works!

September 30, 2008

Designing is not so easy, is it?

I’ve chopped and changed my mind a million and one times (and that’s not an exageration either) about what I want to do for this project. I suppose at a very high level, I want to make the most of this subject (and ultimately this MIM course), to learn to be a “designer” as opposed to a “developer” (or maybe a happy mixture of both). But with a world of choices at my disposal, I’ve learnt that “designing” is not so easy…..  And that’s my ephiphany for the week.

In the process of this ephiphany, however, I have to admit that I have learnt a great many things about what “web developers” use out there in the world wide web, even if it’s just glimpses. For example, this week I’ve just discovered jQuery. Don’t know much about it yet to write about here, but it’s essentially a javascript library you can use to for “document traversing, event handling, animation, and AJAX interactions” (read more bout jQuery here). I plan to use jQuery to create a popup submenu (ie, when you hover over a menu link, a submenu pops up). I found a tutorial on how to do this using jQuery.

Anyways, in the interest of “getting good grades”, I need to bite the bullet and just get on with it.

Looking back, I started of with a web site for a (real) removalist business in Sydney. But I was lacking inspiration, and so I decided on a web site for me instead. But then I decided that was a bit too lame as I didn’t particularly have anything interesting to put in it. And now finally, combining my interest in having a visually appealing design and learning javscript and php, and my past-time interest of eating and drinking, I’ve created a fictituos Bar/Restaurant that I will be creating a web site for.

Here’s what I have so far. It’s called the “La Di Bar“  (as in La di dah). The bar has a fab restaurant and cocktail and wine selection. On friday’s and saturday’s, the party continues into the night with a live band or DJ. You can become a member and receive a monthly newsletter of any upcoming special events.

And this, is my DMT project…

September 19, 2008

CSS, Javascript, PHP & MySQL

These are the 3 technologies that I will be using for my project. I didn’t list XHTML as I don’t envision having too much issues around it.

I will be building a personal website and the following is basically what and how I will be using my chosen technologies:

  • CSS and XHTML for the web page
  • Javascript for a picture gallery
  • PHP and MySQL for the guestbook (just a really simple guestbook for the purpose of having basic exposure to PHP programming language)
  • September 16, 2008

    Change in Project Direction

    I’ve decided to change my project direction. Originally, I was going to build a website for a small business for a friend of mine. But I keep getting distracted, and my mind wonders off into designing a website for myself. Hence, I haven’t made much progress!

    I found this site with examples of inspirational web designs:

    http://www.webdesignerwall.com/trends/80-large-background-websites/

    I’ve come to realise that that is want I want to do. That’s where I want to be, and what I want to work towards. PHP looks a bit too much like programming. Actually, it is programming and I’ve done enough programming, and I’m not really that interested.

    So, new plan.

    What will I build?
    A personal web page. To start off, it will have a picture gallery, a blog space and a guest book.

    Who is it for?
    Me. It will also serve as a portfolio of my work for employment when I finish this course.

    What technologies will it use?

    • Javascript for the gallery
    • PHP and MySQL for the guestbook (just a really simple guestbook for the purpose of having basic exposure to PHP programming language)
    • CSS and XHTML for the web page

    Outside of web technologies, building this web site will also improve my Photoshop skills as I plan to use it to create background images and such.

    I’m actually excited now… whooohoo !

    September 15, 2008

    Executing PHP from a .html file – Part 2

    Just a short blog today. In my last blog I talked about my unsuccessful attempt of executing php code within a html file. The workaround was to add a configurations setting in the .htaccess file, which I didn’t think I would be able to do in my free webhosting account. However, Alastair saved the day (and a whole lot of rewriting)! He posted a comment and suggested I simply created a .htaccess file in the same directory as my scripts. Which I did! And it worked! YAY !! So easy. It took a little longer to get it working on my Mac though.

    I’m a little bit behind in my schedule – because I’m a little bit obsessed with the layout as I’ve changed my mind too many times…..

    I’m going to change my focus this week however and get this booking enquiry form up and running which will include:

    1. Build the form in html
    2. Finalise php form validation
    3. Setting up a MySQL database
    4. On clicking the “Send” button, a record entry will be written to the database

    Once that’s working, I’ll have to figure out how to send an email and an SMS message.

    September 4, 2008

    Executing PHP from a .html file

    I have parts of my the puzzle that I want to start putting together. I have the html page with my content area defined, and I have a php page with my enquiry form and some validation. So now I want to put the (php) form in the (html) content area. I thought easy, I’ll just do this:

    <div id=”content_centre”>
        <?php> include(“form.php”); <?>
    </div>

    No, that doesn’t do anything. Not even an error. Just nothing.

    The reason, and now in hindsight it makes perfect sense, is that the web server examines the extension of the file to determine if it is to go straight to the web browser or back to the server for more processing. So if it sees a file with a .html or .htm extension, it assumes there’s nothing to process and sends it straight into the browser. If that .html or .htm file contains php code, the browser will not know how to interpret it. [1]

    The work around for this, besides just creating a .php file, is to modify the .htaccess file in your web server and add this line [1]:

    AddType application/x-httpd-php .html
    or
    AddType application/x-httpd-php .htm

    I probably won’t have access to this file - having only a free webhosting account. So I guess it’s back to the drawing board for me and change my .html to a .php …..

    Reference:

    [1] http://php.about.com/od/advancedphp/p/html_php.htm, viewed 4/9/2008

    Follow

    Get every new post delivered to your Inbox.