10/09/2015 e.r.edwards 10/09/2015 staffordshire university school of computing easy php f available...
TRANSCRIPT
![Page 1: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/1.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
Easy PHP Available from - http://www.easyphp.org/ Local service on your machine Works from a data stick. It provides
– An apache web server (already functioning)– MYSQL server (already functioning)– PHP language development environment
Can be added to by ‘Modules’ eg– Content Management System – wordpress– Prestashop – e-commerce site– PHPMyAdmin – MySQl admin system
![Page 2: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/2.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
EsyPHP Admin Menu
![Page 3: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/3.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
MySQL Admin System
![Page 4: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/4.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
Code to Access MS ACCESS database
<?php$adoCon = new COM("ADODB.Connection");$sHere = dirname(__FILE__);Try{ $adoCon->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=$sHere/uidb2.mdb");}catch(Exception $e){ die('Sorry - Problem opening the database.<br />');}
Code to do things goes in here
$rsMain->Close();$rsMain = null;
$adoCon->Close();$adoCon = null;
?>
![Page 5: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/5.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
Code to access MYSQL file<?PHP
//try to connect to the database$con = mysql_connect("127.0.0.1", "test", "pass") or die("Failed to connect to DB, " . mysql_error() );$tiggerDB = mysql_select_db('modulemanager', $con) or die('Could not find database -die.');//Insert staff details into staff tabletry
{$tiggerDB =mysql_query ("INSERT INTO STAff (Username,Forename,Surname,Password,TelNo,Room) VALUES
('$Username','$Forename','$Surname','$Password','$Telno','$Room')"); }
catch(Exception $e){echo 'Sorry - details not enetered onto database <br />';}
mysql_close($con); header("Location: StaffList.php");
?>
![Page 6: 10/09/2015 E.R.Edwards 10/09/2015 Staffordshire University School of Computing Easy PHP F Available from -](https://reader035.vdocuments.us/reader035/viewer/2022071807/56649e2d5503460f94b1d907/html5/thumbnails/6.jpg)
19/04/23E.R.Edwards 19/04/23 Staffordshire UniversitySchool of Computing
Files in ..\www\SES
Class lists used by lectures– ClassListForm.htm fires ClassList.php – StudentTimetable.htm fires
StudentTimetable.php
Possible Improvements (if you are mad!)– Student online registration form?– Web based group list modification system.