Friday, May 30, 2008

The problem with free webhosting and clients

OK. PHP form magically started working again. This is both good and extremely mysterious...

I swear I haven't touch the code since yesterday (when it was working except wasn't sending emails). Yesterday I even tried it with the safe and tested code I was using the other day and it wasn't sending emails. Today - emails.

The reason it is mysterious: I sent off a message to the free site help desk ('My php form suddenly stopped working. I haven't changed the code. Is there a problem with your server?') and I actually got a reply this time! This is what they sent:
Hello,

No, we did not changed any server settings so the problem must be on your side.

Thank you,
www.000webhost.com

And - lo! By magic, the world is fine again. Perhaps my planets weren't in correct alignment. Mercury is in retrograde, and that's known to cause random electronic hiccups...

Anyway, client wants to meet to discuss the content in her site. ie what she should have on there. I should have just said 'no, I'm freaking busy at the moment, no time to sleep, little capacity to care re your site content' but I'm nice. Plus I am making her meet me at a coffee shop with my favourite coffee (Campos coffee. Its a lovely drop, even the most novice of barista usually manages to make a lovely cup of coffee out of it. Unless the coffee's been a bit over roasted. It did happen once. Toby's Estate is a close second. Can be touch and go - the better the barista, the better the coffee with that one. And it can get lovely. They have their 'warehouse' outlet cafe on City Rd, just off Broadway. You can get an awesome coffee there. Its not cheap, though.) But I digress....

Wednesday, May 28, 2008

PHP - yee haa!

Thanks to Daniel and Amber for all of their feedback over term. Thanks also to Amber for trying to sort out my PHP in class last night. But biggest thank you of all goes to Alastair for being so patient while we nutted out the php code for my form. It now works! Well, it refreshes the page, validates the email address and leaves a warning message if the email doesn't process properly, which is what I had been trying to make it do. Unfortunately all I ever see now is that error message. Even when i use the old code in the old form (the basic version). So all good re my project (except for tweaking the form layout to fit the warning messages and sorting out the IE/CSS issue). Except for solving the mystery as to why the PHP stopped working...might have to find another free web host....

Monday, May 26, 2008

Nobody loves me

In fact, I think Nobody is stalking me!!!
haha!!!

I obviously have the whole php email thing working fine from my site now. I've sent myself a heap of test emails, and they all say they are from 'nobody'. Small things amuse small minds...

So I got the whole css thing sorted out - thanks to Sarah (the aptly named) Champion and Linda from my Monday night class, who pointed out that php doesn't read css like html does... I'm torn between feeling like an idiot and feeling annoyed that this wasn't made clearer somewhere...like where were all he other ignoramuses on the web query sites asking the same questions? Actually, re the css problem, there were a couple of posts. This is the cure I used that sorted it all out:
http://www.webmasterworld.com/php/3243313.htm


Nifty trick...

And somehow the javascript is now working on my navigation buttons again. Its a bit slow (slower than the uni server) but it works!

Now, there are still a couple of things to do before this thing is actually properly ready for business. Firstly, i have to get the real content. I have to have a 'meeting' with my 'client' on Friday as she wants to chat about what she should write. Frankly, I don't care! I am like, put whatever the hell you want on this thing, once its done i never want to see it again! I'm obviously joking. Really. This being said I don't have the time to stop for freaking coffee meetings about things that won't actually affect my assignment marks at the moment. I am part thinking the whole real client thing was a bad idea. This being said, its good to have something to motivate me with its creation etc. Whatever.

Anyway, there are 2 things I need to sort out technically

1. the IE issue. But not before tomorrow

2. the form works, but it takes you to a confirmation page that is just a line of text saying 'email sent successful' or something. you need to back button to get back to the page you were on and then the email field is still filled in. I tried using javascript to verify the email address is a valid email address, and to clear the form but neither worked. i was going to play around with that tonight, but while i was looking for the css cure I stumbled upon this:

http://www.onlamp.com/pub/a/php/2004/04/22/php_css_forms.html?page=2

its a way to use php to verify the email and clear the field! Seeing as I'm using php anyway, I may as well give it a go...




Saturday, May 24, 2008

.........

So i changed the file extension to php and the file appeared, but the css and javascript won't work. At least now i know for sure my site looks fine if both of those are disabled.

I've been to the php and about sites re the php form, I thought, maybe with all of my fancy javascript attempts I've manged the basic html form. As far as I can tell, this is not the case, but its still freaking out about something. I've put the php in a separate file. I'll look at it again later. This is the link that works to the public site:
http://personaltrainer.web44.net/index.php

I've gone public...sort of...

Checked out the free web hosting at www.000webhost.com and it looked fine, even the domain name wasn't horrendous, so i signed up so I can start playing with the php part of the form that i wanted to do. Would be nice if the bloody site worked. Maybe they need time to scan the site to make sure its not dodgy. Anyway, I might check it again tomorrow, see if anything magically happens to it overnight...Than god it still works from the uni server or I would be freaking out right now...

So I've decided to leave the IE issue alone for now (planning to show it on Firefox to my team mates anyway on Tuesday), and I'm leaving the JS email validation alone now as well - I figure if I end up just sticking with the email sending the request from the user's computer for now, I shouldn't really be as worried re security/validation. I thought I may as well start on the php email generating thing instead. I think I may be starting to loose English. And no, I haven't been drinking (although I was supposed to be - in fact I was supposed to be out dancing tonight, and I LOVE dancing even more than drinking, but I have to work tomorrow, and I'm not talking homework. Bastards. Which means I also loose out on my Sunday coding session. I'm starting to enjoy those...)

This is where the site is supposed to be:
http://www.personaltrainer.web44.net/suesitehome.html

Wednesday, May 21, 2008

You wish you had red fingerless gloves, like mine...

Ok, the JS animated buttons seem to work (even though there's sometimes a short micro second delay while they load. I am using dial up. Shut up. Yes, dial up does still exist, and some of my client's clients might have it, so I like to think of it as a chance to do some real life in the field testing all by myself.)

As you can probably tell, I need to sleep. Before I go, the reason i am posting this was to make notes to myself. Just tried adding some JS validation script to my form. I got the whole thing in, and it validates, but doesn't actually work. Slight technical hitch...

Got the code from http://www.xs4all.nl/~sbpoley/webmatters/formval.html

Was also using this as a guide: http://www.elated.com/articles/form-validation-with-javascript/
as it seemed to have better step by step instructions than http://www.w3schools.com/js/js_form_validation.asp
which just gave you a bunch of script.

I chose to use the first link script as it gave a cool warning if your email address only had one letter after the @. I tried playing around with it, but i suspect I'm going to have to go back to the lecture notes or W3c schools tutorial on JS in order to do this successfully (yes, I admit I just started randomly changing the code, hoping I would instinctively be able to feel my way around a completely new language, now that I am in tune with my coding-self. This clearly completely failed. It appears you will still be able to call me Grasshopper for a while yet. Why, oh why wasn't i nicer to that JS coder in the bar the other week???)


