/bt2201-php_variables

For the BT2201 PHP workshop

Primary LanguagePHP

BT2201 Task PHP Variables

Introduction

Overview

This week we'll start using PHP. I have created a file calles variables.php for you to work in.

Remember that the server will only check if there is php code in a file if the file extension is '.php'.

Editing

The quick way...

If you like you can edit files directly in GitHub's web interface. This is a very convenient way of creating and editing the files.

To test your files you should upload them to your web space on bimserver2.com.

The preferred way...

The preferred way of working is to create and edit the files on your own machine.

To get the repository to your own machine you can use GitHub Desktop or link your GitHub account to PHPStorm (there are many more ways but these two are very convenient).

  • You then upload these files to bimserver2 for testing.
  • You commit changes and push the commits to your GitHub account to create a history of the changes over time.
  • You can work on several machines and use commits as a way of keeping the files on different machines up to date.

Task

Below is today's task.

Create a script which will 'echo' the sentence found below, but instead of echoing ??s you should echo variables that have appropriate values stored.

Hello, my name is ?? and I am ?? years old.

I come from ?? and I like ?? and ??.

Example:

Hello, my name is Matthias and I am 43 years old.

I come from Bavaria and like computers and stationery.

  • Add the final URL on bimserver2.com to the comment at the top of your files, like we did on the previous week.
  • Give the page(s) a meaningful title (<title></title>).
  • Upload the file(s) to your area on bimserver2.com.
  • ☞Content, file and folder names are up to you.

You are welcome to copy and paste HTML from my lecture slides, but the quotes might need changing from opening double quotes (“) and closing double quotes (”) to straight double quotes (").

Commit early, commit often - that way you can go back if you have made a mistake and I can see all the work you have done. There's no problem if you commit and there's a mistake in your file.

Once you are done be sure to commit your changes (that will save them to the repository) and to push them to GitHub (so that I can see the work you have done).

This task is part of your first assignment.

As this task is part of the first assignment you should work individually, not with other students, and shouldn't show the final version of your files to other students, e.g. on the module discussion board.