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...