Tuesday, April 29, 2008

PHP Understood!

I finally figured out PHP. The main issue I kept having was being unable to get any text to appear at all. Using the php command inside Terminal really helped find a few simple syntax errors I could detect without it. I didn't realize how loose php was for a scripting language and that it was literally embedded into code. My php code previously was before the entire html document so nothing would show up and I would only be able to see the text through terminal. The second solution I had to a problem was changing the value of each radio button. Previously I had them as the age range but then it occurred that I could just store them like an array with 0,1,2 for the values.

Monday, April 28, 2008

PHP hates me

I was unable to get the PHP script running, to be honest I'm not sure what my problem was. I was unsure as to process radio button data so I switch the format to a drop down menu because I thought it would be easier. At frst I could get text to appear using the echo command, but after tinkering around for an hour I couldn;t et it to appear with CSS, or without it. My code is posted below:
$age and $name are from the form page but it's strange that the first line of code won't even show on the screen even though there's no arguments to make it not work. I'm flabbergasted by this new and strange language, I looked up multiple tutorials on http://www.tizag.com/phpT/forms.php including:

forms and php
if statements

Overall I have failed at PHP and it's frustrating because it does not seem a very difficult structured language like Action-Script 3.0 which I already know.





$age = $_POST['age'];
$name = $_POST['name'];


echo "Congratulations".$name" you have passed the first test";

if ($age == "0-18")
{
echo "You are too young to be a member!";
}

if ($age == "18-65")
{
echo "Pay your standard dues!!";
}

if ($age == "65+")
{
echo "You get a 10% discount!";
}

?>

Sunday, April 6, 2008

CSS Poem format

During this in class I realized the importance of background images.I googled image serached "city aerial" to get the background image. At first I tried to have two seperate images, one for the city and one for the transparent box to house the text in. But instead by taking the photo into photohsop I was able to adjust the image and mask it to give it to the desired look and feel.


I also had trouble thinking that in CSS language I thought font-family was an attribute for css language. I looked up CSS font formatting at http://www.w3.org/TR/REC-CSS1#color, and found that it was the color that was the attribute I was looking for. This improved the legibility dramatically.


I also had trouble centering my main division. I again referenced the internet and found http://www.w3.org/TR/REC-CSS1#margin and found that I had to implement "margin:auto" to properly center the image even on scalign of the window.

«

I also found the html validator insides dreamweaver was an excellent tool or validating my webpage.



It was a lesson in the importance of properly implementing background images.



The poem can be found here: CSS Formateed Poem