*yawn*

Tuesday, May 20, 2008

Sometimes, its the simplest of solutions...

I'm unfortunately not talking about my IE issues solved, I'm talking about my JavaScript issues sorted - for now.

I checked out Alastair's suggestion re the CDATA 'hiding'/identifying code solution, but it wasn't the fix I was after. You see, I was trying to implement JS animation to trigger a mouseover jpg change for each of my navigation buttons. The problem with that was, the formula required me to use the name attribute to identify my images, and link them to the JS i needed to make this happen. The name attribute is fine - so long as you're using HTML 4.01 or XHTML transitional. Because I like a challenge, I planned to write my site in strict XHTML. I worked x-hard to make this so, and everything was wonderful and fine and valid, right up until now. I was weighing up the pros/cons re caving in on my principles and having the JS I wanted or sticking to my guns. As it turns out, I could do both!

I found one fix that sugested substituting 'id' for 'name'. It seemed to work (although who knows re IE). I then realised i had only found the code to make it work for one button on a page, no a whole navigation row. I tried to play with the code to make it work (and had a range of results from none working, to all changing when the mouse was anywhere near any button, to only one button changing no matter which button you hovered over). I decided to pass the question on to my brains trust (aka Google) and discovered some interesting information (http://www.programmingtalk.com/showthread.php?p=147625). I didn't even have to set the JS i the code - in fact I could ditch the start section altogether, as well as the id and name attributes! Just some simple inline script for each button. Voila! All functioning beautifully, fully compliant with W3c's strict XHTML and CSS rules! Yay!

Re the IE problem, Tim and I but borders around all of my divs at the end of class, and the page is looking a little less roomy.... I suspect IE is adding some padding somewhere (cheeky mongrels, as my mum likes to say), which is what is pushing the middle div down the page. As to why it's not reading my 'text decoration: none' request, it's anyones guess. But that's going to have to be one for another day. I don't have IE here at home and tomorrow I have a lot of Interaction Design work to catch up on!

Internet explorer is evil

According to Alesh Houdek (http://criticalmiami.com/2006/12/11/Fuckmicrosoft), if you type that statement into Google you will get over 1 million responses...and I have to say, I am now joining the bandwagon.

I know this is boring for everyone to hear, as coders have been complaining for years about the stupid state of affairs that exists where your code just doesn't look the same between browsers, even when you adhere to the strict web standards that were established for, what I assumed, was a good reason...but now, as a newbie to the world of code, I have to have my whinge...

After spending all of Sunday sorting out my code so it worked perfectly on Firefox and Safari, and I thought now would be the time to venture into the world of JavaScript...but Nooooooooo...just tested it in IE and it's all gone to hell. Back to the drawing board...

Sunday, May 18, 2008

There's a pink monkey on the end of my pen...

No, I haven't been partaking in recreational drugs or eating moldy bread, there really is a pink monkey on the end of my pen. It's one of those novelty pens with pink fluff and a creature stuck to the end of it. I bought it in London at a Paperchase store one lunchtime...but I digress...

So I've spent the afternoon faffing about with my CSS. Both of the links i posted previously were actually very useful. I found out that in all of my excitement re divs in divs, I had forgotten to put everything in a div - which went someway to clearing up the aligning problems I suddenly found myself with. Then text kept popping out everywhere so between Firebug and me putting a black border around my main text div, I finally worked out what was taking up too much space, and where I should actually be putting margins and borders (not where they were!). That was all great until Firebug bugged out on me. V annoying.

Anyway, that took most of the afternoon - going back and forward, making changes, things going wrong, me not remembering what I had changed, making more mistakes etc etc. Finally I got it all sorted out. Then I opened it in Safari and my world went the way of the pink monkey. So I spent another while faffing about, tweaking things until it looked OK in both browsers, I got rid of the table I'd used for the bottom navigation links (it turned out i really was going about things the hard way. I ended up learning a fair bit about tables in the end, although never managed to work out how to stay strict XHTML compliant and set the cell widths...) and now I think I'm done with the CSS! I'm actually reasonably happy with the way it looks. We'll see how things go when the real content turns up!

So I started to check out the JavaScript options. I want to have a 'mouse over' colour change for my navigation bar buttons. The plan was to use the home page again as th practice template and then roll it out. Had instant success borrowing some animation code from W3c schools, but it wasn't strict XHTML compliant! And it wasn't just becasue they'd used a couple of capital letters. I have to work out how to get around not being able to name the images I want to animate. I suspect I'm not going to just be able to borrow some code from somewhere, I'm actually going to have to learn how to use it as well...

My schedule in the system plan had me finished with JavaScript for the site this week. I suspect I'm going to have to find time to revise that deadline...not to mention go over all of my assignment deliverables so far. I need to incorporate all of the peer/tutor feedback.

Enough chatting - time to get back to JS...

IE sux

OK, so on Friday I went to show off my site to someone at work. I loaded it in my browser and what showed up looked like crap! I was sure I'd tested the site in IE before, but it was like half of the CSS worked. No idea why some did and others didn't. Now I have to consider how the hell I'm going to fix that all...

The link i posted the other day was sent to me by my brother. I posted it here as i knew i'd forget to check it out if i just left it in my inbox. After quickly scanning the sites, they look like they might be interesting, but not quite what I need right now.

What I need right now is to work out why on a couple of my pages, the divs are over lapping. My div within a div theory doesn't seem to be working on pages where the main text isn't long enough. To tell you the truth, I haven't compared my version of the three divs across the page set up to the suggested one. Might go and check out an expert's opinion now, to see what it is I'm doing wrong!

http://intensivstation.ch/en/templates/
http://www.brainjar.com/css/positioning/default1.asp

Wednesday, May 14, 2008

Another password...

Learned about the wonders of the RSS feed last night. Very cool concept, should be much easier to keep track of everyone's blog updates now. If only I could remember the bloody password for the account i created last night...

Started rolling out the CSS to all of my pages last night. On the pages i just had picture placeholders for, things kept popping out of place until I put the div within a div! Layer upon layer upon layer etc. Also, I don't feel so ashamed of my site now. I worked out how to centre the whole thing on a screen and suddenly it actually looks like a web page, not just a document I could have created in word or ppt etc. Still basic, but that's not a bad thing!

Also loved the little pixie colour identifier thing Sarah showed me. Handy little tool, I put a link on the side here for easy access.

Leaps and bounds, man, leaps and bounds...

If only things were working as smoothly in my Still Image presentation. I have these great ideas in my head, but its just not happening for me on screen. I managed to get the photoshop animation thing happening, but its just not smooth enough for my liking. Wish i knew flash :-(

Blogging about the wrong subject, sorry!

Sunday, May 11, 2008

Time flies when you're having fun...

OK, I've been coding for almost 9 hours now (except I did stop to have lunch with mum, and my bit of blog earlier today...). I keep having a-ha moments with CSS. Lots of faffing about today but my home page actually sort of all fits together now. Still needs tweaking (and the proper text/pictures) but I think my template is done!

I couldn't get things aligned and stuff was jumping about all over the place until I put it all in a big container. Suddenly things stayed in place. I'm going to have to go back and clean up some of my code though, I experimented all day and there were quite a few non-functioning attempts i think I've left scraps of behind...

I managed to resist looking to see how the experts have done the three columns of text without tables. I suspect I've done it the hard way, and there were moments today where I was questioning why i was bothering to reinvent the wheel again, but now I'm done, I feel I actually get it. I know my page isn't the most exciting and creative thing I've ever seen, but I'm bloody proud of it, actually. Not bad for a first go. Besides, its only an intro page for a small business. Must try to keep things in perspective :-)

I might check out the proper way to do it tomorrow...now I need to get back to the ordeal that is photoshop...who would have thought I would ever have said that!

How to impress boys (nerds) in bars...

All these years I've been working on my pool playing skills and refining my ability to throw back shots of alcohol like they're water, and all you need to impress boys in bars are a few well placed phrases in conversation...

A few weeks back, while out on a Friday night with the girls, i met a group of men in a bar in darlinghurst. It turned out they were software developers or something. Had some interesting conversation and many cocktails....

I bumped into them again on Friday night, and one of them, who I'd barely spoken to last time, remembered me purely because I had previously mentioned my fondness for Macgyver during my younger years. He queried what I was doing this weekend and I told him of my plans to code CSS, I've never seen someone get so quietly excited about stumbling upon a kindred spirit before. It was charming! He told me about a group of coders meet around darlinghurst every month. Apparently anyone can just rock up, and everyone just sits around drinking coffee and coding. I told him I really was a novice and would feel way too intimidated to turn up in a group like that, but he said they'd be cool. I get the impression they'd just love it if someone wanted to talk about coding with them... Anyway, he muttered something about feeling overwhelmed by all the people contact in the bar, and that he needed a computer or something and disappeared before I got a chance to give him my number...shame. He was cute and smart, just the way I like 'em...

So I've been having a crack at this CSS stuff and really liking it! I'm not creating grand art works or anything - yet! I've still been working on my site's home page (as a template), with most of the css in an external style sheet. I've been working my way through the W3schools tutorials and just applying bits I want to try. I'm going to try to do it all myself rather than visit one of those sites that give you all the layout code. Unless I get stuck.

Anyway, can't chat, coding...

Tuesday, May 6, 2008

Lotto winner!

I was having such a crap day yesterday I thought - maybe all of my luck has gone elsewhere, so I did something I never do - bought a ticket in the Oz lotto. And I won! I got 3 numbers and a supplementary, which means I probably won enough to buy myself a sandwich at lunchtime tomorrow....I can feel the tide turning...

Tonight's class was about JavaScript. I enjoyed it as I am supposed to be including JavaScript in my final project and despite the fact that I researched it when I wrote the micro/macro thing, it all looked Greek to me. When we looked at it during the overview earlier in the semester, I hadn't got my head around XHTML and CSS yet, so it just looked like extra, confusing letters and symbols. The good news is after tonight, I sort of get it. I honestly felt my brain stretching when Alastair was going through it, but that whole thing re the full stop being the point that separates the action from the thing being acted on makes it easier of me to interpret the code. I'm not saying I'm ready to go out and start scripting like crazy, but I think I could at least read what I might end up borrowing for my project...

I also found it really useful having a chat with Alastair re my options for forms on my site. I think I should have swallowed my pride and started asking questions a long time ago...also helpful was his review of my micro/macro analysis with some useful feedback. Not to mention Wang Wei's feedback! That was a lovely surprise, with some constructive feedback as well as some kind words. Now I just have to find time to go back and amend the analysis...

I finished the XHTML pages for my final project on Sunday. Except for the navigation bar. Both top and bottom. I am thinking about having the navigation bar stay in place at the top of the page, by anchoring the div, but not sure if I should then not bother to put the old style link navigation along the bottom of the page. And what's the story with copyrights or disclaimer things at the bottom of the page? I clearly don't have copyright on the page. But maybe the client does with her logo? NFI...

Anyway, I thought the navigation bar was going to be a series of pictures (buttons) with links. Then I noticed the 'buttons' in the JavaScript examples tonight, set up as an ordered list and wondered if that's how I should have it set up. I whacked them in there like that for the mean time, plus divided up the XHTML into what seemed like logical divisions (incl naming them). Well, on the home page, anyway. It's going to be my test case - once I've worked out what I'm doing on that, I'm going to roll it out to the other pages.

I have to say, I think there's a latent nerd in me. I'm starting to enjoy the coding - even more than photoshop at the moment, as I feel more confident about fumbling my way through the code, or at least confident enough to know where to look to find out what I'm doing wrong. Photoshop on the other hand is just a vast, mysterious set of tools - they seem like they could probably do some interesting things, if I just had some time to faff about with them for a few days to work out what that is exactly...

I've also discovered I quite enjoy blogging. I might just have to start one of these up once this semester is over...sure beats a paper diary...

Sunday, May 4, 2008

And the XHTML begins...

re the last class - I quite enjoyed it, actually. I've set up and looked after databases before (when Tim asked he class if there was anyone that had been a database administrator, I hadn't even thought that might apply to myself, but I guess it does...). This being said, my databases weren't quite as complex as the video store example we worked through on Tues night.

It was a great way to get your head around how everything linked up, and how many tables to make etc. I found the exercise reading the table out strangely useful (not to mention challenging, I keep trying to go back to the 'pretend its a blind person on the phone you are describing it to' thing, yet still struggling not to miss things out). The whole arrow over the box thing also confused me slightly - which one to use when etc, but Tim had a go explaining it again, so I think I get it now...I suspect some trial and error using it in practice is what will gel it in my head!

I was absolutely horrified in class to find out we were allowed to submit out work in valid XHTML - of any kind!!! I was sure there was something, somewhere that said it had to be strict...why else would i have picked that? If Eric hadn't also been under the same impression, I would feel way worse. I think of that first assignment I banged my head against the wall over - it probably would have gone through fine with transitional XHTML! Oh well, at least now i get the strict one, which should mean I can write any of them...like learning to drive a manual car...

The older I get the more I'm realising the worth in planning things out before launching into the build, as far as saving time, long term. Especially when you aren't 100% sure of what you are doing. It certainly seems to be true of all of the subjects I'm doing this semester. Lots of planning going into things. This being said, I started building the XHTML for my final project today. Need work out the whole form issue ie how I'm going to do it all. I'm also thinking about adding a comments page on the last page. But is this something that should be moderated somehow? ie how I am going to set it up so Sue can take off any comments that might be wrong for the business? Will they just send the comments to her and she can decide what to post? How will she pot them if I do that? Decisions, decisions...but first, system plan peer review time...