Home
ReView: Final Report
Contents
1. Ea Skr ir hestar x F ingam mer Skr ningardagur 5 22006 Nafn r lr i N mer Fa ir 7 Holl _ Fa ir ix Ytid til ad setja mynd M ir Umr ma ur Ver Knapi B Athugasemdir N r litur N ir foreldrar SE usta Gd G I Record 4 4 lof2 gt gt I ET S No Filter Search Picture 2 the old interface in Access f 7 _ ReView Final Report In this project the user will be able to print out or save down on the desktop to review later ready made reports search the database for the information required and make some changes When user is entering information into any form the program is constantly checking if the user has entered similar information before and when the user submits it there will be performed a check to determine if the user has filed that particular information before If the user has done that there will be message which confirms it otherwise the user will be able to view the data to confirm everything is correct and then confirm it to send it to the database In the event the user gets the message that the horse has already been registered he will have 2 option to go back and check the data he typed in again and fix that or discontinue and end on the main page The project is made for the individual computer That means each user will have their own copy of the database with an interface Given time and more pe
2. 5 Click Next wae GETI The MySQL Monitoring and ana Automated monitoring and notification of all your MySQL servers Over 70 database best practice rules ensure uptime and fast performance ReView Final Report 6 Leave the check on for Configure the MySQL Server now and click next Wizard Completed Setup has finished installing MySQL Server 5 0 Click Finish to exit the wizard Configure the MySQL Server now Use this option to generate an optimized MySQL config file setup a Windows service running on a dedicated port and to set the password for the root account lt Back Cancel Welcome to the MySQL Server Instance Configuration Wizard 1 0 8 The Configuration Wizard will allow you to configure the MySQL Server 5 0 server instance To Continue click Next 8 Select Detailed Configuration and click next He 104 ReView Final Report MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please select a configuration type Detailed Configuration By Choose this configuration type to create the optimal server setup For this machine O Standard Configuration Use this only on machines that do not already have a MySQL server installation This will use a general purpose configuration For the server that can be tuned manually 9 Select Developer Machine and click Ne
3. while the rows are not empty get them into variable while Sf mysql fetch array filelist print them out in the table gt lt tr valign top gt lt td gt lt php echo Sf id gt lt td gt lt td gt lt a href photoS php action view amp id lt php echo Sf id gt gt lt php echo Sf filename gt lt a gt lt td gt lt td gt lt php echo Sf mimetype gt lt td gt lt td gt lt php echo Sf description gt lt td gt lt td gt lt a href lt php echo _SERVER PHP_SELF gt action del amp id lt php echo Sf id gt onclick return confirm Delete this file gt Delete lt a gt lt td gt lt tr gt z P_ ReView Final Report lt php else or if the number of rows is empty tell the user that it is empty gt lt tr gt lt td colspan 3 gt No Files lt td gt lt tr gt lt php gt lt table gt lt php include footer php gt n J ReView Final Report 20 photoS php lt php include db inc php if isset _GET action action _GET action else Saction if Saction view and isset _GET id Sid _GET id User is retrieving a file Ssql SELECT filename mimetype filedata description FROM filestore WHERE id Sid Sresult mysql_query Ssql if Sresult exit Database error mysql_error Sfile mysql_fetch_array
4. f 3 PP ReView Final Report lt td gt lt php echo _POST ffnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of father lt td gt lt td gt lt php echo _POST fname gt lt td gt lt tr gt lt tr gt lt td gt Mothers ID number lt td gt lt td gt lt php echo _POST mfnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of mother lt td gt lt td gt lt php echo _POST mname gt lt td gt lt tr gt lt tr gt lt td gt Personnel lt td gt lt td gt lt php Sperson gets the data chosen in the drop down list and determines if the variable is an array if is array POSTI person looping through the values in the array foreach _POST person as Sperson echo Sperson lt br gt else echo No person was selected gt lt td gt lt tr gt lt tr gt lt td gt Location lt td gt lt td gt lt php echo _POST location gt lt td gt lt tr gt lt tr gt lt td gt Notes lt td gt lt td gt lt php echo _POST notes gt lt td gt lt tr gt lt table gt lt p gt lt input type submit value Submit name submitHorseData gt lt p gt lt form gt lt ul gt lt p gt lt br gt lt p gt lt php first check if the variable is set if it is not set the user must go back and enter the fnumber because it will return error messages if isset S_POST fnumber day POST
5. SvarText do the following loop for each horse chosen by the checkbox for Si 0 Si lt Show_many i get the value from the checkbox SvarCheckbox Sbox Si get the value from the text box SvarText Stext Si create the query Ss SELECT FROM hestur WHERE fnumber SvarCheckbox send the query Slist mysql query s if the query is not good if Slist print an erro message exit Database error mysql_error check if the results return anything if mysql_num_rows Slist gt 0 send the data from an array to a variable while SI mysql_fetch_array Slist 55 It ReView Final Report print out all the data gt lt table gt lt tr gt SvarText gt lt u gt lt b gt lt td gt gt lt u gt lt td gt lt tr gt lt td gt lt b gt lt u gt Nr lt php echo Si 1 gt Group lt php echo lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Registration date lt php echo SI day gt lt td gt lt tr gt lt tr gt lt td gt lt td gt lt tr gt lt tr gt lt td gt ID Number lt td gt lt td gt lt php echo SI fnumber gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt
6. check if the number of rows is empty if mysql_num_rows Slist gt 0 while there is data in the resulting array while 1 mysql_fetch_array Slist print out this table s jh ReView Final Report gt lt tr valign top gt lt td gt lt php echo SI id gt lt td gt lt td gt lt php echo SI litur gt lt td gt lt if the user wants to delete from the database gt lt td gt lt a href lt php echo _SERVER PHP_SELF gt action del amp id lt php echo Sl id gt onclick return confirm Delete this colour from the database gt Delete lt a gt lt td gt lt tr gt lt php else gt lt tr gt lt td colspan 3 gt No colours in database lt td gt lt tr gt lt php gt lt form gt lt table gt lt php include footer php gt s PP ReView Final Report 8 personnel php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file personnel php Connected files registration php the registration form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database check php the complete list of horses in database Function to register any personnel that is are needed around the horses
7. e The ID number is a 12 digit string e g IS2008286801 This must be filled in for the registration to be successfully concluded e The Name is the name of the horse e The Colour is the just that the colour of the horse The user must have created the colour before e The Fathers ID number is the id number as is with the ID number mentioned before and shown in the table at the side along with the Name of father which is the name of the horse father These information can be seen ina table to the side provided that the horse has been registered before as potential parent e The Mothers ID number is the id number as is with the ID number mentioned before and shown in the table at the side along with the Name 84 Je ReView Final Report of mother which is the name of the horse mother These information can be seen in a table to the side provided that the horse has been registered before as potential parent e Personnel is the owner of the horse e Location is where the horse is situated e Notes can be any text that is 255 characters long This can be any information about the horse i e owner history other shows he has been at etc e Price is the rough price the owner puts on the horse The tables at the side get their information from the Linage registration form and hold information about potential parents s jh ReView Final Report b Linage ReView registration and viewing webpage Mozilla Fi
8. lt input type submit value Submit name submit gt lt input type reset value Clear name clear gt lt p gt lt form gt lt ul gt lt p gt lt br gt lt p gt lt Male horses table holding informations gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt table border 1 cellpadding 5 cellspacing 0 bordercolor 000000 gt 44 A ReView Final Report lt tr gt lt th gt Gender lt th gt lt th gt ID number lt th gt lt th gt Name lt th gt lt th gt Owner lt th gt lt th gt Location lt th gt lt tr gt lt php check if the variable action is set and get it if isset S_GET action action _GET action else Saction if the data in the variable is edit if Saction edit echo elseif Saction del and isset _GET id if the data in the variable is del and id is set get the id Sid _GET id create the query SsqlDel DELETE FROM father WHERE id Sid send the query and print results if mysql query sqlDel echo lt p gt Your horse has been successfully deleted from the database lt p gt echo lt p gt Press lt a href line php gt here lt a gt to return lt p gt else or print error message echo lt p gt There is a problem mysql_error lt p gt header location _SERVER PHP_SELF the messages have been output
9. PHP_SELF has printed out all relevant messages and terminates the script exit gt lt the form for the page gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt p gt lt h2 gt The following horses are registered in the database lt h2 gt lt p gt lt the table for the data gt lt table border 1 cellpadding 5 cellspacing 0 gt lt tr gt lt column headers gt lt th gt lt th gt lt th gt Date lt th gt lt td gt lt td gt lt th gt ID number lt th gt lt th gt Name lt th gt lt th gt Location lt th gt lt th gt lt th gt lt th gt lt th gt lt tr gt lt php get all the data from table hestur query created Ssqlh SELECT FROM hestur send the query Slist mysql query sqlh if the results are not good if Slist exit Database error mysql_error if the number of rows is zero if mysql_num_rows Slist gt 0 get the data in the array into a variable while SI mysql_fetch_array Slist print out the results gt lt tr valign top gt lt td gt lt td gt lt td gt lt php echo SI day gt lt td gt lt td gt lt php echo SI id gt lt td gt lt if the user wants to view the information about the horse gt lt td gt lt a href lt php echo _SERVER PHP_SELF gt action view amp fnumber lt php echo SI fnumber gt gt lt php echo SI fnumber gt
10. Price 150000 1 An example here would be 1 which would be picture with id 1 in table Filestore 2 Litir id litur Description 1 Grar Jarpur NULL 2 Bleikur Kind of white 3 Personnel id name address phone gsm notes runn 1 L kjarbotnum NULL 1 NULL 2 NULL Gu laugsd ttir 1 Here an example would be 487 5489 2 Here an example would be 868 4022 n jh ReView Final Report 4 Father Id 1 ID number IS1986186055 Name Orri Gender Male Colour Unkown ID number father IS1982151001 Name of father Otur ID Number mother IS1983284555 Name of mother Dama Ownerid Unknown phone NULL Location bufa 5 Mother Id 1 ID Number IS1990286807 Gender Female Name lfhei ur Bj rk Colour Bleikur ID Number father IS1986165509 Name of father Bliki ID Number mother IS1983287806 Name of mother Hekla Mj ll Ownerid Unknown phone NULL Location L kjarbotnum n Jh ReView Final Report Appendix D User Manual 1 About project This is a final year project done at the University of Akureyri with the supervision of Nik Whitehead The final year project is a project that stretches over two semesters in the year 2007 to 2008 autumn and spring This project has between 2 and 3 year prelude where it was started by some interface creation in M
11. That means that it loops over the array given by array_expression On each loop the value of the current element is assigned to Svalue and the internal array pointer is advanced by one so on the next loop you ll be looking at the next element PHP Hypertext Preprocessor 2007 The problem had with the image upload implementation was that did not have enough time to put my absolute attention to it would have to find a way to limit the sizes of the images which types are put in and make sure that there is some difference from the names so that when there is a file that has the same name as file inserted earlier that there will be no problems with duplication in the database However there is no worry about which types will be put in as they will be either gif and or jog and or jpeg There is that problem about order of horses in the report section If the user has decided that horse number 1 will be in group A horse number 3 in group B and horse number 10 in group A then that will be the order of the horses ABA This is a matter of taking an input compare it to other inputs group them together and print them along with the horse the input was at along with it This has been given much thought but has not been successfully solved Ideas that were tried but either did take too much time or simply did not work were to take the data sent i e the ID number sent by the checkbox and the input the user put in the text box put it
12. The user must have created the colour before e The Fathers ID number is the id number as is with the ID number mentioned before and shown in the table at the side along with the Name of father which is the name of the horse father These information can be seen ina table to the side provided that the horse has been registered before as potential parent _ 86 ReView Final Report e The Mothers ID number is the id number as is with the ID number mentioned before and shown in the table at the side along with the Name of mother which is the name of the horse mother These information can be seen in a table to the side provided that the horse has been registered before as potential parent e Owner is the owner of the horse e Location is where the horse is situated e Contact is where any contact information from the owner caretaker or where the horse is located is put c Colour The Colour form is the simplest The user has to write in the name of the colour and submit it If he wants to he can write a short description of the colour ReView registration and viewing webpage Mozilla Firefox File Edit View History Bookmarks Tools Help 4 i C http ocahost finav newcolor php Getting Started EX Latest Headines ReView Registration an Li ReView registration an Sports BostonHerald amp HOME ReView registration an J ReView registration and v a Mon 07th of Apr 2008
13. div gt lt div id right gt lt break for content gt 3 footer php lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file footer php Connected files 3rd part of the front page Function the file holds the footer of the page gt lt end of content gt lt div gt lt div id foot gt lt p class sright gt Copyright 2007 2008 lt a href mailto olafurhannesson gmail com gt Olafur Hannesson lt a gt All rights reserved lt br gt lt br gt lt p gt lt div gt lt body gt lt html gt 4 index php lt php include main php gt lt l Author lafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file index php Connected files 2nd part of the front page main php the outlook of the page and menu footer php the footer of the page Function this is the front page of the project gt lt p gt lt h1 gt lt center gt Welcome on the hompage of lt center gt lt h1 gt lt p gt lt p gt lt center gt lt img src main1 jpg border 0 width 500 height 602 align absmiddle gt lt center gt lt br gt lt p gt lt php include footer php gt o Jh ReView Final Report 5 registration php lt php include main php include db i
14. lt a gt lt td gt lt td gt lt php echo SI name gt lt td gt lt td gt lt php echo SI location gt lt td gt lt if the user wants to edit the information about the horse or delete the horse gt lt td gt Edit lt a href lt php echo _SERVER PHP_SELF gt action del amp fnumber lt php echo SI fnumber gt onclick return confirm Delete this horse from the database gt Delete lt a gt lt td gt 70 h ReView Final Report lt tr gt lt php else if there are no horses in the database gt lt tr gt lt td colspan 3 gt No horses lt td gt lt tr gt lt php gt lt form gt lt table gt lt br gt lt p gt lt p gt lt php include footer php gt Af ern Jh ReView Final Report 19 photo php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file photo php Connected files main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database Function to keep up to data a list of photos and information gt lt this file allows the user to put and maintain a image gallery the user can delete from the list or view the pictures gt lt php an action declaration created an
15. lt td width 100 gt lt b gt Location lt b gt lt td gt lt tr gt lt tr gt lt td gt lt php gets the data to search for Ssearch _POST search gets which column to look in Sfields _POST fields the query is sent to the database Sresult mysql query SELECT FROM hestur WHERE Sfields LIKE S search LIMIT 0 250 query details table begins while row mysql_fetch_array Sresult gets the data from each row Sid Srow id Sfnumber Srow fnumber Sname Srow name Sffnumber Srow ffnumber Sfname Srow fname Smfnumber Srow mfnumber Smname Srow mname Slocation Srow location table layout for results echo lt tr gt echo lt td gt Sid lt td gt 5 PA ReView Final Report echo lt td gt Sfnumber lt td gt echo lt td gt name lt td gt echo lt td gt Sffnumber lt td gt echo lt td gt Sfname lt td gt echo lt td gt Smfnumber lt td gt echo lt td gt Smname lt td gt echo lt td gt Slocation lt td gt echo lt tr gt these are the results if there is no data found if Sid echo lt table gt echo No Record Found to search again please close this window gt lt table gt lt php include footer php gt 66 It ReView Final Report 18 check php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final chan
16. php echo _POST fname gt lt td gt lt tr gt lt tr gt lt td gt Mothers ID number lt td gt lt td gt lt php echo _POST mfnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of mother lt td gt lt td gt lt php echo _POST mname gt lt td gt lt tr gt lt tr gt lt td gt Personnel lt td gt lt td gt lt php checks if data is an array iterates through it and sends to a variable if is array POSTI person foreach POSTI person as Sp echo Sp lt br gt else echo No person was selected gt lt td gt lt tr gt lt tr gt lt td gt Location lt td gt lt td gt lt php echo _POST location gt lt td gt lt tr gt lt tr gt lt td gt Notes lt td gt lt td gt lt php echo _POST phone gt lt td gt lt tr gt lt table gt lt input type submit value Submit name submit gt lt form gt lt php checks if the data for fnumber has been set if isset S_POST fnumber gets the data and puts it into variables Slid c Sgender g Sfnumber _POST fnumber name POSTI name Sffnumber _POST ffnumber Sfname _POST fname Smfnumber _POST mfnumber Smname POSTI mname Scare Sp f ss ReView Final Report Slocation POST location Sphone _POST phone if fnumber is empty if Sfnumber an error messages are printed out e
17. ReView Final Report 15 Select Install as Windows service and pick the service name from the drop down list and select Include Bin Directory in Windows PATH and click Next MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please set the Windows options Install As Windows Service This is the recommended way to run the MySQL server on Windows Service Name MySQL lv Launch the MySQL Server automatically Include Bin Directory in Windows PATH Check this option to include the directory containing the server client executables in the Windows PATH variable so they can be called from the command line J 16 Because this is for development purposes as we picked earlier in step 9 we pick some easy password for example admin While many recommend selecting the option Enable root access from remote machines did not select that option The user needs to decide for himself on that click Next MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please set the security options Modify Security Settings New root password a Enter the root password Lroct Confirm EER Retype the password C Enable root access from remote machines a Create n Anonymous Account This option will create an anonymous account on
18. Scfg Servers Si connect_type tcp Scfg Servers Si compress false Scfg Servers Si auth_type config Scfg Servers Si user root Scfg Servers Si password admin gt 4 If you go to your browser and type in http localhost phpMyAdmin you should see the phpMyAdmin start screen Af 110 PA
19. Sresult if Sfile exit File with given ID not found in database Sfilename Sfile filename Smimetype Sfile mimetype Sfiledata Sfile filedata Sdescript Sfile description Sdisposition inline header content disposition Sdisposition filename Sfilename header content type Smimetype header content length strlen Sfiledata echo Sfiledata exit else exit File with given ID not found in database gt lt table gt lt body gt lt html gt f 5 P_ ReView Final Report 21 about php lt php include main php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file about php Connected files main php the outlook of the page and menu footer php the footer of the page Function about the project gt lt p gt lt h1 gt lt center gt About lt center gt lt h1 gt lt p gt lt p gt This is a final year project done in the 2007 2008 semesters The project was actually started 2 3 years ago when was asked to create a database with an interface lt br gt Microsoft Access was chosen and the database was made That database did not work out as it should be and was abandoned later Autumn 2007 was looking for a project to do as my final year project in Computer Science at the University of Akureyri O
20. and contact information the retail table holds the information about the retail shows i e if it has a name location and date Litir holds information about the unique coat colours the Icelandic horse has the colours name and in some cases a description In a window on the interface the user can put ina information about horses he has either sold to another or bought somewhere and the data goes into the tables sala and kaup The tables are almost identical and could be set into one table This is one ReView Registration and Viewing webpage Mozilla Firefox Loe Eile Edit view History Bookmarks Tools Help v zi a LJ http f localhost finallindex php x G A 2 palm Sky Sports Live Score 7 Firefox and Mozilla Links fan LO Quick Searches W Main Page Wikibooks 4 sjonvarp is Cascading Style Shee PHP Manual B Chapter 1 General I _ Re iew Registration and iewing G Sun 13th of Jan 2008 i i 19 02 32 PM VELKOMIN HEIMAS U Tenglar Skr ning Sko a hesta Leit A rir tenglar Fengur Copyright 2007 2008 Olafur Hannesson All rights reserved Done Picture 3 The initial interface 1 Browsers do not necessarily use the same MIME type for files For example uses Mozilla image jpeg for jpeg images while Explorer uses image pjpeg 12 A ReView Final Report of the cases of how may change things as the project goes on The same a
21. and the script is terminated exit get all the data from table father SsqlFather SELECT FROM father send the query SlistMe mysql_query SsqlFather if the query doesn t return results print out error message if SlistMe exit Database error mysql_error if the number of rows is null if mysql_num_rows SlistMe gt 0 get the result row as array and return to variable while m mysql_fetch_array SlistMe get the value from the array and print the results in a table gt lt tr valign top gt lt td gt lt php echo m gender gt lt td gt lt td gt lt php echo m fnumber gt lt td gt lt td gt lt php echo m ownerid gt lt td gt lt td gt lt php echo m location gt lt td gt lt td gt Edit s jh lt td gt lt php echo ml name gt lt td gt ReView Final Report lt a href lt php echo _SERVER PHP_SELF gt action del amp id lt php echo Sm id gt onclick return confirm Delete this personnel from the database gt Delete lt a gt lt td gt lt td gt lt br gt lt td gt lt tr gt lt php else if the number of rows is null print out message gt lt tr gt lt td colspan 3 gt No horses lt td gt lt tr gt lt php gt lt table gt lt br gt lt br gt lt Female horses table holding informations gt lt table border 1 cellpadding 5
22. but is necessary because when the user uses a drop down button checkbox or a radio button can show the information registered under that button checkbox given that use a select statement to bring it out from the database The table Hestar is the main table in the database In the table store the information about the horse itself The user files some of the information about the horse himself but the table Litir is passed by reference just as information from tables owner and filestore fnumber is the unique identification number for the horse name is just the name of the horse if it has one ffnumber fname and mfnumber mname are the identification numbers and the names for the horse parents litirid is the id from litir table and basically is a reference for the colours ownersid is id from the table owner Location is where the horse is located since the owners often have some one else taking care of the horses for them notes means just that notes There the user can set some observations or something like that filestore is passed by reference and is a reference to the pictures for the horse The table filestore stores the pictures The id is an auto incremented number filename is the name of the picture but here it is more important than ever to have unique names on the files description allows the user to put in a description on the picture The last two mimetype and filedata are bit trickier Let s start with mimetype MIME stand
23. cellspacing 0 bordercolor 000000 gt lt tr gt lt th gt Gender lt th gt lt th gt ID number lt th gt lt th gt Name lt th gt lt th gt Owner lt th gt lt th gt Location lt th gt lt tr gt lt php check if the variable action is set and get it if isset S_GET action Saction GETT action else Saction if the data in the variable is edit if Saction edit echo elseif Saction del and isset _GET id if the variable is del and the id is set get the id Sid _GET id create a query sqlDelM DELETE FROM mother WHERE id Sid send the query and print message if successful if mysql_query SsqlDelM echo lt p gt Your horse has been successfully deleted from the database lt p gt echo lt p gt Press lt a href line php gt here lt a gt to return lt p gt else print out error message echo lt p gt There is a problem mysql_error lt p gt header location _SERVER PHP_SELF the messages have been output and the script is terminated exit get all the data from the table mother Ssqlf SELECT FROM mother 46 ReView Final Report send the query SlistFe mysql_query Ssq f if the query doesn t return results print out error message if SlistFe exit Database error mysql_error if the number of rows is null if mysql_num_rows Slist
24. else leave a message that there are no horses in the database exit There are no horses in the database gt f 1 Jh ReView Final Report 15 excel php lt php include db inc php Author Olafur Hannesson Date final changes and commenting 05 05 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file excel php Connected files mainReport php restriction sent db inc php the connection to the database Function to show a list of all horses depending on restriction chosen by the user Output an excel spreadsheet gi the type we are outputting header Content Type application vnd ms excel SfieldChosen gets the data chosen in the drop down list and determines if the variable is an array if is array POSTI fields ooping through the values in the array foreach _POST fields as SfieldChosen insert the data into a variable Sfields SfieldChosen else print out a message if there is no restriction selected echo No restriction was selected the query is sent to the database Sresult mysql_query SELECT FROM hestur ORDER BY Sfields if the query is not good if Sresult print an erro message exit Database error mysql_error check if the number of rows is null if mysql_num_rows Sresult gt 0 get the data from the array while I mysql_fetch_array Sresult print out the d
25. found in the database with name identification number owner contact information and location When the user was viewing the list of all the horses he ticked a checkbox right next to the name of the horse he will be able to print out a conclusive list of those horses These three reports are perhaps the most useful to have but there may be others added The reports will be done in either plain text format or in a PDF document depending on which the user wants Time permitting will put in place a function that allows the user to import files of certain formats e g plain text files word documents excel files and outlook files and fulfil certain criteria of how the data in them is set up If we go back to Table 1 on page 7 that would be preferred outline for the function to get the data from If not in that setup then there may be a way to implement a way to use MySQL to take each string and compare them to an example that exists in the tables However that way it will take much more time to import each file and depending on how many registrations are in each file will be very heavy for the project to do also because there might exist some data in the database the comparison must be to check the import data against the data already in the database Among the last things to do with this project is to have this transformed into a website in a box That means that the web interface the database and Apache will need to be installed onto
26. gt lt the file allows the user to register any person and keep a data about them gt lt the form the user must fill in gt lt p gt lt h1 gt The following personnel have been inserted into the database lt h1 gt lt p gt lt ul gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt table cellspacing 10px gt lt tr gt lt td gt Name lt td gt lt input type text size 26 maxlength 256 name name gt lt tr gt lt tr gt lt td gt Address lt td gt lt input type text size 26 maxlength 256 name address gt lt tr gt lt tr gt lt td gt Occupation lt td gt lt input type text size 26 maxlength 256 name occupation gt lt tr gt lt tr gt lt td gt Email address lt td gt lt input type text size 26 maxlength 256 name email gt lt tr gt lt tr gt lt td gt Phone lt td gt lt input type text size 26 maxlength 256 name phone gt lt tr gt lt tr gt lt td gt GSM lt td gt lt input type text size 26 maxlength 256 name gsm gt lt tr gt lt tr gt lt td gt Notes lt td gt lt input type text size 26 maxlength 256 name notes gt lt tr gt lt table gt lt p gt lt input type submit value Submit name submit gt lt input type reset value Clear name clear gt lt p gt lt form gt lt ul gt lt p gt lt br gt lt p gt lt php to see if the user has filled in the name which
27. gt lt td gt lt td gt lt php echo SI name gt lt td gt lt td gt lt php echo SI address gt lt td gt lt td gt lt php echo SI occupation gt lt td gt lt td gt lt php echo SI email gt lt td gt lt td gt lt php echo SI phone gt lt td gt lt td gt lt php echo SI gsm gt lt td gt lt td gt lt php echo SI notes gt lt td gt lt if the user wants to delete a person from the database seeks confirmation gt lt td gt Edit lt a href lt php echo SERVERI PHP SELF gt action del amp id lt php echo I id gt onclick return confirm Delete this personnel from the database gt Delete lt a gt lt td gt lt td gt lt br gt lt td gt lt tr gt lt php else gt lt tr gt lt td colspan 3 gt No persons in the database lt td gt lt tr gt lt php gt lt php include footer php gt n jh ReView Final Report 9 line php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file line php Connected files registration php the registration form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database parent php confirmation page Function to keep list of the
28. here above you can see a checkbox and a textbox The user can mark the checkbox set the group and above that table the user can set in the location of a show date and name if he wants The problem is however that the horse will not be set in correct order in accordance with the group the user sets 17 J ReView Final Report The Photo upload is a complicated thing There must be a chance to upload a file check if it is really a file and if it is print out message that the upload was successful There must be a way for the page to check which type of image the file is define the maximum size of the image The image upload was an afterthought for my parts The user can upload an image and type in some description of the image and submit it to the database managed to get the code to work for any file but could not limit it only to images About and Help are small parts About notes the tools used and very short description about how the project came to be Help is the user manual It gives a short description about the tools used and gives the user an account step by step on how to install the PHP MySQL and Apache packages ee name address occupation email phone gsm notes name gender colour ffnumber fname mfnumber mname ownerid phone location name ffnumber fname mfnumber mname litirid care location notes price CAC fnumber name gender colour ffnumber fname filestore mfn
29. is essential for this form if isset POSTI name get the variables 40 ReView Final Report name POSTI name Saddress POSTI address Soccupation _POST occupation Semail _POST email Sphone POSTI phone Sgsm POSTI gsm Snotes _POST notes if the name is empty print out a message if Sname exit lt p gt You must put a name Please press the lt BACK gt button on your browser to fix it lt p gt create a query SsqIP INSERT INTO personnel SET name Sname address Saddress occupation Soccupation email Semail phone Sphone gsm Sgsm notes Snotes send the query if mysql_query sqIP print a message if the query was successful echo You have registered a personnel Please click lt a href personnel php gt here lt a gt to return or in the menu to the side Yelse or print an error message echo lt p gt There are problems mysql_error lt p gt gt lt table that holds the information about the personnel existing in the db gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt table gt lt tr gt lt th gt lt th gt lt th gt lt th gt lt th gt Name lt th gt lt th gt Address lt th gt lt th gt Occupation lt th gt lt th gt email lt th gt lt th gt GSM lt th gt lt th gt phone lt th gt lt th gt note
30. of the topmost element i e size of it the font size head height 85px font size 24px padding 5px margin bottom 15px J the configuration for the footer i e location size and font size of foot position fixed top 95 width 100 height 35px font size 12px ee how the text is aligned f sleft text align left sright text align right scenter text align center sfull text align justify fet configuration of the fonts h1 font bold 18px Lucida Handwriting color 003BA1 h2 font bold 16px verdana color 003BA1 h3 font bold 14px verdana color 003BA1 h4 font bold 14px verdana color 003BA1 font style italic h5 font bold 12px verdana color 003BA1 font style italic h6 font 11px verdana color 003BA1 font style italic zv P_ ReView Final Report as configuration for the boxes in the middle clear declare whether floating elements are forbidden to either side configure the width and location and in addition the maximum size for the element on the right size and what happens if the element is overflowed aa left right clear none left width 15em float left right height auto width 75 float left overflow scroll max height 790px po declaration of the background and what kind of border is around the elements head left right foot background eee
31. on how many will be using this web page may add more features as are shown in my initial design f er Jh ReView Final Report Final words As is with everything you can never finish any design until you re done Through the year have found out myself that any plan works only so far and most of the time it is better to have plan B and plan C just in case This project is on its own a big one only it does not look like it In the start approached the FAIC but did never get any conclusive answers which disappointed me a bit but ina way am relived since the people answering my questions and offer were toeing the line on being rude Why don t know and simply put don t want to know As you might have noticed never spoke in length about any related work and there is one very simple answer to that only found one project website that resembles my work in some way and that is WorldFengur WorldFengur is a website that is done in JavaScript and has very extensive database behind I had not gotten any answer on the actual design or what kind of database is used by the time this report was handed in although suspect FEIF to use Oracle database WorldFengur is a second generation website i e has been taken and given a face lift going from being a simple HTML framework website for Icelanders to being written in JavaScript available for all people with horses of Icelandic origin Allin all there is no website or program
32. p gt There is a problem mysql_error lt p gt gt lt ul gt f 37 PP ReView Final Report lt br gt lt php define the variable action and get it if isset S_GET action Saction _GET action else action bugl if Saction echo elseif Saction del and isset _GET id if the action is del and the id is set Sid _GET id create a query sqlCol DELETE FROM litir WHERE id Sid send the query if mysql_query SsqlCol if the query is successful echo lt p gt Your colour has been deleted from the database lt p gt echo lt p gt Please click lt a href newcolor php gt here lt a gt to return lt p gt else if the query is not successful echo lt p gt There is a problem mysql_error lt p gt header location _SERVER PHP_SELF exit gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt p gt The following colours are registered in the database lt p gt lt table gt lt tr gt lt th gt ID number lt th gt lt th gt Name lt th gt lt th gt lt th gt lt tr gt lt php get all data from the table litir SsqIC SELECT FROM litir send the query Slist mysql query sqlC check the results of the query if Slist if they are not good print an error message exit Database error mysql_error
33. positive about both programs is the highlighting help When writing a loop for example they will highlight the corresponding bracket once you have finished writing the code and are not sure if you have closed the loop or not then you can select the opening bracket and the corresponding one will light up if present phpDesigner is more suitable for programming in PHP and MySQL within HTML phpDesigner also allows you to see more what you are doing in terms of coding i e assisting with function calls as well as completing keywords correctly o Jh ReView Final Report inbuilt functions phpDesigner also has more functionality for the programmer while Notepad is more of multi purpose program useful like a text editor and for coding in other languages The negatives about the programs are those that phpDesigner is a bit on the heavy weight in terms of memory and processing Although it says that in system requirements it needs at least 256 MB RAM or higher it is probably better of with more than 512 MB RAM Notepad does not take much space does not need much memory and overall is light The setting is both small and good and is not enough at the same time The setting becomes a bit cumbersome at times when working on a file Of those two programs phpDesigner is better but still there are things that are better to work with in Notepad use Mozilla Firefox version 2 0 0 6 and Internet Explorer version 6 0 29 Personally use o
34. table gt lt php lt tr gt lt tr gt 56 I ReView Final Report echo lt br gt lt br gt gt lt body gt lt html gt 5s jh ReView Final Report 13 reportsN php lt html gt lt head gt lt title gt ReView registration and viewing webpage lt title gt lt head gt lt body gt lt p gt lt h1 gt lt center gt Reports lt center gt lt h1 gt lt p gt lt Author Olafur Hannesson Date final changes and commenting 05 05 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file reportsN php Connected files mainReport php restriction sent db inc php the connection to the database Function to show a list of all horses depending on restriction chosen by the user Output a html form gt lt php include db inc php SfieldChosen gets the data chosen in the drop down list and determines if the variable is an array if is_array S_POST fields looping through the values in the array foreach _POST fields as SfieldChosen printing out the name of the colour Sfields SfieldChosen else echo No restriction was selected the query is sent to the database Sresult mysql_query SELECT FROM hestur ORDER BY Sfields if the query is not good if Sresult print an erro message exit Database error mysql_error check if the results ret
35. td gt lt tr gt lt tr gt lt td gt Mothers ID number lt td gt lt td gt lt php echo SI mfnumber gt lt td gt lt tr gt lt tr gt lt td gt Mothers name lt td gt lt td gt lt php echo SI mname gt lt td gt lt tr gt lt tr gt lt td gt Owner lt td gt lt td gt lt php echo SI care gt lt td gt lt tr gt lt tr gt lt td gt Location lt td gt lt php echo _POST location gt lt tr gt lt tr gt lt td gt Notes lt td gt lt php echo _POST notes gt lt tr gt lt php gt lt table gt lt php echo lt br gt lt br gt the user can click the link when he has viewed the data exit Please click lt a href check php gt here lt a gt to return lt br gt lt br gt elseif Saction del and isset _GET fnumber if the user wants to delete the horse the action is del and fnumber is set get the fnumber Sid _GET fnumber f 9 Jh ReView Final Report create the query sql DELETE FROM hestur WHERE fnumber Sid check the results if mysql_query sql if the results are good echo lt p gt Your horse has been successfully deleted from the database lt p gt echo lt p gt Press lt a href check php gt here lt a gt to return lt p gt else if the results are bad echo lt p gt There is a problem mysql_error lt p gt header location _SERVER
36. the original design The report ends with short description of evaluation In the appendices are listed the code for the project given more accurate timeframe and some UML diagrams as well as some sample data ReView Final Report Background When the settlers came to Iceland some 11 centuries ago among the animals were horses These horses were believed to be of Scandinavian horse race and it is from those horses today s horses decent from Number of tests have been performed to determine which horses today are the most alike the Icelandic horse and there are horses in Norway that comes the closest even going so far as saying that ancestor of the Icelandic horse is from those horses The Icelandic horse has been described as smallish horse but sturdy and hardy with strong characteristics and character and lively temperament see Picture 1 Unlike many of their relatives 7 around the world the Icelandic horse has been raised in natural conditions i e they can move around freely alone or in a herd Those conditions may have contributed more than most to their strong characteristics People going abroad may find the horses there easily frightened and temperamental Mother Nature and human beings are the most danger to horses in Iceland but since there is no natural predator of horses here in Iceland the horses Picture 1 The Icelandic horse seek strong attachment to people and are quite affectionate The official goal is to b
37. this server Please note that this can lead to an insecure system w jh ReView Final Report 17 Click execute MySQL Server Instance Configuration Wizard m Eg MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Ready to execute Prepare configuration Write configuration file Start service Apply security settings Please press Execute to start the configuration 18 Click Finish on the last window 19 There need to be some changes made in the php ini file When the file has been opened you need to find lines where are semicolons in front of the word extension and under there you need to find the lines php_mysql dll php_mysqli dll and php_pdo_mysql dll and remove the semicolons from the line 20 Then you restart the Apache server by double click on the icon in the task bar and click on the restart button __________________f 109 ReView Final Report D Installation of phoMyAdmin The assumption of this is that the user has already downloaded a version of phpMyAdmin 1 Please unzip the file into a folder in the folder you created c webs phpMyAdmin 2 Create a file named config inc php 3 Insert into the file lt php Servers configuration Si 0 Server localhost config root 1 Sitt Scfg Servers Si host localhost Scfg Servers Si extension mysql
38. value Iname gt SIname lt option gt n n jh ReView Final Report extract gt lt select gt lt tr gt lt tr gt lt td gt Fathers ID number lt td gt lt input type text size 26 maxlength 255 name ffnumber gt lt tr gt lt tr gt lt td gt Name of father lt td gt lt input type text size 26 maxlength 255 name fname gt lt tr gt lt tr gt lt td gt Mothers ID number lt td gt lt input type text size 26 maxlength 255 name mfnumber gt lt tr gt lt tr gt lt td gt Name of mother lt td gt lt input type text size 26 maxlength 255 name mname gt lt tr gt lt tr gt lt td gt Owner lt td gt lt php Spers mysql_query SELECT id name FROM personnel if Spers exit lt p gt Unable to obtain colour list from the database lt p gt gt lt select name person size 1 gt lt option selected value gt Owner lt option gt lt option value gt lt option gt lt php while Spersonal mysql_fetch_array Spers Spname personall name echo lt option value Spname gt Spname lt option gt n gt lt select gt lt tr gt lt tr gt lt td gt Location lt td gt lt input type text size 26 maxlength 255 name location gt lt tr gt lt tr gt lt td gt Contact lt td gt lt input type text size 26 maxlength 255 name phone gt lt tr gt lt table gt lt p gt
39. 2 Today s version is 2 2 6 released 7 September 2007 downloaded Apache version 2 0 59 did not go with earlier version for the simple reason that there were some compatibility issues between Apache MySQL and PHP the newest versions available ate the time Today 12 January there are still some issues and it is recommended to use some older versions PHP or PHP Hypertext Preprocessor is a programming language that was designed for producing dynamic web pages It is still a popular misconception that PHP stands for Personal Home Page Tools as its name was in the beginning According to the official PHP webpage PHP is a widely used general purpose scripting language that is especially suited for web development and can be embedded into HTML the main goal of the language is to allow web developers to write dynamically generated web pages quickly PHP Hypertext Preprocessor 2007 PHP is easy to use when the intent is to create simpler websites from some very complicated and vast amount of data Its most popular choice is to use in server side scripting but is also used in graphical applications or from a command line interface PHP is open source server side language that is very easy to learn not s jh ReView Final Report to mention very powerful PHP is becoming very popular choice along with MySQL and Apache to create database driven web pages The reason for its popularity might be very simple PHP uses simple sy
40. 20 21 15 PM e Register new colour i Name of colour Description Clear The following colours are registered in the database ID number Name 1 bleikur Delete 2 Jarpur Delete 3 Svartur Delete Copyright 2007 2008 Olafur Hannesson All rights reserved Picture 8 Colours f 87 PA ReView Final Report d Personnel ReView registration and viewing webpage Mozilla Firefox DOK Fle Edit View History Bookmarks Tools Help lt 2 C http focaihost finalv personnel php Dy E 16 Getting Started E Latest Headines ReView Registration an L ReView registration an I Sports BostonHerald HOME ReView registration an U ReView registration and v B Mon 07th of Apr 2008 20 23 02 PM L Homa Registration a The following personnel have been inserted into the database Photos Help Name About Address Occupation Email address Phone GSM Notes Name Address Occupation email GSM phone notes Olafur Hannesson Austva sholti 2 Student olafurhannesson gmail com 487 6597 868 4022 Edit Delete Copyright 2007 2008 Olafur Ha Picture 9 Personnel The Personnel file allows the user to register personnel usually an owner s of a horse The form is straight forward the user fills in the name address occupation and contact information of the person That person will then appear in a list as is shown o
41. 4 Mozilla Firefox version 2 0 0 13 freely distributed on the Mozilla homepage 5 Internet Explorer version 7 0 5730 13 already installed in Windows The project was finished by 9th of April and handed in the following day 10th of April Contact information lafur Hannesson email olafurhannesson qmail com Copyright 2007 2008 Olafur Hannesson All rights reserved About is simply about the project and short description of the project with lists of which programs used and programming packages 93 ReView Final Report 8 The database name address occupation email gender colour ffnumber fname mfnumber mname ownerid phone location mfnumber mname litirid care location notes price description ffnumber fname mfnumber mname ownerid phone location filename mimetype description filedata This is the database hestar is the main table and gets data that has been registered into other tables and puts it into the table filestore is table for photos u Pp ReView Final Report 9 References 1 10 Ahola K amp Lorange J B 23 July 2001 Worldfengur ready for the world Information to the breeding leaders of the FEIF countries Europe and North America FEIF Behlendorf B amp al e 2002 The Apache HTTP Server Project S tt 8 November 2007 fra About the Apache HTTP Server Project http news netcraft com archives web_server_
42. 5 v 13 Select Enable TCP IP Networking and keep the port number on 3306 and select Enable Strict Mode and click Next MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please set the networking options Enable TCP IP Networking 4 Enable this to allow TCP IP connections When disabled only local connections through named pipes are allowed Port Number Please set the server SQL mode Enable Strict Mode This option forces the server to behave more like a traditional database server It is recommended to enable this option ReView Final Report 14 The character set is by the choice of any user but chose to select Best Support For Multilingualism and click Next MySQL Server Instance Configuration Wizard Eg MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please select the default character set Standard Character Set Makes Latini the default charset This character set is suited for English and other West European languages Best Support For Multilingualism Make UTF8 the default character set This is the recommended character set for storing text in many different languages CO Manual Selected Default Character Set Collation Please specify the character set to use Character Set latin1 ov jh
43. Fe gt 0 get the result row as array and return to variable while f mysql_fetch_array SlistFe get the value from the array and print the results in a table gt lt tr valign top gt lt td gt lt php echo Sf gender gt lt td gt lt td gt lt php echo Sf fnumber gt lt td gt lt td gt lt php echo Sf name gt lt td gt lt td gt lt php echo Sf ownerid gt lt td gt lt td gt lt php echo Sf location gt lt td gt lt td gt Edit lt a href lt php echo _SERVER PHP_SELF gt action del amp id lt php echo Sf id gt onclick return confirm Delete this personnel from the database gt Delete lt a gt lt td gt lt td gt lt br gt lt td gt lt tr gt lt php else print out message that it is empty gt lt tr gt lt td colspan 3 gt No horses lt td gt lt tr gt lt php gt lt table gt lt form gt lt php include footer php gt n ReView Final Report 10 parent php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file parent php Connected files main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database line php registration page Function to keep l
44. Firefox File Edit View History Bookmarks Tools Help z ft http ocalhost finaM about php BD E Getting Started EX Latest Headines Review Registration an Review registration an I Sports BostonHerald HOME ReView registration an ReView registration and v Mon 07th of Apr 2008 20 32 05 PM About I Thisis a final year project done in the 2007 2008 semesters The project was actually started 2 3 years ago when I was asked to create a database with an interface Microsoft Access was chosen and the database was made That database did not work out as it should be and was abandoned later Autumn 2007 I was looking for a project to do as my final year project in Computer Science at the University of Akureyri One project idea from Nik Whitehead my supervisor looked to me to be almost the same as the database idea I had worked at in Access This time I worked with the help of PHP MySQL and Apache and created a web page interface with MySQL database underneath 1 The version of PHP or PHP Hypertext Processor I used is 5 2 4 2 The version of MySQL I used is 5 0 45 3 The version of Apache I used is 2 0 59 The interface is designed in 1 phpDesigner2008 version 6 0 1 2 gotten from MPSOFTWARE 2 Notepad version 5 1 from Microsoft already in Windows 3 Notepad version 4 6 open source software freely distributed on sourceforge net
45. ReView Registration and Viewing webpage Final Report Olafur Hannesson Supervisor Nik Whitehead School of Computing Faculty of Business and Natural Sciences University of Akureyri Resubmitted May 2008 in partial fulfilment of the conditions of the award of the degree BSc herby declare that this interim report is all my own work except as indicated in the text Signature Date ReView Final Report Abstract We the human beings are not the only ones who are registered at birth Horses are registered and given a identification number but what is different is that while we are later registered with a name ID number and where we live the horse are not so lucky as everything is monitored The information goes into a database called WorldFengur Some time ago got a project from a guy named Steinn Masson who asked me to create a database system with an interface to manage mainly the registration for retail shows as well as organization for them The new system has just about 11 tables and numerous websites to work for It was decided to use MySQL on the database HTML and CSS to handle the layout of the website and PHP to be around this all PHP has the role of getting the things in the correct labels at the correct time Apache takes then care of allowing the user to see what he is doing and making sure that MySQL PHP and the HTML are talking together In this report deliver my final design and implementation Re
46. Spers mysql_query SELECT id name FROM personnel if Spers exit lt p gt Unable to obtain colour list from the database lt p gt gt lt select name person size 1 gt lt option selected value gt Personnel lt option gt lt option value gt lt option gt lt php put them into a drop down list while Spersonal mysql_fetch_array Spers Spname personall name echo lt option value S pname gt Spname lt option gt n gt lt select gt lt td gt lt tr gt lt tr gt lt td gt Location lt td gt lt td gt lt input type text size 26 maxlength 256 name location gt lt td gt lt tr gt lt tr gt lt td gt Notes lt td gt lt td gt lt textarea name notes rows 5 cols 30 gt lt textarea gt lt td gt lt tr gt lt table gt lt p gt lt either clear the form or submit it to view it before sending it into the database gt lt input type submit value Submit name submit gt lt input type reset value Clear name clear gt lt p gt lt table align right gt lt th gt Father lt th gt lt tr gt a Jh ReView Final Report lt td gt lt php get the horse from the database Sfath mysql_query SELECT fnumber name FROM father if Sfath exit lt p gt Unable to obtain horse list from the database lt p gt gt lt select name fat size 10 gt lt php put the
47. View Final Report Table of contents Table OF CONTENTS oroia eia sat a A sana a andann iva 3 ERO Vlad sg a E KS SE 4 BACKE FOUND cae c5se cnt ths deities eves a als dees ba a skan ra a ba a ng E bar sa 5 My PrOjECt si s rana a a A a a br Meas at Ba a Ba a 6 THE Proj Ct icere assa a e al a al DU dock a a ete bined ASR cea eed samen 6 INTO OS ciao ccc vcs sg SR DM a cuesh eee na E lb an ng 8 Everything CSO tags si ocazecceaedeseas sana aa ai Bai aa RA BR G 9 My solution Design ccccececssecesscecseeeessececasecesseecsseeeessececseecsseecaaeceeaseceseeceaseeeaeeeeaaeceseees 10 MIPIEMEN CALI ON siscceeveeceseccsosesdecssbereccdesurtecdebestecscacndesdebeysccdesuneedacbeitecdesesdesacdetneccesstientamemedsiones 15 THE COOLS A SS ecasdes ean ine ae 15 TRIED OSCE rn a geds Geese ia Guuen devs E eE aaa 15 Problems facedin serien snara a dene tenesednsdnsteynanastysdse stays Eaa deste N EEE a Aaa 19 Evaluatio sessa ann an anna na aaa RNS pepe teeter pce ans saa 20 Future UPC ates sinai EUR UN a AAN Eg u an an a 21 als sionistisen iaaiaee a ai ie e el hae atnda aas 22 REIS FENG sasssa e rer eect AE AE aaa an EEE A E na E 23 Tale ONKUR SN aa JO ln ana 24 Appendix A Code listing asian aua a A sakai gunni a aaa aa 25 Appendix B Complete Project plan 00 00eene t etern rra snar rann rasan 77 Appendix C Sampled tar riss ss snara sana in BE RA a 828 bg afs
48. a PHP Develop Tue 08th of Apr 2008 18 33 05 PM The following horses are registered in the database H Date ID number Name Location 1 1s1990286807 lfhei ur Bj rk L kjarbotnum Edit Delete 13 182006145438 S rli Austva sholti Edit Delete 2008 04 06 11 47 25 20 152002186810 J ker L kjarbotnum Edit Delete Copyright 2007 2008 Olafur Hannesson All rights reserved This page is possible the one that is most used of all On this page the user can see which horses are registered and when as well as view them once clicking the ID Number When the user clicks the ID number of a horse the user is shown all the information about that particular horse The user can delete horses from this list as well If the user clicks on delete at the end of each line the horse will be deleted from the list as well as the database and cannot be undone the user must register the horse again if necessary to get it back to the list e Date is when the horse was registered in the database e ID number is the ID for the horse e Name is the name of the horse e Location is where the horse is usually located e Delete will delete the horse from lists and database a Jh ReView Final Report 6 Help The current document is the help f 92 Jh ReView Final Report 7 About ReView registration and viewing webpage Mozilla
49. ally suited for web development and can be embedded into HTML the main goal of the language is to allow web developers to write dynamically generated web pages quickly PHP Hypertext Preprocessor 2007 PHP is easy to use when the intent is to create simpler websites from some very complicated and vast amount of data Its most popular choice is to use in server side scripting but is also used in graphical applications or from a command line interface PHP is open source server side language that is very easy to learn not to mention very powerful PHP is becoming very popular choice along with MySQL and Apache to create database driven web pages The reason for its popularity might be very simple PHP uses simple syntax i e the scripts are kept as readable as humanly possible which in turn allows for flexibility This flexibility however leads to security concerns as well as performance issues Rasmus Lerdorf is titled the father of PHP when he started with it in 1994 He used if mainly for maintaining his personal home page PHP2 came out year later and PHP3 in 1997 Today s version is number 5 2 5 and was released 8 November 2007 downloaded that version and set up but the version had before was number 5 2 3 c MySQL MySQL is a high performance multi user relational database management system that today is the most popular choice when it comes to database driven web pages The reason for its popularity is preferably the easy way it h
50. amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Price lt u gt lt php echo number format Sll price 2 lt tr gt lt tr gt lt td gt Name lt td gt lt td gt lt php echo SI name gt lt td gt lt tr gt lt tr gt lt td gt Colour lt td gt lt td gt lt php echo SI litirid gt lt td gt lt tr gt lt tr gt lt td gt lt td gt lt td gt lt td gt lt td gt lt td gt lt tr gt lt tr gt lt td gt Father lt td gt lt td gt lt php echo SI ffnumber gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Name lt td gt lt td gt lt php echo SI fname gt lt td gt lt tr gt lt tr gt lt td gt Mother lt td gt lt td gt lt php echo SI mfnumber gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Name lt td gt lt td gt lt php echo SI mname gt lt td gt lt tr gt lt tr gt lt td gt Location lt td gt lt td gt lt php echo SI location gt lt td gt lt tr gt lt tr gt lt td gt Owner lt td gt lt td gt lt php echo SI care gt lt td gt lt tr gt lt marks the line between horses gt lt tr gt AANAAANNNNAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAA AAAAAAA lt ftr gt lt tr gt lt
51. as when it comes to maintaining it MySQL is open source SQL database system that has been developed supported and distributed by MySQL AB which was founded by the MySQL developers The current stable version of MySQL is 5 1 22 but the newest version is 6 0 3 alpha released unknown did get 5 0 45 since had some major problems concerning communications between the webpage and the database Other problems encountered were for example problems handling strings and numbers issues regarding privileges and connection problems from the website into the database have used phpMyAdmin occasionally to help with the database creation and maintenance as well as making sure that everything is as it should be phpMyAdmin is basically a help program that can manage a whole MySQL server needs a super user as well as a single database Ratschiller amp al 2007 d Apache What is Apache According to the Apache website The Apache HTTP Server Project is a collaborative software development effort aimed at creating a robust commercial grade featureful and freely available source code implementation of an HTTP Web server Behlendorf amp al 2002 Apache HTTP Server or more commonly Apache is the market leading free web server according to NetCraft NetCraft 2007 While Apache is developed and supported by the open source f 2 Jh ReView Final Report community it is freely distributed and is easy to set up Many we
52. ata echo lt table border 1 gt echo lt tr gt echo lt tr gt echo lt td gt lt b gt lt u gt Nr SI id lt u gt lt b gt lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Registration date SI day lt td gt echo lt tr gt echo lt tr gt lt td gt lt td gt lt tr gt echo lt tr gt echo lt td gt ID Number lt td gt echo lt td gt SI fnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt formating a number with grouped thousands echo lt td gt Price lt u gt number_format I price 2 lt u gt kr lt td gt echo lt tr gt echo lt tr gt echo lt td gt Name lt td gt echo lt td gt SI name lt td gt echo lt tr gt echo lt tr gt o jh ReView Final Report echo lt td gt Colour lt td gt echo lt td gt SI litirid lt td gt echo lt tr gt echo lt tr gt echo lt td gt lt td gt echo lt tr gt echo lt tr gt echo lt td gt Father lt td gt echo lt td gt SI ffnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Na
53. be able to make changes Those changes needed to include a way for him to be able to select a horse from a list of horses and make changes to the data about the horse to select a number of horses and have those horses appear in a list that he could then print out The information he wanted to put in the old database was the horse itself the identity number name name of the father name of the mother colour in which group to place the horse give it a number registration date price and a photo The ability to add some notes was added on the interface later on then added another window for Stein to add some more colours register a new owner and address the ancestry and the jockey This is all found more or less in the new interface and database although under some very different names The new database has some 11 table but there is very little relationship between them now but some attributes depend on other attributes to be able to work properly in the registrations am not saying that there is no interaction at all just that the information is set in one table instead of having one huge table where the chances of repetition is just too much Relationship 2 shows the current tables The primary key for all table are defined as PK the user must fill out the corresponding labels in the interface where the bold words are in the database Those labels define each table The id is only a auto increment and the primary key for most of the tables
54. border 1px solid aaa configuration of the list and what kind of font types are left ul li margin 4px list style type none body font normal 12px verdana tahoma sans serif dl dt dd ul li margin 0 padding 0 list style type none P location of the menu menu width 15em float left J menu outlook XJ menu dt cursor pointer margin 2px 0 height 20px line height 20px text align center font weight bold border 1px solid gray background ccc menu dd border 1px solid gray menu li text align center background fff menu li a menu dt a color 000 text decoration none display block border 0 none height 100 menu li a hover menu dt a hover background eee z jh ReView Final Report when the menu calls this is what happens the user clicks on something say Registration the menu opens and shows what is under Registration and is open until the user clicks something mentions position absolute top 300px left 10px color 000 background color ddd lt style gt lt else gt lt script type text javascript gt window onload sedill function sedill id var d document getElementByld id for var i 1 i lt 10 i if document getElementByld smenu i document getElementByld smenu i style display none lt p gt lt h6 gt lt
55. bpage lt title gt lt head gt lt body gt lt p gt lt h1 gt lt center gt Reports lt center gt lt h1 gt lt p gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file reports php Connected files db inc php the connection to the database mainReports php the reports page Function to show a list of all horses gt lt given the information the user gave in mainReports php the user will see a list of horses with the information about them gt lt php include db inc php if the user pushed the submit button if isset S_POST submit get the data from mainReports php Sbox _POST box Stext _POST whichGroup print out the name of the show the user gave echo lt h2 gt _POST nameOfShow lt h2 gt lt br gt print out the location and the date the user gave echo Location _POST locationOfShow date _POST dateOfShow lt br gt count the horses chosen Show many count Sbox print out the number of the horses chosen echo Number of horses chosen Show_many lt br gt if the number of horses chosen is zero warn the user and offer him to go back if Show_many 0 echo You have not chosen any horses Press lt a href mainReport php gt here lt a gt to go back lt br gt declare variables SvarCheckbox
56. bsite designers have installed and set up Apache on their machines to enable easy way to preview and test websites while being developed Apache was first created by Robert McCool sometime in the early 1990s with its next version released in 2002 Today s version is 2 2 6 released 7 September 2007 downloaded Apache version 2 0 59 did not go with earlier version for the simple reason that there were some compatibility issues between Apache MySQL and PHP the newest versions available ate the time Today 12 January there is still some issues and it is recommended to use some older versions e HTMLand CSS Currently most websites that employ HTML employ CSS as well HTML stands for Hypertext Mark up Language and enables us to mark the text so it can function as hypertext on the web Editors like Notepad and Microsoft FrontPage mark the manuscript pages with symbols that tells the web how to print the page HTML uses its own set of symbols on how the browsers should display the pages CSS or Cascading Style Sheet was designed to help the designers with the formatting of the web pages comparable to the styles in programs like Microsoft Word CSS provides a way for the designer to specify the formatting in one file and have the changes reflected all over the website instead of having to lookup the formatting on many web pages By using CSS the designer is not only guaranteeing himself a way of making the life of maintaining the website much eas
57. cssssccccevsscccdesssccecessncccdvvasccecevssccecesasccedevossccdeessccecevsbscddevanccedensbscddenascceceraaes 88 Relationships 1 How the old database looked like 0e 000eerenn neee err 7 Relationships 2 The initial database laYOUt cc eccssececsssnececeeseeecseaeeeceeauececseaaeeesseaaeeeseesaeeeeseaaes 10 Table 1 Typical registration form cccscccssccssscesssecsessecseceecsaeesesaecsensecseeeessaseseauecseaeessessesaeesssaessenees 6 un P_ ReView Final Report Appendix A Code listing The order of files 1 db inc php 2 main php 3 footer php 4 5 registration php 6 hestur php 7 newcolor php index php 8 personnel php 9 line php 10 parent php 11 mainReport php 12 reports php 13 reportsN php 14 wordi php 15 excel php 16 search php 17 result php 18 check php 19 photo php 20 photoS php 21 about php s5 PP ReView Final Report 1 db inc php lt php author Olafur Hannesson email olafurhannesson gmail com copyright 2007 2008 comment this file holds the script for connecting to the database server 1 and to the database skr ir hestar 2 connection established localhost location of the MySQL database server root username for the MySQL database server admin the password for the MySQL database server Sdbcnx mysql_connect l
58. d determined if isset GETT action Saction _GET action else Saction if action del and isset _GET id Sid _GET id User is deleting a file sql DELETE FROM filestore WHERE id Sid Sok mysal query sa l if Sok exit Database error mysql_error else print successful messages exit Congratulations you have deleted a photo Please click lt a href photo php gt here lt a gt to return print relevant messages and terminate the script exit elseif isset _FILES upload insert data into variables Suploadfile _FILES upload tmp_name Suploadname _FILES upload name Suploadtype _FILES upload type Suploaddesc _POST desc Open file for binary reading rb Stempfile fopen Suploadfile rb Read the entire file into memory using PHP s filesize function to get the file size Sfiledata fread Stempfile filesize Suploadfile Prepare for database insert by adding backslashes before special characters Sfiledata addslashes Sfiledata Create the SQL query Ssql INSERT INTO filestore SET filename Suploadname mimetype Suploadtype description Suploaddesc filedata filedata Perform the insert Sok mysql_query sql n Jh ReView Final Report if Sok echo You have inserted a photo into the database Please click lt a href photo
59. day Sprice POSTI price Slid Scolor Sfnumber _POST fnumber Sname _POST name Sffnumber _POST ffnumber Sfname _POST fname Smfnumber _POST mfnumber Smnumber _POST mnumber Smname _POST mname s5 jh ReView Final Report Scare Sperson Slocation _POST location Snotes _POST notes if Sfnumber exit lt p gt You must fill in the ID number lt p gt puts the data into variable Ssql1 INSERT INTO hestur SET day now fnumber Sfnumber name Sname ffnumber Sffnumber fname fname mfnumber Smfnumber mname mname care care litirid Slid location Slocation notes Snotes price Sprice determines if the query is ok and sends it if mysql_query sql1 echo lt a href check php gt else or gives out an error message echo lt p gt mysql_error lt p gt gt lt p gt lt br gt lt p gt lt php include footer php gt ff 36 PP ReView Final Report newcolor php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file newcolor php Connected files registration php the registration form main php the outlook of the page and menu footer php the foo
60. earch window will only hold some basic labels that the user will have to fill in should he want to search for anything specific Failing finding anything there will be a label the user will fill in and the database will then be GS ReView Skraning hests Mozilla Firefox Ho File Edit View History Bookmarks Tools Help a q z X a L http fflocalhost finalfregistr php ml e G A z palm Sky Sports Live Score LO Firefox and Mozilla Links LO fan LO Quick Searches W Main Page Wikibooks sjonvarp is Cascading Style Shee PHP Manual B Chapter 1 Sn Re iew Skr ning hests B Sun 13th of Jan 2008 19 27 29 PM SKR NING F ingarn mer Tenglar N r litur N r hestur Sko a hesta Nafn Litur F ingarn mer f ur Fa ir F ingarn mer m ur M ir Umradamadur Stadsetning Athugasemdir Mynd Afkvemi Domar Kaup sala Return to front page Done Picture 4 The initial registration form incomplete 13 ReView Final Report searched matching anything in the database with the word s the user put in The results for the search will be displayed on the same page below the search form The view form will show list of the horses with identity number name and owner displayed in four column row the first would be the id The identity number would then act as a hyperlink which would then be clicked and the user can the
61. eate and send the query Slist mysql_query SELECT id fnumber name ffnumber fname mfnumber fname location notes FROM hestur WHERE fnumber fnumber if the query is not good if Slist print an error message and terminate the script ov PA ReView Final Report exit lt p gt Error fetching horse details mysql_error lt p gt get the result row as an array ShorseList mysql_fetch_array Slist gt lt print out the form for editiing the id fnumber and name are not changeable gt lt form action lt php echo SERVERI PHP SELF gt method post gt lt table cellspacing 10px gt lt tr gt lt td gt id lt td gt lt php echo ShorseList id gt lt tr gt lt tr gt lt td gt ID number lt td gt lt php echo ShorseList fnumber gt lt tr gt lt tr gt lt td gt Name lt td gt lt php echo ShorseList name gt lt tr gt lt tr gt lt td gt Location lt td gt lt input type text name location value lt php echo ShorseList location gt gt lt tr gt lt tr gt lt td gt Notes lt td gt lt input type text name notes value lt php echo ShorseList notes gt gt lt tr gt lt table gt lt input type hidden name fnumber value lt php echo Sfnumber gt gt lt input type submit value Submit name submitEdit gt lt form gt lt php elseif Saction view and isset _GET fnumb
62. er if the action is view and the fnumber is set get the fnumber Sid _GET fnumber create the table gt lt table border 1 cellpadding 5 cellspacing 0 gt lt php create the query SsqlCheck SELECT FROM hestur WHERE fnumber Sid send the query Slist mysql_query SsqlCheck if the results are not good if Slist print an error message exit Database error mysql_error if the results are good check if the number of rows in the result is not empty if mysql_num_rows Slist gt 0 get the data from the array and put it in a variable while I mysql_fetch_array Slist print the results gt s jh ReView Final Report lt tr gt lt td gt Registration day lt td gt lt td gt lt php echo SI day gt lt td gt lt td gt Price lt td gt lt td gt lt php echo SI price gt lt td gt lt tr gt lt tr gt lt td gt ID Number lt td gt lt td gt lt php echo SI fnumber gt lt td gt lt tr gt lt tr gt lt td gt Name lt td gt lt td gt lt php echo SI name gt lt td gt lt tr gt lt tr gt lt td gt Colour lt td gt lt td gt lt php echo SI litirid gt lt td gt lt tr gt lt tr gt lt td gt Fathers ID number lt td gt lt td gt lt php echo SI ffnumber gt lt td gt lt tr gt lt tr gt lt td gt Fathers name lt td gt lt td gt lt php echo SI fname gt lt
63. er confirms that he wants to delete the horse a variable is sent one called action which defines what the user is about to do and sends it to the correct place in the code Then the ID number is pulled from a variable as well and a query is sent to delete that particular horse with that particular ID number If the query is successful a message is printed out stating that the horse has been deleted and the user can click on a link to go back or go to the menu to go somewhere else It was the intention to put in a similar way for the user to edit any horse i e change any information about that horse but there is some problem with the update query The update query doesn t seem to work and it might be that have tried too long and too hard to fix it that cannot see what the problem is but am convinced that the problem is a minor one and will definitely be fixed in next version One of the problems faced on the Take a look page was to get the delete and edit to work as well the ability to view the data about the horses fixed that by creating a variable called action and put it in a loop If action is empty the code should do nothing but if the variable is set to something put it into the variable action and then does something with it If the variable is equal to view then the user wants to view the information about that horse given that the ID number is set Should the variable be equal to del the user wants to delete the horse Oth
64. er ideas that did try but did not work as well as thought were to use buttons which would when coupled with radio button or checkboxes would delete the horse s give the user a chance to edit the data for the horse s or view the data about the horse s did try to create separate pages for these things but felt that would be waste of space and in the long term be a problem allow for confusion The files for the Colour and Personnel is a very simple forms The form for Colour is simply for the user to type in the name of the colour and if he wants to put a description for the colour At the bottom of the page is a list of the colours with the description and the option to delete the colour from the database The Personnel form allows the user to put the name address occupation and contact information in the form of email regular phone or gsm phone The same applies to the Personnel form that there is a list listing all the personnel with all the information and the ability to delete the person 16 ReView Final Report The Linage form is intended for the registration of the potential parents of the horses Note that any stallion can be father to many horses and any mare can be mother to many To insure that there will be no confusion about the registration the user will have to define the gender of the horse as well as type in the ID number which is what the registration is based upon The user can also fill in the name o
65. f the horse as well as the colour name and ID number of father and mother owner from a drop down list provided that the person has been registered before location and contact details If the gender is male the horse goes into the table that lists males at the bottom of the page or if the gender is female the horse goes into a table that lists females The Search form consists of a drop down list giving some fields and an empty text box The user must be mindful of what he types in because by typing in Bjork will not give the same results as Bj rk from Hofi If the field is chosen correctly the first search term will give results assuming that there is a horse named Bj rk in the database but the latter will not give any results because the string is in 3 parts It was decided upon this to prevent any lengthy strings in the name field when the registration is done Should the user decide to put in a string like Bj rk from Hofi he will then know that the horse is in the database will be able to go through the list in Take a look very quickly use the LIKE operator in the query and for now put the limit from O to 250 horses Then the query is sent and gets the results back and starts printing out the results However if the id for the row is empty it will return the message that there is no record found and because there is a new window opened asks the user to close this window if he wants to search again The problem faced here
66. g around on the internet to find an alternative solution found a program named WOS and XAMPP Lite Both are free packages and hold latest compatible packages of Apache PHP and MySQL WOS however has some compatibly problems with Windows Vista Other problems are for example that is will not work if the computer is connected to the internet because then the Apache server will not start If the packages Apache PHP and MySQL are already installed on the computer WOS will not start either decided to take my chances with WOS because while there is no service with the package i e no updates and help beyond posting questions on forums it is easy to upgrade the package to include other packages such as phpMyAdmin and Perl Further tests will be made in the future on getting only the Apache PHP and MySQL packages to work from either USB stick or a CD The problems faced with when started trying WOS were not many The one encountered solved accidentally The problem was that when wanted to start wos exe the Apache server did not start did not have access to the internet where was at the time so there was no searching on the internet for information Once tried some changes in the httpd conf file which did not do anything anyway shut down Skype it is configured to automatically start and try to connect to the internet when start up my computer and tried to start up wos exe and to my surprise it worked Skype and Apache were confi
67. ges and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file check php Connected files hestur php the results from the registration form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database reports php the complete list of horses in database Function to print out all the data in the database gt lt the file lists all the horses in the database and allows the user to delete from the database gt lt php defines the variable action and gets the data if isset S_GET action action GETT action else Saction if Saction edit and isset GET fnumber if action is edit and the fnumber is set if isset S_POST fnumber if the variable is set get the data from text fields Slocation POST location Snotes _POST notes Sfnumber _POST fnumber create a query SsqlUP mysql_query UPDATE hestur SET location location notes Snotes WHERE fnumber Sfnumber LIMIT 1 if the query is good if SsqlUP print successful message echo horse details have been updated echo lt a href check php gt Yelse else print error message echo lt p gt Error updating horse details mysql_error lt p gt else if the variable is not set get the fnumber Sfnumber _GET fnumber cr
68. gured to listen to the same port number 80 but that does not work Evaluation The evaluation of the project was not that much A user Steinn was set to the task of registering a horse from ground zero and up There were no apparent problems although he complained about lack of direction which would be my fault as did not instruct him properly beforehand The user did register a horses successfully and but did not get the horses in correct order in the reports when he viewed them in the report section Another problem he found was that if the user wanted to register colour or personnel or parents he had to go in relevant sections and register them but could not go back to the registration form he had filled part of or all v Jh ReView Final Report Future updates In order to correct some mistakes and to help with registration will introduce sessions in next version as well as introduce drag n drop Sessions will help the user for example he has to stop in middle of registration he could save the work he has done and come back to finish later Drag n drop will allow the user to put in information that will then appear on the registration page in some tables that will then allow the user to create something once and then just find it and drag it to correct place in the registration form Other updates will have the inclusion of image gallery to import files that hold registration of horses and the option of pdf files Depending
69. he Apache HTTP server project page under httpuhttpd apache org in InstallShield Tm nn nnn 5 You fill in the boxes and click next It does not matter what is put there but personally put ocalhost under Network Domain and Server Name and my email address under Administrator email address please note that the text put in there is for demonstration purposes fe Apache HTTP Server 2 0 Installation Wizard x Server Information Please enter your server s information Network Domain e g somenet com nnn qoa Server Name e g www somenet com finn hh Administrator s Email Address e g webmaster somenet com nnn nnn com te Install Apache HTTP Server 2 0 programs and shortcuts for for All Users on Port 80 as a Service Recommended only for the Current User on Port 8080 when started Manually Installshield Cancel lt Back 6 Here you leave Typical marked and click next f _ 98 ReView Final Report ji Apache HTTP Server 2 0 Installation Wizard Setup Type Choose the setup type that best suits your needs stall seld 7 Here you can pick whatever location you want but best is to leave it as it is j Apache HTTP Server 2 0 Installation Wizard Destination Folder Click Change to install to a different folder Install Siield 8 Click nstall to begin the installation _____________ 9 ReView Final Report
70. he array while I mysql fetch array list print out the data gt lt tr valign top gt lt td gt lt td gt _53 A ReView Final Report lt td gt lt php echo SI id gt lt td gt lt td gt lt php echo SI fnumber gt lt td gt lt td gt lt php echo SI name gt lt td gt lt td gt lt php echo SI location gt lt td gt lt td gt lt php echo SI care gt lt td gt lt the checkbox the user needs to mark if he wants it in the report gt lt td gt lt input type checkbox name box value lt php echo SI fnumber gt gt lt td gt lt the text area the user needs to mark if he wants it to be in a order gt lt td gt lt input type text size 26 maxlength 256 name whichGroup gt lt td gt lt tr gt lt php else if there are no horses in the database gt lt tr gt lt td colspan 3 gt No horses lt td gt lt tr gt lt php gt lt tr gt lt td gt lt td gt lt td gt lt td gt lt td gt lt input type submit value Submit name submit gt lt td gt lt td gt lt input type reset value Clear name clear gt lt td gt lt tr gt lt form gt lt table gt lt br gt lt p gt lt p gt lt php include footer php gt _54 ReView Final Report 12 reports php lt html gt lt head gt lt title gt ReView registration and viewing we
71. icrosoft Access and some database creation by using some templates That program was later deemed not suitable to use as it did not fulfil completely what was pursued That program was also a bit heavy in use and while some modifications were done using Visual Basic coding it was discarded shortly after its creation One proposal from Nik Whitehead was very similar to this project although that project may have had bit more data involved There is enough data involved in this project and the main matter is to be able to put the data in organize it and create some satisfactory outputs The installation process is described in chapter 2 Chapter 3 covers the programming language and the database system used along with the server Other things is about the system requirements Chapter 4 to 7 describe and give some samples for the functions in the interface Chapter 8 is about the database Appendices A through C are about the installation of the actual packages should the user want to install them onto the computer instead of running it of a USB stick 2 Installation The best way to work on this webpage is to install the Apache PHP and MySQL and phpMyAdmin packages as is shown in appendices A D onto the computer it is intended to work on After the installations are finished go to the phpMyAdmin and import the file db sql that is on the following CD After that any registration can be concluded The only thing the user needs to know
72. ie Apache HTTP Server 2 0 Installation Wizard Bl x Ready to Install the Program The wizard is ready to begin installation Click Install to begin the installation If you want to review or change any of your installation settings click Back Click Cancel to exit the wizard Installstjeld ik Cancel 9 Click Finish ie Apache HTTP Server 2 0 Installation Wizard Bl x Installation Wizard Completed The Installation Wizard has successfully installed Apache HTTP Server 2 0 59 Click Finish to exit the wizard 10 Should Windows XP decide to block Apache from working a window will pop up Click Unblock to allow Apache to interact with the firewall 11 If you go into your browser and type in http localhost you should get a window stating that your installation was successful Af 100 PO ReView Final Report B Installation of PHP The assumption here is that the user has already downloaded PHP 5 2 4 zip package 1 Unzip the content of the file into a folder named c php 2 open the folder and find file named php5ts dll Move this file to a folder c windows 3 create a folder in my project it was named c webs on C drive 4 inside the folder c php is a file named php ini dist Rename this file to php ini right click on the file choose rename type php ini 5 Open the file and make the following changes to it doc root c webs c webs is wathever the folder you created i
73. ier but it will also make it so that when a new person comes along that person can quickly set herself into the outlook of the website s Jh ReView Final Report 4 Registration ReView registration and viewing webpage Mozilla Firefox EEK File Edit View History Bookmarks Tools Help O _http ocahost finaN registration php gt E Getting Started amp Latest Headlines ReView Registration an ReView registration an I Sports BostonHerald U Review registration and v E HOME ReView registration an Mon 07th of Apr 2008 19 33 13 PM Home Registration Registration Skr ning Linage Colour Personnel Registration date 04 07 08 Price Reports oe 1D number ee gt Name 151999123456 Ikarus DHe 182006213467 G i About Colour Selectone colour Fathers ID number Name of father Mothers ID number Name of mother Mother 182006213467 Alma IS2006186815 alma 182007223467 Skeifa Personnel Personnel Location Notes Copyright 2007 2008 lafur Hannesson All rights reserved Done a Registration Picture 6 Registration The registration process is fairly simple As is shown in Picture 1 the Registration is under the Registration label along with Linage Colour and Personnel Registration asks the user to enter various information including the ID number name parentage owner and location
74. information about the parents of horse gt lt the file allows the user to register any horse that is frequently used as parent for any horse gt lt p gt lt h1 gt Linage lt h1 gt lt p gt lt ul gt lt form action parent php method post gt lt table cellspacing 10px gt lt tr gt lt td gt lt fieldset gt lt legend gt Gender lt legend gt lt select size 1 name gender gt lt option selected value gt Select gender lt option gt lt option value gt lt option gt lt option value Male gt Male lt option gt lt option value Female gt Female lt option gt lt select gt lt fieldset gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt tr gt lt tr gt lt td gt ID number lt td gt lt input type text size 26 maxlength 255 name fnumber gt lt tr gt lt tr gt lt td gt Name lt td gt lt input type text size 26 maxlength 255 name name gt lt tr gt lt tr gt lt td gt Colour lt td gt lt php Scolour mysql_query SELECT id litur FROM litir if Scolour exit lt p gt Unable to obtain colour list from the database lt p gt gt lt select name lid size 1 gt lt option selected value gt Select one colour lt option gt lt option value gt lt option gt lt php while Slit mysql_fetch_array Scolour SIname Slit litur echo lt option
75. into a table in the database Then it would be fetched again and sorted by group and the horses printed out in correct order The problem there is the time it takes If there are many horses it can take some time 19 ReView Final Report About that database The biggest mistake did in this project was not to create the entire interface first and then spend time to develop and create the database By creating the database first and then the interface as did put in the concept of confusion because there are tables that should not be in the database with columns that should not be along with some fields that are probably not well thought out Another problem is that given that if the database is not there my code will not work on to create the database with the tables It has been very difficult to get PHP Apache and MySQL to work from a CD or USB stick In my trials have found that while settings might work when installed in computer A the chances of it to work in computer B and or C are slim at best It is my opinion that am on right track with it meaning that the paths in the configuration file for PHP Apache and MySQL need to be set to I being the letter of the drive for the USB stick or CD As to why the configuration does only work in one computer but not the next is any ones guess but it is my opinion that the configuration of the computer itself prevents it from working in two computers Once starting lookin
76. irid gt lt td gt lt td gt lt td gt lt td gt lt td gt lt td gt lt td gt lt td gt Father lt td gt lt td gt lt php echo SI ffnumber gt lt td gt lt td gt lt php echo SI fname gt lt td gt lt td gt Mother lt td gt lt td gt lt php echo SI mfnumber gt lt td gt lt td gt lt php echo SI mname gt lt td gt lt td gt Location lt td gt lt td gt lt php echo SI location gt lt td gt lt td gt Owner lt td gt lt td gt lt php echo SI care gt lt td gt lt marks the line between horses gt lt tr gt VVVVVVVVVVVVVVVVVVVVVVVVAVVAVVAVVVVVAVVVVVVIVVVVVVVIVVVVVVVVVVVVV VVVAAAAANAAA ftr gt lt tr gt lt tr gt lt tr gt lt table gt lt php echo lt br gt lt br gt gt lt body gt lt html gt s9 cN ReView Final Report 14 wordi php lt php include db inc php Author Olafur Hannesson Date final changes and commenting 05 05 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file wordi php Connected files mainReport php restriction sent db inc php the connection to the database Function to show a list of all horses depending on restriction chosen by the user Output a word document the type we are outputting header Content Type application msword SfieldCh
77. is if any of the packages are already installed on the computer It is recommended to shut them down before starting up WOS Should the computer be connected to the internet it is recommended to disconnect before starting up WOS After the user has plugged the stick in he needs to double click on the WOS icon to start the web server After that the user can start registering horses 80 ReView Final Report 3 Tools a Other things The project is created using on two computers e Microsoft Windows XP XP2 e Computer 1 3 50 GB RAM Computer 2 356 MB RAM e Using lt 20 MB Hard Disk Space e Mozilla Firefox 2 0 0 13 and Internet Explorer 7 0 5730 13 e phpDesigner2008 version 6 0 1 2 from MPSoftware e Notepad version 5 1 from Microsoft e Notepad version 4 6 distributed from sourceforge net There are really no known system requirements for this project package after testing However it is recommended that the user uses versions close to e Mozilla Firefox 1 9 and Internet Explorer 4 and has at least 20 MB space free on the hard disk f t PA ReView Final Report b PHP PHP or PHP Hypertext Preprocessor is a programming language that was designed for producing dynamic web pages It is still a popular misconception that PHP stands for Personal Home Page Tools as its name was in the beginning According to the official PHP webpage PHP is a widely used general purpose scripting language that is especi
78. ist of the information about the parents of horse gt lt the file allows the user to view his registration before submitting it to the database gt lt p gt lt h1 gt Skr ning lt h1 gt lt p gt lt this form show all the information gt lt form action line php method post gt lt table cellspacing 10px gt lt tr gt lt td gt Gender lt td gt lt td gt lt php checks if the the data sent is an array iterates through it and puts it into variable if is_array _POST gender foreach POSTI gender as g echo Sg lt br gt else no gender was selected echo No gender was selected gt lt td gt lt tr gt lt tr gt lt td gt ID number lt td gt lt td gt lt php echo _POST fnumber gt lt td gt lt tr gt lt tr gt lt td gt Name lt td gt lt td gt lt php echo _POST name gt lt td gt lt tr gt lt tr gt lt td gt Colour lt td gt lt td gt lt php checks if the data is a variable iterates through it and sends to an variable if is_array _POST lid foreach _POST lid as Sc echo Sc lt br gt else echo No colour was selected 48 Je ReView Final Report gt lt td gt lt tr gt lt tr gt lt td gt Fathers ID number lt td gt lt td gt lt php echo _POST ffnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of father lt td gt lt td gt lt
79. list of horses in database Function to print out the data entered by the user for the user to double check before sending it to the database gt lt the file gets parameters from the form in registration php prints them out and allows the user to view them Upon submitting the user will be directed to check php and can there see all the horses that are in the database gt lt p gt lt h1 gt Skraning lt h1 gt lt p gt lt ul gt lt form action check php method post enctype multipart form data gt lt table cellspacing 10px gt lt tr gt lt td gt Registration date lt td gt lt td gt lt php echo _POST day gt lt td gt lt td gt Price lt td gt lt td gt lt php echo _POST price gt lt td gt lt tr gt lt tr gt lt td gt ID number lt td gt lt td gt lt php echo _POST fnumber gt lt td gt lt tr gt lt tr gt lt td gt Name lt td gt lt td gt lt php echo _POST name gt lt td gt lt tr gt lt tr gt lt td gt Colour lt td gt lt td gt lt php Scolor gets the data chosen in the drop down list and determines if the variable is an array if is_array _POST lid looping through the values in the array foreach _POST lid as Scolor printing out the name of the colour echo Scolor lt br gt else echo No colour was selected gt lt td gt lt tr gt lt tr gt lt td gt Fathers ID number lt td gt
80. lt td gt amp nbsp amp nbsp lt td gt formating a number with grouped thousands echo lt td gt Price lt u gt number_format I price 2 lt u gt kr lt td gt echo lt tr gt echo lt tr gt echo lt td gt Name lt td gt echo lt td gt SI name lt td gt echo lt tr gt echo lt tr gt echo lt td gt Colour lt td gt echo lt td gt SI litirid lt td gt echo lt tr gt echo lt tr gt echo lt td gt lt td gt echo lt tr gt echo lt tr gt echo lt td gt Father lt td gt echo lt td gt SI ffnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Name lt td gt echo lt td gt SI fname lt td gt echo lt tr gt echo lt tr gt echo lt td gt Mother lt td gt echo lt td gt SI mfnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Name lt td gt echo lt td gt SI mname lt td gt echo lt tr gt echo lt tr gt echo lt td gt Location lt td gt echo lt td gt SI location lt td gt echo lt tr gt echo lt tr gt echo lt td gt Owner lt td gt echo lt td gt SI care lt td gt echo lt tr gt lt marks the line between horses gt echo lt tr gt lt tr gt echo lt tr gt echo lt table gt lt br gt lt br gt else
81. m into a drop down list while horselistF mysql_fetch_array Sfath Slfnumb ShorselistF fnumber SIname ShorselistF name echo lt option value Iname gt Slfnumb SIname lt option gt n gt lt select gt lt td gt lt tr gt lt th gt Mother lt th gt lt tr gt lt td gt lt php get the horse from the database Smoth mysql_query SELECT fnumber name FROM mother if Smoth exit lt p gt Unable to obtain colour list from the database lt p gt gt lt select name mot size 10 gt lt php put them into a drop down list while ShorselistM mysql_fetch_array Smoth Slmnumb ShorselistM fnumber Slmname ShorselistM name echo lt option value Imname gt SIlmnumb Slmname lt option gt n gt lt select gt lt td gt lt tr gt lt table gt lt form gt lt ul gt lt p gt lt br gt lt p gt lt php include footer php gt s jh ReView Final Report 6 hestur php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file hestur php Connected files registration php the registration form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database check php the complete
82. main php and footer php and the files have the ending php means that can have most of relevant tags in two files and don t need to put them into other files This also means that any change of outlook of the pages and menu will automatically transfer over to other files CSS could be set in a separate file but felt that it was not necessary because this is not that complicated code and in reality very simple Most of the code is dealing with the outlook of the menu and fonts The registration was not simple There was lot of discussion about how the form was supposed to be constructed and what should be in there It was decided that the most important information was the ID number of the horse and name ID number and name of the parents for the horse as well as owner and location The option to put in notes was also set there as well as the price This information is sent to one table with the information for the colour the parents and personnel pulled from other tables respectively Once a horse has been registered and sent to a table the user can choose to open in a new window called Take a look which holds list of all the horses in database table and there the user can view all the information about the horse or seen some very basic information about it or even delete the horse from the database The process of deleting a horse is simple When the user clicks the Delete option in the table a confirmation window is opened If the us
83. me lt td gt echo lt td gt SI fname lt td gt echo lt tr gt echo lt tr gt echo lt td gt Mother lt td gt echo lt td gt SI mfnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Name lt td gt echo lt td gt SI mname lt td gt echo lt tr gt echo lt tr gt echo lt td gt Location lt td gt echo lt td gt SI location lt td gt echo lt tr gt echo lt tr gt echo lt td gt Owner lt td gt echo lt td gt SI care lt td gt echo lt tr gt lt marks the line between horses gt echo lt tr gt lt tr gt echo lt tr gt echo lt table gt lt br gt lt br gt else else leave the message that there are no horses in the database exit There are no horses in the database gt s jh ReView Final Report 16 search php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file search php Connected files result php the results displayed main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database Function Search for data in database and upon submitting return the results in separate file result
84. n step 3 ii change extension dir to extension dir c php ext 6 If you have not installed Apache server please do so now Otherwise open the httpd config file for the Apache server The file is located at C Program Files Apache Group Apache2 conf httpd conf i First of all you must find were it says DocumentRoot and change it to DocumentRoot C webs note the forward slash ii Next find and change Directory should be whatever you set DocumentRoot to be to lt Directory C webs gt iii Thirdly find media types and add the following text after the 2 AddType lines ScriptAlias php c php AddType application x httpd php php php5 Action application x httpd php php php cgi exe SetEnv PHPRC C php iv Lastly find and change the Directorylndex to Directorylndex index htm index html index php 7 After these changes please restart the Apache server by double click on the Apache icon in your taskbar and click restart 8 Now you can create your first php file and test it You can do so by creating a file named phpinfo in the c webs folder and then in your browser call the file by typing in http localhost webs phpinfo php the content of the php file should be lt php phpinfo gt o jh ReView Final Report C Installation of MySQL The installation of MySQL has the assumption that the user has already downloaded the mysql essential 5 0 45 win32 file from http dev mysql com downloads my
85. n the page _ 88 A ReView Final Report 5 Reports ReView registration and viewing webpage Mozilla Firefox File Edit View History Bookmarks Tools Help 7 ft U_http localhost final mainReport php Getting Started amp Latest Headlines T Sports BostonHerald B HOME ReView registration an U ReView registration and v B Thu O8th of May 2008 18 49 53 PM Get report in html Pick a restriction Get horse list Se Get report in a Word document Pickarestriction _ Get horse list About Get report in a Excel spreadsheet Pick a restriction Get horse list The following horses are registered in the database Please insert name of Please insert the location Please insert the date the show of the show of the show ID number Name Location Group 1 152007223467 S rli em Gear a Reports The user can fill in the name of the show the horses are going to be at where the show is located and set when the date the show is to be The user then picks the horses that are to be on the show in the checkbox and if the user wants puts which group the horse is to be in Upon submitting the form the user can then view the report and print it out from the browser The user can pickin which order the user get the list of horses and get it in html form word document or e
86. n view all available data about he horse including in separate windows the offspring s assessments and owners history if available Should the user wish to change any data there is then a button at the bottom offering the user to click and open the registration form in which the user will change relevant data accordingly and save changes to the database From the registration window the user can fill in also in which retail shows the horse has already been to and when The user can also control more about the colours delete colour and add colour and add description to the colours The user can also make life easier for him and fill out the personnel who work around the horses included and not necessarily limited owners caretakers jockeys veterinarians judges and hosts of shows and contests The offspring s are entered just as normal horse would be As is shown in picture 3 the data needed is its unique identification number name identification numbers and names for its father or mother depending on whether the horse is a mare or stallion and the location since the foal might be in the ownership of someone else From the Viewing page the user will be able to go and see some available reports already configured for him but he will also be able to put forth some criteria to create some reports Readymade reports will be reports on a horse the user wants to print out or maybe to send out for someone to look over Overview over all the horses
87. nc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file registration php Connected files hestur php the view form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database Function to allow the users to enter the data for a horse and upon submitting to view the registration before sending it to the database gt lt this file displays some emtpy textboxes and a drop down lists with data gotten from the database the user fills out the textboxes at will and chooses data from the drop down menu if he so chooses upon submitting the user will be able to view the registration before sending it to the database gt lt p gt lt h1 gt Skraning lt h1 gt lt p gt lt ul gt lt form action hestur php method post gt lt table cellspacing 10px align left gt lt tr gt lt td gt Registration date lt td gt lt td gt lt input type text name day value lt php echo date m d y gt gt lt td gt lt td gt Price lt td gt lt td gt lt input type text size 26 maxlength 256 name price gt lt td gt lt tr gt lt tr gt lt td gt ID number lt td gt lt td gt lt input type text size 26 maxlength 256 name fnumber gt lt td gt lt tr gt lt tr gt lt td gt Name lt td gt lt td gt lt input t
88. ne project idea from Nik Whitehead my supervisor looked to me to be almost the same as the database idea had worked at in Access This time worked with the help of PHP MySQL and Apache and created a web page interface with MySQL database underneath lt ol type 1 start 1 gt lt li gt 1 The version of PHP or lt i gt PHP Hypertext Processor lt i gt used is 5 2 4 lt li gt lt li gt 2 The version of MySQL used is 5 0 45 lt li gt lt li gt 3 The version of Apache used is 2 0 59 lt li gt lt li gt lt li gt lt ol gt lt br gt lt p gt The interface is designed in lt p gt lt ol type 1 start 1 gt lt li gt 1 phpDesigner2008 version 6 0 1 2 gotten from lt a href http www mpsoftware dk target _blank gt MPSOFTWARE lt a gt lt li gt lt li gt 2 Notepad version 5 1 from Microsoft already in Windows lt li gt lt li gt 3 Notepad version 4 6 open source software freely distributed on sourceforge net lt li gt lt li gt lt br gt lt br gt lt li gt lt li gt 4 Mozilla Firefox version 2 0 0 13 freely distributed on the lt a href http www mozilla com target _blank gt Mozilla homepage lt a gt lt li gt lt li gt 5 Internet Explorer version 7 0 5730 13 already installed in Windows lt li gt lt ol gt lt br gt The project was finished by 9th of April and handed in the following day 10th of April lt br gt lt br gt lt br gt lt br gt lt br gt lt br gt l
89. nly Mozilla Firefox but there are number of web sites that are configured respond only to Internet Explorer so out of necessity use it In this project will however make use of all browsers can acquire e g Opera Netscape onto my computer to make sure that there are no compatibility issues later on My solution Design Relationship 1 shows how the database looked in the beginning After some discussions between me and Steinn it was decided to expand this a bit To compare the databases there are some noticeable differences Picture 3 shows the database as it is today 13 January 2008 and there contest location cdate motnr Amark Askopulag head hals bak samraemi fotagerd rettleiki filename mimetype location description notes filedata filestoreid kaup hofar behaviour PK id id Akostir tolt fnumber fnumber brokk name name skeid buyer seller stokk location location vilji phone phone bdate bdate price price name location date exhibit notes mfnumber mname location notes Relationships 2 The initial database layout 10 ReView Final Report is a very strong possibility that there will be some changes at later stages of the creation but without doubt some fine tuning will be made on the interface and database What Steinn wanted to see on the interface was a way for him to register horses for shows keep a list of all the horses and to
90. nsactional MyISAM 5 storage engine will be activated Af 105 jh ReView Final Report 11 Select C and Installation Path and click Next MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please select the drive for the InnoDB datafile if you do not want to use the default settings InnoDB Tablespace Settings Please choose the drive and directory where the InnoDB tablespace should be placed ci Installation Path iy Drive Info Volume Name System File System NTFS Eee 27 3 GB Diskspace Used C 3 GB Free Diskspace 12 Select Decision Support DSS OLAP and click Next MySQL Server Instance Configuration Wizard MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please set the approximate number of concurrenct connections to the server Decision Support DSS OLAP Select this option For database applications that will not require a high number of concurrent connections 4 number of 20 connections will be assumed Online Transaction Processing OLTP Choose this option for highly concurrent applications that may have at any one time up to 500 active connections such as heavily loaded web servers O Manual Setting Please enter the approximate number of concurrent connections 1 Concurrent connections 1
91. ntax i e the scripts are kept as readable as humanly possible which in turn allows for flexibility This flexibility however leads to security concerns as well as performance issues Rasmus Lerdorf is titled the father of PHP when he started with it in 1994 He used if mainly for maintaining his personal home page PHP2 came out year later and PHP3 in 1997 Today s version is number 5 2 5 and was released 8 November 2007 downloaded that version and set up but the version had before was number 5 2 3 have not yet had any problems with this version and Apache but fully expect them to occur MySQL is a high performance multi user relational database management system that today is the most popular choice when it comes to database driven web pages The reason for its popularity is preferably the easy way it has when it comes to maintaining it MySQL is open source SQL database system that has been developed supported and distributed by MySQL AB which was founded by the MySQL developers The current stable version of MySQL is 5 1 22 but the newest version is 6 0 3 alpha released unknown did get 5 0 45 since had some major problems concerning communications between the webpage and the database Other problems encountered were for example problems handling strings and numbers issues regarding privileges and connection problems from the website into the database have used phpMyAdmin occasionally to help with the database creation and main
92. ocalhost root admin 1 if the connection fails to the database server if Sdbcnx exit lt p gt Unable to connect to the database server at this time lt p gt 2 if the connection is ok we connect to the database we are looking for if Imysql_select_db skradir hestar exit lt p gt Unable to locate the horse database at this time lt p gt if mysql_query CREATE DATABASE skr ir hestar Sdbcnx exit database created else exit error creating database mysql_error gt ff 26 PA ReView Final Report 2 main php lt DOCTYPE html PUBLIC W3C DTD XHTML 1 0 Strict EN http www w3 org TR XHTML1 DTD XHTML1 strict dtd gt lt html xmins http www w3 org 1999 xhtml lang en xml lang en gt lt head gt lt title gt ReView registration and viewing webpage lt title gt lt meta http equiv content type content text html charset iso 8859 1 gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file main php Connected files 1st part of the front page Function the file holds all information about the outlook of the files for this project as all files include this one in the header gt lt style type text css gt pr padding widths in the elements sf p padding 10px J the configuration
93. on gt lt option value mfnumber gt Mothers ID Number lt option gt lt option value mname gt Mothers name lt option gt lt option value location gt Location lt option gt lt option value day gt Registration day lt option gt lt option value price gt Price lt option gt lt select gt lt td gt 52 ReView Final Report lt td gt Get horse list lt input type submit value Listing name Listing gt lt p gt lt td gt lt tr gt lt form gt lt the form in which the user picks a restriction to order by for html form gt lt form method post action excel php target _blank gt lt tr gt lt td gt lt h4 gt Get report in a Excel spreadsheet lt h4 gt lt td gt lt td gt lt p align center gt lt the fields to order by in gt lt select name fields size 1 gt lt option value gt Pick a restriction lt option gt lt option value fnumber gt ID Number lt option gt lt option value name gt Name lt option gt lt option value ffnumber gt Fathers ID Number lt option gt lt option value fname gt Fathers name lt option gt lt option value mfnumber gt Mothers ID Number lt option gt lt option value mname gt Mothers name lt option gt lt option value location gt Location lt option gt lt option value day gt Registration day lt option gt lt option value price gt Price lt option gt lt select gt lt td gt lt td gt Get horse li
94. ople showing interest into ReView will create central webpage and allow the user to connect to this central webpage to get information or send That webpage can then be a central place where people could keep track of retail shows see who is selling which horse and which horse is doing well if people will allow My tools There are some tools out there that are available to create a database driven webpage but they are as many as they are different chose Apache and MySQL because was at least familiar with them but once started researching decided on PHP because of 2 factors first did not know it but looked very interesting and second wanted to learn something new What is Apache According to the Apache website The Apache HTTP Server Project is a collaborative software development effort aimed at creating a robust commercial grade featureful and freely available source code implementation of an HTTP Web server Behlendorf amp al 2002 Apache HTTP Server or more commonly Apache is the market leading free web server according to NetCraft NetCraft 2007 While Apache is developed and supported by the open source community it is freely distributed and is easy to set up Many website designers have installed and set up Apache on their machines to enable easy way to preview and test websites while being developed Apache was first created by Robert McCool sometime in the early 1990s with its next version released in 200
95. osen gets the data chosen in the drop down list and determines if the variable is an array if is array POSTI fields looping through the values in the array foreach POST fields as SfieldChosen printing out the name of the colour Sfields SfieldChosen else echo No restriction was selected the query is sent to the database Sresult mysql_query SELECT FROM hestur ORDER BY Sfields if the query is not good if Sresult print an erro message exit Database error mysql_error check if the number of rows is null if mysql_num_rows Sresult gt 0 get the data from the array while 1 mysql_fetch_array Sresult print out the data echo lt table border 1 gt echo lt tr gt echo lt tr gt echo lt td gt lt b gt lt u gt Nr SI id lt u gt lt b gt lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt Registration date SI day lt td gt echo lt tr gt echo lt tr gt lt td gt lt td gt lt tr gt echo lt tr gt echo lt td gt ID Number lt td gt echo lt td gt SI fnumber lt td gt echo lt td gt amp nbsp amp nbsp lt td gt echo lt td gt amp nbsp amp nbsp lt td gt 60 ReView Final Report echo
96. php gt lt l this file is the search form it allows the user to pick from some drop down list where he wants to get the data from once the user hits the Go button a new window will open which will display the data searched for or left blank display all data gt lt this is the form the user will have to pick a field to search in and putin gt lt the data to search for gt lt p gt lt h1 gt Searching lt h1 gt lt p gt lt ul gt lt form method post action result php target _blank gt lt table border 0 cellpadding 0 cellspacing 0 gt lt tr gt lt td gt lt p align center gt lt the fields to search in gt lt select name fields size 1 gt lt option value fnumber gt ID Number lt option gt lt option value name gt Name lt option gt lt option value ffnumber gt Fathers ID Number lt option gt lt option value fname gt Fathers name lt option gt lt option value mfnumber gt Mothers ID Number lt option gt lt option value mname gt Mothers name lt option gt lt option value location gt Location lt option gt lt select gt lt the text box the user must fill in to search for gt lt input type text name search size 25 gt lt br gt lt br gt Search database lt input type submit value Search name Go gt lt p gt lt td gt lt tr gt lt table gt lt form gt lt ul gt lt p gt lt br gt lt p gt l
97. php gt here lt a gt to return exit Jelse exit Database error storing file mysql_error exit Default page view lists stored files get all the data from table filestore sql SELECT id filename mimetype description FROM filestore send the query Sfilelist mysql_query Ssql if the results are not good if Sfilelist print error message and terminate the script exit Database error mysql_error gt lt the upload form gt lt form action lt php echo _SERVER PHP_SELF gt method POST enctype multipart form data gt lt table gt lt tr gt lt td gt lt td gt lt tr gt lt tr gt lt td gt Insert image lt td gt lt td gt lt input type file name upload gt lt td gt lt tr gt lt tr gt lt td gt Description lt td gt lt td gt lt input type text name desc maxlength 255 gt lt td gt lt tr gt lt tr gt lt td gt lt input type submit value Upload gt lt td gt lt tr gt lt table gt lt form gt lt the table to list all the pictures gt lt p gt The following files are stored in the database lt p gt lt table border 1 cellpadding 5 cellspacing 0 gt lt tr gt lt th gt ID lt th gt lt th gt Filename lt th gt lt th gt Type lt th gt lt th gt Description lt th gt lt tr gt lt php check if the number of rows is empty if mysql_num_rows Sfilelist gt 0
98. php echo date D dS lof M Y H i s A gt lt h6 gt lt p gt if d d style display block lt script gt lt head gt lt body gt lt div id head gt lt div gt lt div id left gt lt dl id menu gt href registration php gt Registration lt a gt lt li gt href newcolor php gt Colour lt a gt lt li gt href personnel php gt Personnel lt a gt lt li gt href mainReport php gt Reports lt a gt lt li gt href search php gt Search lt a gt lt li gt look lt a gt lt li gt lt dt onclick javascript sedill gt lt a href index php gt Home lt a gt lt dt gt lt dt onclick javascript sedill smenu2 gt Registration lt dt gt lt dd id smenu2 gt lt ul gt lt li gt lt a lt li gt lt a href line php gt Linage lt a gt lt li gt lt li gt lt a lt li gt lt a lt ul gt lt dd gt lt dt onclick javascript sedill smenu3 gt Reports lt dt gt lt dd id smenu3 gt lt ul gt lt li gt lt a lt li gt lt a lt li gt lt a href check php gt Take a lt ul gt lt dd gt ff 29 Jh ReView Final Report lt dt onclick javascript sedill gt lt a href photo php gt Photos lt a gt lt dt gt lt dt onclick javascript sedill gt a href usermanual pdf target _blank gt User Manual lt a gt lt dt gt lt dt onclick javascript sedill gt lt a href about php gt About lt a gt lt dt gt lt dl gt lt
99. pplies to tables Father and mother These tables are almost the same and can be set into one table The biggest table is the contest table This table stores all the data about assessments in the contests the horse has gone to as well as putting the name location and date of the contest The user can also put in the name of the exhibit and the number the horse had in the contest The interface was perhaps the most difficult to decide Do we go all out in our constructions or do we employ KISS keep it simple stupid For this project it was decided to keep it simple reasoning that there will be always time to go back later and design the outlook properly So the first thing to do was to create some basic layout to have on hand to apply to all web pages would need to create Picture 3 shows how the main page looks like The yellow box to the right of the picture will be used to put in tips to help the users around when he is working in the interface On the front page is as well links to the registration window in the boxes at the left hand side if the user wishes to look at the list of horses the user has put in without setting any parameters and if the user wishes to search for something specific The top box will include the date e g Sun 13 of Jan 2008 and current time and will be showed on every page The last box on the left hand side will hold some links some that will already be configured there and possibly for the user to put in The s
100. r or remove Apache HTTP Server 2 0 59 To continue click Next Cancel 3 In this window you accept the terms in the license agreement after having read it and click next _ 96 ReView Final Report q fe Apache HTTP Server 2 0 Installation Wizard License Agreement Please read the following license agreement carefully Apache License a Version 2 0 January 2004 http www apache orglicenses TERMS AND CONDITIONS FOR USE REPRODUCTION AND DISTRIBUTION 1 Definitions License shall mean the terms and conditions for use reproduction and distribution as defined by Sections 1 through 9 ofthis document b I do not accept the terms in the license agreement Installsmield v jJ ReView Final Report 4 You read the text in this window and click next Apache HTTP Server 2 0 Installation Wizard x Read This First Read this Before Running Apache on Windows Apache HTTP Server wyhatis it The Apache HTTP Server is a powerful and flexible HTTP 1 1 compliant web server Originally designed as a replacement for the NCSA HTTP Server it has grown to be the most popular web server on the Internet As a project of the Apache Software Foundation the developers aim to collaboratively develop and maintain a robust commercial grade standards based server with freely available source code The Latest Version Details of the latest version can be found on t
101. r Icelandic horses today is WorldFengur WorldFengur is a joint effort by the FAIC Farmers Association of Iceland and FEIF International Federation of Icelandic Horse Association to collect data and store at one central location about horses of Icelandic origin in the world In WorldFengur you can find approx 300 000 Icelandic Horses with information on owners breeders offspring s pedigree and so on Ahola amp Lorange 2001 The database was created in the year 2000 and is only accessible through the internet Recently people have been able to put in and access DNA information for the horses 5 J1 ReView Final Report My project The Project nr Holl Nafn Ver f F nr 7 Knapi 7 Litur Umr am F g S mi p M p Netfang A L sing Table 1 Typical registration form In a way my project is similar to WorldFengur WorldFengur holds lot of information but does not hold all The interface will offer the user to enter much of the same information as WorldFengur does but will also give the user the ability to organize horses such as which horses are going to be on the retail show which horses are not Today owner of a horse sends Stein an email with the registration of the horse calls him on the phone or sends it to him in a fax When he came to me and asked me to create that something started by creating a database in Microsoft Access with an in
102. r survey Retrieved January 5 2008 from Netcraft http news netcraft com archives web_server_survey html Pfaffenberger B Schafer S White C amp Karow B 2004 HTML XHTML and CSS Bible Indianapolis Wiley Publishing Inc photographer U Picture of Icelandic horse Vima from L kjabotnum PHP Hypertext Preprocessor 2007 November Last updated 25 Retrieved November 8 2007 from PHP Preface Manual http www php net manual en preface php Ratschiller T amp al e 2007 phpMyAdmin 2 11 1 Documentation http www phpmyadmin net Yank K 2004 Build your own database driven website using PHP and MySQL Melbourne Sitepoint z Jh ReView Final Report Table of Figures Picture 1 The Celandic HOPS sasssa isis ai ai a a RA a a 5 Picture 2 the old interface in ACCESS ccscccesscesssscsssecseeeeceaecessaeescneeceeeeesuecsssaessaeeseesessaeessaaessenees 7 Picture 3 The initial interface cic ssc ccss cacaessocaceesstacdevvacddeesynctcdes haa sk ag aiaa 12 Picture 4 The initial registration form incomplete e 0ee00eeeesrers erna erna 13 Picture 5 The report TONM wivessschessacacccvssnacdenvaoaccev yee ches ka pau fh nd a a li i aa Ma 17 Picture b R gIStf tl i siss ga ng gg a a aS ERAR 84 Picture 7 Nage riin i EA EA ETES AAE EAAS 86 Picture 8 COIOUIS eisi iarsira srar i AEAEE EENS ESEE EESE ESE NAASTES 87 Picture 9 Personne l cisssccc
103. reed a healthy fertile and durable horse while preserving all the varieties of the coat colour found within the Icelandic horse race The horse is a riding horse and as such has many riding abilities Every horse is unique in its gaits but they all should be able to trot gallop walk pace and slow trot These styles are in addition to spirit slow canter and general impression These abilities are judged in competitions like Landsmot held every two years and is the main focus with lot of other shows including but not limited to retail shows and county fair The judges measure the horse for example they measure height at the highest point of the withers height at the lowest point of the back width of the chest and hooves The judges give the horses marks based on their abilities and how the horse is conformed The assessment system is made up of the goals for breeding in Iceland Finn Kringeland Hansen amp Antonsson 2002 All Icelandic horses have unique identification number and many horses have a microchip in them The identification number consists of 2 letters and 10 digits example 1S2002286808 e IS is the country code country of birth for the horse e 2002 is the year of birth e 2 is the sex of the horse 1 being the male horse 2 being the female e 86 being the area the horse is born in e 808 is the number the owner gives the horse As have said before the database in use fo
104. refox DAX File Edit View History Bookmarks Tools Help gt e C http ocalhost finav ine php Getting Started EN Latest Headines ReVew Registration an Li ReView registration an E Sports BostonHerald HOME ReView registration an ReView registration and v E Mon 07th of Apr 2008 19 58 41 PM L mage Gender 1 i Select gender ID number Name Colour Select one colour Fathers ID number Name of father Mothers ID number Name of mother Owner Location Contact Gender ID number Name Owner Location Male 151999123456 Ikarus lafur Hannesson Edit Delete Male 152006213467 G i Olafur Hannesson Gr nsta ir Edit Delete Gender ID number Name Owner Location Female 152006213467 Alma Olafur Hannesson Edit Delete Copyright 2007 2008 lafur Hannesson All rights reserved Picture 7 Linage Linage registration form see Picture 2 is very simple and holds most of the same text boxes as the registration form e The Gender is defined in the drop down list This is to prevent any confusion when the user is writing in the data about the horse e The ID number is a 12 digit string e g IS2008286801 This must be filled in for the registration to be successfully concluded e The Name is the name of the horse e The Colour is the just that the colour of the horse
105. s for Multipurpose Internet Mail Extensions and is a code to specify the media type of the file you are submitting MIME defines mechanisms for sending other kinds of information in email including text in languages other than English using character encodings other than ASCII as well as 8 bit binary content such as files containing images sounds movies and computer programs Converse Park amp Morgan 2004 This is when the 11 ReView Final Report browsers take the MIME type e g text plain image gif image jpeg etc of the file and check which type it is When making the table ready for inserting the images the size of the file becomes a factor because that must be defined Filedata is a binary data There are several BLOB column types designed to take and store variable length binary data The ones was interested in were TINYBLOB regular BLOB MEDIUMBLOB and LONGBLOB These BLOBs take different sized files TINYBLOB takes 255B or 255 characters regular BLOB takes 65KB or 65535 characters MEDIUMBLOB takes 16 8MB or 16777215 characters and the biggest is LONGBLOB that takes 4 3GB or 4294967295 characters Yank 2004 decided to go with MEDIUMBLOB for the simple reason that seriously doubt that the pictures will go above that size but are more likely to be in the region of 100KB to 200KB depending on the quality of the picture The table owner holds the information about the owner name address
106. s lt th gt lt tr gt lt php define the variable action and get it if isset S_GET action action _GET action else action bugl if the variable holds edit if Saction edit echo edit f ern P ReView Final Report elseif Saction del and isset _GET id if the variable holds del and the id is set Sid _GET id create query SsqlPerson DELETE FROM personnel WHERE id Sid send the query if mysql_query SsqlPerson if the query was successful echo lt p gt The person has been successfully deleted from the database lt p gt echo lt p gt Press lt a href personnel php gt here lt a gt to return lt p gt else if there was an error echo lt p gt There is a problem mysql_error lt p gt header location _SERVER PHP_SELF all messages have been printed the script is terminated exit get all teh data from personnel Ssql1 SELECT FROM personnel send the query Slist mysql_query Ssql1 check if it is alright with the results if Slist else print an error exit Database error mysql_error check if the results return empty rows if mysql_num_rows Slist gt 0 while there is any data in the resulting array while SI mysql_fetch_array Slist print it out in a table gt lt tr valign top gt lt td gt lt td gt lt td
107. sql 5 0 html 1 Click on Next Welcome to the Setup Wizard for MySQL Server 5 0 The Setup Wizard will install MySQL Server 5 0 release 5 0 45 on your computer To continue click Next WARNING This program is protected by copyright law Setup Type Choose the setup type that best suits your needs Please select a setup type Typical 4 Common program features will be installed Recommended For AF 2 general use Complete i V All program features will be installed Requires the most disk space Custom s Choose which program features you want installed and where they Ej will be installed Recommended for advanced users 2 Select Typical and click next 3 Click Install o jh ReView Final Report Ready to Install the Program The wizard is ready to begin installation Tf you want to review or change any of your installation settings click Back Click Cancel to exit the wizard Current Settings Setup Type Typical Destination Folder C Program Files MySQL MySQL Server 5 0 4 Click Next A MySQL Enterprise subscription is the most comprehensive offering of MySQL data software services and support t M y SQL business achieves the highest le security and uptime Enterprise _ An Enterprise Subscr 1 The MySQL Enterprise Server version of the worlds most popular o 2 The MySQL
108. st lt input type submit value Listing name Listing gt lt p gt lt td gt lt tr gt lt table gt lt form gt lt form action reports php method post gt lt p gt lt h2 gt The following horses are registered in the database lt h2 gt lt p gt lt table gt lt tr gt lt td gt Please insert name of the show lt td gt lt td gt lt input type text size 26 maxlength 256 name nameOfShow gt lt td gt lt td gt Please insert the location of the show lt td gt lt td gt lt input type text size 26 maxlength 256 name locationOfShow gt lt td gt lt td gt Please insert the date of the show lt td gt lt td gt lt input type text size 26 maxlength 256 name dateOfShow gt lt td gt lt tr gt lt table gt lt table border 1 cellpadding 5 cellspacing 0 gt lt tr gt lt th gt lt th gt lt th gt lt th gt lt th gt ID number lt th gt lt th gt Name lt th gt lt th gt Location lt th gt lt th gt Owner lt th gt lt th gt lt th gt lt th gt Group lt th gt lt tr gt lt php get all the data from table hestur SsqlCheck SELECT FROM hestur send the query and get the results back Slist mysql_query SsqlCheck if the results are not good if Slist print out error message exit Database error mysql_error if the number of rows is not empty if mysql_num_rows Slist gt 0 get the data from t
109. survey html Converse T Park J amp Morgan C 2004 PHP5 and MySQL Bible Indianapolis Wiley Publishing Incorporated Finn P Kringeland I Hansen J S amp Antonsson G 2002 FEIF Rules for Icelandic Horse Breeding INTERNATIONAL FEDERATION OF ICELANDIC HORSE ASSOCIATIONS NetCraft 13 October 2007 Web server survey S tt 5 January 2008 fra Netcraft http news netcraft com archives web_server_survey html Pfaffenberger B Schafer S White C amp Karow B 2004 HTML XHTML and CSS Bible Indianapolis Wiley Publishing Inc photographer U Picture of Icelandic horse Vima from L kjabotnum PHP Hypertext Preprocessor Last updated 25 November 2007 S tt 8 November 2007 fra PHP Preface Manual http www php net manual en preface php Ratschiller T amp al e 2007 phoMyAdmin 2 11 1 Documentation http www phpmyadmin net Yank K 2004 Build your own database driven website using PHP and MySQL Melbourne Sitepoint s PP ReView Final Report A Installation of Apache will assume that the user has downloaded the apache 2 0 59 win32 x86 no ssl msi file from http httpd apache org download cgi 1 When you have double clicked on the file you see this window Here you just choose Next iz Apache HTTP Server 2 0 Installation Wizard Welcome to the Installation Wizard for Apache HTTP Server 2 0 59 The Installation Wizard will allow you to modify repai
110. t php include footer php gt s jh ReView Final Report 17 result php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 04 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file result php Connected files search php the searching form main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database Function find and print out the results from the search from search php gt lt this file gets the parameters from search php goes and compares all the data to the information given and prints out the results the input needs to be as precise as possible since Alice will be found from Alice but not from Alice in Wonderland gt lt the table the results appear in gt lt table border 1 cellpadding 5 cellspacing 0 gt lt tr gt lt the column headers gt lt td width 100 gt lt b gt ID lt b gt lt td gt lt td width 90 gt lt b gt ID number lt b gt lt td gt lt td width 100 gt lt b gt Name lt b gt lt td gt lt td width 90 gt lt b gt Fathers ID number lt b gt lt td gt lt td width 100 gt lt b gt Fathers Name lt b gt lt td gt lt td width 90 gt lt b gt Mothers ID number lt b gt lt td gt lt td width 100 gt lt b gt Mothers Name lt b gt lt td gt
111. t stable versions of PHP MySQL and Apache From that time was about month were battled myself through numerous errors most of which could never figure out sat down read more about this and got files that were known to be stable and could work together The version of PHP used was 5 2 4 the version of MySQL 5 0 45 and the version of Apache used is 2 0 59 In my opinion are very few programs that allow for easy programming in PHP What mean is that unless you know the language inside out to program in Notepad or any such simple editors There were quite a few that pointed me towards phpDesigner and said that this was the editor to use for anyone creating webpage with database and such as the program allowed for programming in PHP HTML CSS and many more languages phpMyAdmin helped tremendously in latter stages of my project when needed an access to the database quickly When the project of installing PHP Apache and MySQL on a CD or a USB stick to use failed searched the internet for solution and found two while not perfect it was something could use WOS Webserver On Stick and XAMPP were the closest packages could find and could aid me with this project Both of them are free and have the newest compatible packages available in amongst many other side packages went with WOS for the reason that it is simpler to use than XAMPP When the user plugs the stick in with WOS it is a simple matter of double clicking on the icon to s
112. t u gt Contact information lt u gt lt br gt lt b gt lt i gt Olafur Hannesson lt i gt lt b gt lt br gt email lt a href mailto olafurhannesson gmail com gt olafurhannesson gmail com lt a gt lt br gt lt p gt lt php include footer php gt 76 Final Report ReView Complete Project plan Appendix B yoopno ayisqem ayy uo Buo mM 8002 ZEL 8000 1 LZ uonenjena 10 09 pue uuas aydoad JUEABIAI 0 papuey yoong 8002 1 S2 8004 Le 8002 22 USM jenuew sasn seBueyo peyse6Bns senieooy umeup SwesBeIp ayajduog peysiul4 YOOpNO ISJIM 9002 LOE 800Z 8 800Z E OZ g00ZZ LL I eseqgejeq dais g002 1 G 129 peysiuy nove g00z v g g00z 2 pue uoneeso aseqejeg ease mine wee a 8002 bbe 800Z ESL 8B0OZ L 8L 8002 L OL g00Z LL 8002 EL 800221 ajdwos 94 Xoiddy 8002 01 yoaloig JES jeul4 y u puep yoopno aysqam y uo Buppony 8002 LL 8002 0 8002 2 SL pod y WLI JU ut PUPH paueys upoo paddoys Supos 8002 181 SSO PUB IWLH 8007 b Z 8002 L E ReView Final Report Appendix C Sample data 1 Hestar Id 1 Day 15 04 2008 ID Number 1S2002186810 Name G i ID number father IS1986186055 Name of father Orri ID number mother IS1990286807 Name of mother lfhei ur Bj rk Litirid 1 Care runn Gu laugsd ttir Location L kjarbotnum Notes NULL
113. ta a 78 Appendix D User Maid ssaa ska a sk an aga Sk gd Nada ua gs ska sg nioran 80 ReView Final Report Introduction To use Apache PHP and MySQL is a monumental task in such a way that it can be used for so many tasks that a good sized webpage only scratches the surface Many choose though not to employ PHP for the security reasons and that applies to MySQL as well These packages will do well for small things that allow the user to hold around lots of data with minimal fuss especially since not everyone has access to the big and rather expensive database driven programs out there Where work is a database driven program suspicions about it being written in java and the database is MySQL and that program is very heavy to work with and is really expensive to boot It is however a program that would not recommend to anyone What is necessary for any programs is that they should be as light as possible PHP and MySQL are very light together but then my experience does count one project this one This project is very light and fully worked should do a whole lot more than any project with java or JavaScript does meaning that it should be lot more easily to work with This report does contain a bit of a background of the data involved description of the tools uses why this project was chosen and how It also details some design work as well as describing the implementation The implementation was a lot different from
114. tart the packages XAMPP is simple enough but the user has to manually start each package The project suffered a bit of indecisive people and sometimes indifference on how the database and the web page should work There was no shortage of ideas for the web page and only the timeframe that was in the way for me to implement them The outlook of the webpage was perhaps the easiest part to do of the entire project The difference between an outlook and the interface has different meanings in this context The outlook is concerned with colours fonts etz while the interface is concerned with where things belong on the webpage It was decided upon simple outlook because there is always the possibility later to go all out and create some fancy looking pages First of all decided in the beginning to split the pages up All necessary files would need to include the main file see in Appendix main php and footer see in Appendix footer php main php holds the beginning of the lt html gt tag along with the lt body gt tag and the code for the outlook the CSS part Small part is a JavaScript that control the menu in such a way that when the user clicks on one part of the menu it drops downs opens if you will to allow the 15 ReView Final Report user to choose which file he intends to go to The footer php holds the lt body gt tag and the lt html gt tag Because all the other files include those two files
115. td gt lt p align center gt lt the fields to order by in gt lt select name fields size 1 gt lt option value gt Pick a restriction lt option gt lt option value fnumber gt ID Number lt option gt lt option value name gt Name lt option gt lt option value ffnumber gt Fathers ID Number lt option gt lt option value fname gt Fathers name lt option gt lt option value mfnumber gt Mothers ID Number lt option gt lt option value mname gt Mothers name lt option gt lt option value location gt Location lt option gt lt option value day gt Registration day lt option gt lt option value price gt Price lt option gt lt select gt lt td gt lt td gt Get horse list lt input type submit value Listing name Listing gt lt p gt lt td gt lt tr gt lt form gt lt the form in which the user picks a restriction to order by for html form gt lt form method post action wordi php target _blank gt lt tr gt lt td gt lt h4 gt Get report in a Word document lt h4 gt lt td gt lt td gt lt p align center gt lt the fields to order by in gt lt select name fields size 1 gt lt option value gt Pick a restriction lt option gt lt option value fnumber gt ID Number lt option gt lt option value name gt Name lt option gt lt option value ffnumber gt Fathers ID Number lt option gt lt option value fname gt Fathers name lt opti
116. tenance as well as making sure that everything is as it should be phpMyAdmin is basically a help program that can manage a whole MySQL server needs a super user as well as a single database Ratschiller amp al 2007 Currently most websites that employ HTML employ CSS as well HTML stands for Hypertext Mark up Language and enables us to mark the text so it can function as hypertext on the web Editors like Notepad and Microsoft FrontPage mark the manuscript pages with symbols that tells the web how to print the page HTML uses its own set of symbols on how the browsers should display the pages CSS or Cascading Style Sheet was designed to help the designers with the formatting of the web pages comparable to the styles in programs like Microsoft Word CSS provides a way for the designer to specify the formatting in one file and have the changes reflected all over the website instead of having to lookup the formatting on many web pages By using CSS the designer is not only guaranteeing himself a way of making the life of maintaining the website much easier but it will also make it so that when a new person comes along that person can quickly set herself into the outlook of the website Everything else Currently use Notepad version 4 6 a free open source program as well as having access to phpDesigner 2007 professional from MPSoftware Both programs have their positive parts and both have their negative parts Probably the most
117. ter of the page db inc php the connection to the database Function to keep a list of all colours the user creates gt lt l the file allows the user to register any colours and keep a data about them gt lt the form the user uses to register any new colours gt lt p gt lt h1 gt Register new colour lt h1 gt lt p gt lt p gt lt p gt lt ul gt lt form action lt php echo _SERVER PHP_SELF gt method post gt lt table cellspacing 10px gt lt tr gt lt td gt lt h3 gt Name of colour lt h3 gt lt td gt lt input type text size 26 maxlength 256 name litur gt lt tr gt lt tr gt lt td gt lt h3 gt Description lt h3 gt lt td gt lt textarea name description rows 5 cols 42 gt lt textarea gt lt tr gt lt table gt lt input type submit value Submit name submit gt lt input type reset value Clear name clear gt lt form gt lt php if the name of the colour has been set if isset S_POST litur get the input Slitur _POST litur Sdescription POSTI description create the query Ssql INSERT INTO litir SET litur litur description Sdescription send the query if mysql_query sql print if successful echo lt p gt Your colour has been added to the database lt p gt echo lt p gt Please click lt a href newcolor php gt here lt a gt to return lt p gt else print if failed echo lt
118. terface That database was very simple as is shown in Relationships 1 There is one main table called Skr ir hestar which holds the information about the horse itself In the table are links to other tables holding the owner or caretaker Umradamadur colour Litur father of the horse Fa ir and mother M ir and finally the jockey Knapi Table 1 shows how the typical registration form looked like but this form was filled in after the information from the registration then printed out and used at the retail show As it was necessary they did not need too much information so the database did not need to be big nor was the interface anything special see Picture 2 In this first version the user needs to take all the data and set it in manually as usual however if the time allows me will put in place a function that allows them given that the file is of the correct format and the information is in correct place in the file to import the file into the database The ability to import the file will rest on the look of the registration form Table 1 Some modifications may be done later on the registration form but in essence it will be the same and look the same The user then will be able to type in missing information for the horse later on when he has time to spare ReView Final Report Umr ama ur Skr ir hestar Relationships 1 How the old database looked like
119. that have found or heard of that is like the project am doing but the very few that have heard of but not been able to get are for very different things Before starting on this project had never used PHP and only seen MySQL at work in passing lectures in the database course at the university Apache had never worked with either so it was in all a time of learning This combination of PHP MySQL and Apache does seem to be very good and very good for web design took an interest in this and have found a way to implement this on a USB disk and take with me although there are some problems with Apache will do my utmost to finish this project and continue learning PHP and MySQL beyond this project n2 jJ ReView Final Report Reference Ahola K amp Lorange J B 2001 July 23 Worldfengur ready for the world Information to the breeding leaders of the FEIF countries Europe and North America FEIF Behlendorf B amp al e 2002 The Apache HTTP Server Project Retrieved November 8 2007 from About the Apache HTTP Server Project http news netcraft com archives web_server_survey html Converse T Park J amp Morgan C 2004 PHP5 and MySQL Bible Indianapolis Wiley Publishing Incorporated Finn P Kringeland l Hansen J S amp Antonsson G 2002 FEIF Rules for Icelandic Horse Breeding INTERNATIONAL FEDERATION OF ICELANDIC HORSE ASSOCIATIONS NetCraft 2007 October 13 Web serve
120. the computer before the user can start using it have researched it a bit and have an idea of what to do and how to do it My idea is to either have this packed into a zip file put on a CD Then when the disk is inserted into the computer drive there will be auto run file set to run upon induction which will then proceed to create a map on the main drive for Apache PHP and MySQL and put a shortcut for the interface on the desktop of the computer The second option is the same way only to have the whole package unpacked on the CD and copied onto the C drive 14 A ReView Final Report Implementation The tools started this project in the beginning with the idea of using PHP MySQL and Apache have not strayed away from that idea and in fact added to that Html and CSS play big part in the development of this project and there is even a few lines of JavaScript there Beforehand the only programming languages had learned about before were html and a bit of MySQL The biggest challenges in the beginning were to get PHP MySQL and Apache to gel Once awhile when was experimenting with the languages error messages flooded in and 3 times had to start from scratch by uninstalling or removing the PHP and MySQL from the computer and install again most recently in the beginning of march The first problems encountered were which versions to use thought in the beginning that it would all be compatible and downloaded the newes
121. try again lt p gt 50 ReView Final Report gt lt form method get enctype text plain gt lt input type hidden value hva name gete gt lt form gt lt php include footer php gt s Jh ReView Final Report 11 mainReport php lt php include main php include db inc php gt lt Author Olafur Hannesson Date final changes and commenting 05 05 2008 Project part of final year project autumn semester 2007 spring semester 2008 Name of file mainReport php Connected files main php the outlook of the page and menu footer php the footer of the page db inc php the connection to the database reports php the report excel php table format for excel wordi php table format for word documents Function to show a list of all horses and allow the user to pick a horse or to get a report in Word format or Excel format to view all the horses gt lt l the file allows the user to fill in 3 text areas input being the name of the show if given location and date the user then picks the horses he wants to see by marking in the checkboxes and the group gt lt the form in which the user picks a restriction to order by for html form gt lt form method post action reportsN php target _blank gt lt table border 0 cellpadding 0 cellspacing 0 gt lt tr gt lt td gt lt h4 gt Get report in html lt h4 gt lt td gt lt
122. uickly that the PHP version did not work properly with the MySQL or Apache It did not matter what did or how it just did not work together Later went and searched for instructions on how to install these packages safely and get them to work together found out from the PHP webpage that the packages were incompatible and as such it was recommended older versions One thing found out as well was that it can matter in which order the packages should be installed started on Apache then took PHP and ended with MySQL There is a simple reason for that Apache must do some changes to the httpd config file that relate to PHP PHP must do some changes to php ini file that relate to Apache and MySQL Problems that faced in the programming were many but most of them feature missing comma bracket or misspelled word The one that took most of my time was when had a drop down list and to get the variable out The message got was always that it was an array So after having spent some time on it went into the PHP manual and looked up arrays This search did not give me much but wanted to be able to have the page check if the data sent is an array and if it is to loop through the data sent and print out each value or give a message that there is no data found after much search a variable handling function that finds whether a variable is an array knew that could use the keyword foreach and set any data sent as a variable and print it
123. umber mname ownerid phone location filename mimetype description filedata Relationships 3 the new database layout The database consists of 6 tables table for the colour any personnel father mother a table for the images and finally for the horse itself The database layout can be seen in Relationship 3 The difference from the old drawing is obvious 4 tables have been dropped on the request of Steinn for the reason that it is not necessary at this stage to have it in they might be added later While was not told any specifics there will possible be more data different data to put in but that is still undecided and unknown ReView Final Report Problems faced Some of the problems have faced with this project have been very strange not to say the least However most of the problems around the project were centred on the PHP package with the extensions There were coming some strange errors telling me that such and such file did not exist when they were amongst the extension files The error giving me the most headache was mbstring dll does not exist This popped up at the most unlikely time and wasn t resolved until simply deleted the file named mbstring dll and put semicolon in front of the extension in the php ini file The biggest problem faced in relation to this project was when installed the packages for Apache PHP and MySQL started by getting the newest packages available at the time but very q
124. urn anything if mysql_num_rows Sresult gt 0 send the data from an array to a variable while 1 mysql_fetch_array Sresult print out all the data gt lt table gt lt tr gt lt tr gt lt td gt lt b gt lt u gt Nr lt php echo SI id gt lt u gt lt b gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Registration date lt php echo SI day gt lt td gt lt tr gt lt tr gt lt td gt lt td gt lt tr gt lt tr gt lt td gt ID Number lt td gt _58 J ReView kr lt td gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt lt tr gt Final Report lt td gt lt php echo SI fnumber gt lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt amp nbsp amp nbsp amp nbsp amp nbsp lt td gt lt td gt Price lt u gt lt php echo number_format SI price 2 gt lt u gt lt td gt Name lt td gt lt td gt lt php echo SI name gt lt td gt lt td gt Colour lt td gt lt td gt lt php echo Sl lit
125. was how to find the string was looking for After many tries on using the equal sign in the query started to explore other options for example tried to use the MATCH AGAINST operators in the query and while that did work it only worked up to a point Finally tried the LIKE operator which is unfortunately case sensitive started to get the results wanted However the user must be mindful about how he types in the information in the database because of the case sensitivity The results are shown in a table on a page called results php y 2008 18 49 53 PM ration Get report in html Pick a restriction Get horse list listing orts tos fanga Ct report in a Word document Picka restriction ___ Get horse list listing out Get report in a Excel spreadsheet Pickarestiction Y Get horse list Listing The following horses are registered in the database Please insert name of the Please insert the location of Please insert the date of show the show the show ID number Name Location Owner 152007223467 S rli Group m Picture 5 The report form In the Reports page the user can get reports in html as a word document and as excel spreadsheet The user can pick a restriction meaning that if the user clicks on the drop down button he can pick under which restriction the horses are sorted by In Picture 5
126. xcel spreadsheet s PP ReView Final Report b Search ReView registration and viewing webpage Mozilla Firefox File Edit View History Bookmarks Tools Help 4 C http focaihost finalv search php ke G Getting Started amp Latest Headines ReView Registration an ReView registration an E Sports BostonHerald amp HOME ReView registration an Review e and v B a nm Mon 07th of Apr 2008 20 25 23 PM is searching ID Number Search database Copyright 2007 2008 lafur Hannesson All rights reserved http localhost finalV help php When the user has a name of a horse an ID number the user can pick out which of the information he has and write in a single string However in terms of names or location the searching string is for single string meaning that Bjork would return results while Bjork from Haukadal would not 90 ReView Final Report c Take a look ReView registration and viewing webpage Mozilla Firefox Fie Edit View History Bookmarks Tools Help E gt S amp GB L http Mocahost fnaV check php _ i EUC Getting Started Latest Headlines _ ReView Registration an L ReView registration an BH Sports BostonHerald amp HOME ReView registration an U ReView registration and v E Tutorial Setup
127. xit lt p gt You must fill in the ID number lt p gt if the gender is male if Sgender Male a query is created to send this into a correct table Ssql1 INSERT INTO father SET fnumber Sfnumber name Sname gender Sgender colour Slid ffnumber Sffnumber fname fname mfnumber Smfnumber mname Smname ownerid Scare phone Sphone location Slocation sends the query and checks if it is good if mysql_query Ssql1 then sends you to the correct page echo lt a href line php Jelse or prints out an error message echo lt p gt There are problems mysql_error lt p gt elseif Sgender Female if the gender is female create a query to send it into a correct table Ssql1 INSERT INTO mother SET fnumber Sfnumber name Sname gender Sgender colour Slid ffnumber Sffnumber fname Sfname mfnumber Smfnumber mname Smname ownerid Scare phone Sphone location Slocation sends the query and checks if it is good if mysql_query sql1 then sends you to another page echo lt a href line php Jelse or prints error message echo lt p gt There are problems mysql_error lt p gt else if no gender is chosen an error message are printed echo lt p gt There is a problem with the data insertion Please make sure you have chosen a gender and
128. xt MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please select a server type This will influence memory disk and CPU usage Developer Machine This is a development machine and many other applications will be run on it MySQL Server should only use a minimal amount of memory O Server Machine Several server applications will be running on this machine Choose J this option For web application servers MySQL will have medium memory usage O Dedicated MySQL Server Machine This machine is dedicated to run the MySQL Database Server No other servers such as a web or mail server will be run MySQL will utilize up to all available memory 10 Select Multifunctional Database and click Next MySQL Server Instance Configuration Configure the MySQL Server 5 0 server instance Please select the database usage Multifunctional Database General purpose databases This will optimize the server for the use of the fast transactional InnoDB storage engine and the high speed MyISAM storage engine O Transactional Database Only Optimized For application servers and transactional web applications This will make InnoDB the main storage engine Note that the MyISAM engine can still be used CO Non Transactional Database Only Suited for simple web applications monitoring or logging applications it as well as analysis programs Only the non tra
129. ype text size 26 maxlength 256 name name gt lt td gt lt tr gt lt tr gt lt td gt Colour lt td gt lt td gt lt php get the colours from the database Scolour mysql_query SELECT id litur FROM litir if Scolour exit lt p gt Unable to obtain colour list from the database lt p gt gt lt select name lid size 1 gt lt option selected value gt Select one colour lt option gt lt option value gt lt option gt lt php put them into a drop down list while Slit mysql_fetch_array Scolour SIname Slit litur echo lt option value Iname gt SIname lt option gt n gt a Jh ReView Final Report lt select gt lt td gt lt tr gt lt tr gt lt td gt Fathers ID number lt td gt lt td gt lt input type text size 26 maxlength 256 name ffnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of father lt td gt lt td gt lt input type text size 26 maxlength 256 name fname gt lt td gt lt tr gt lt tr gt lt td gt Mothers ID number lt td gt lt td gt lt input type text size 26 maxlength 256 name mfnumber gt lt td gt lt tr gt lt tr gt lt td gt Name of mother lt td gt lt td gt lt input type text size 26 maxlength 256 name mname gt lt td gt lt tr gt lt tr gt lt td gt Personnel lt td gt lt td gt lt php get the personnel from the database
Download Pdf Manuals
Related Search
Related Contents
Sistemas de Controle Fail-safe SIMATIC Safety Integrated C30 www.tunturi.com Gebruiks- aanwijzing Koel-vries- combinatie User manual Fridge Gigaset A580 IP calefaccion y aire acondicionado - Diagramasde.com No Da - Unblog.fr Table of Contents 1 - Ford C FlexiGuard Portable Box Frame Rail Fall Arrest System Manual Guide to Operations Z8 GP ZGP323 Programming System with USB Interface User Manual Copyright © All rights reserved.
Failed to retrieve file