Here are the links to the files, and also a few comments about the process.
1). PHP Example
http://www-student.it.uts.edu.au/~twade/pracs/week7/echo.php
This one was quite simple. I just copied the file onto my web server and it worked :-)
2). Guestbook
http://www-student.it.uts.edu.au/~twade/pracs/week7/gb.php
Here's the steps I followed to get my guestbook working:
- Created a table in phpmyadmin, using Alastairs SQL query (comments in gb.php)
- Added my server name, database name, user name and password to the variables in gb.php
- Uploaded the file to my web server
To begin with, we were concerned about saving our SQL password in the php file, but after talking to Alastair remembered that the password wouldn't be displayed in the file online, as the web server runs the php scripts first, and then only presents the html code when someone tries to view the source code.
To make the prac simpler, I decided to work on the UTS web server. I might try the same exercise on my 000webhost account, to compare the phpmyadmin tool.
3). Guestbook with Country field added
http://www-student.it.uts.edu.au/~twade/pracs/week7/country/gb.php
Here's what I did to add a new field callled "country"
- Added a new field called "country" to the table in phpmyadmin, and edited the existing record (adding country details)
- Looked for all references to the field names in gb.php, and added the new field "country" in a similar manner.
I haven't done the extra challenge yet, might do it later from home.
No comments:
Post a Comment