Make a calculator using PHP and an HTML form. The form should have two inputs. The form should submit a GET request either back to the same page or to a different results page. The calculator should support addition, subtraction, multiplication, and division by means of a radio button group on the page. (Consider edge cases!)
Simple File Sharing SiteYou will be making a simple file sharing site that supports uploading, viewing, and deleting files associated with various users. Details:
You should have a file named users.txt stored in a secure place on your filesystem. It should have at least three usernames, with one username per line.Passwords add an extra layer of complexity (encryption) that we will cover in Module 3. You will not earn credit for implementing passwords as your creative portion for this module.Users of the file sharing site should be able to enter their username and then log in.You may implement logins using session variables, or you may implement them using a GET parameter that is passed between pages. You will need to always use sessions starting in Module 3.Users should see a list of all files associated with their username after the log in.Users should be able to view, upload, and delete files associated with their username.The URI should NOT reveal the internal file structure of your web site.Example of what not to do: http://www.example.com/download.php?file=/home/paul/file.txtAnother bad example: http://www.example.com/~user/file.txtGood example: http://www.example.com/view.php?user=music&name=file.txtIn general, don’t reveal any internal information about the site.Food for thought: Given that Apache processes (with the exception of the main process) do not run as root, but rather as the user apache, how can you allow both your user account and the php scripts to read and write thenecessary files?Hint: You shouldn’t be storing the user-uploaded files in public_html (that is only the place for your own web-page files),Hint number 2: you will need to use chown to change permissions to let user apache have permissions on the user-files (that are not in the public_html folder). If you don’t know what this does or how to do this, look at the Apache pageYou should customize your file sharing site by implementing an additional feature or two as part of the creative portion.You will probably find the PHP guide on this wiki to be helpful: PHP#Other PHP Tips
Web Security and ValidationYour project needs to demonstrate that thought was put into web security and best practice. For more information, see this week’s Web Application Security guide: Web Application Security, Part 1
In particular:
Your application needs to follow the conventions of FIEO (Filter Input and Escape Output). Things you should filter include file names, usernames, and so on.Your project must pass the W3C Validator with no errors. For more information, see the HTML and CSS guide: HTML and CSS#Validation
Simple File Sharing SiteYou will be making a simple file sharing site that supports uploading, viewing, and deleting files associated with various users. Details:
You should have a file named users.txt stored in a secure place on your filesystem. It should have at least three usernames, with one username per line.Passwords add an extra layer of complexity (encryption) that we will cover in Module 3. You will not earn credit for implementing passwords as your creative portion for this module.Users of the file sharing site should be able to enter their username and then log in.You may implement logins using session variables, or you may implement them using a GET parameter that is passed between pages. You will need to always use sessions starting in Module 3.Users should see a list of all files associated with their username after the log in.Users should be able to view, upload, and delete files associated with their username.The URI should NOT reveal the internal file structure of your web site.Example of what not to do: http://www.example.com/download.php?file=/home/paul/file.txtAnother bad example: http://www.example.com/~user/file.txtGood example: http://www.example.com/view.php?user=music&name=file.txtIn general, don’t reveal any internal information about the site.Food for thought: Given that Apache processes (with the exception of the main process) do not run as root, but rather as the user apache, how can you allow both your user account and the php scripts to read and write thenecessary files?Hint: You shouldn’t be storing the user-uploaded files in public_html (that is only the place for your own web-page files),Hint number 2: you will need to use chown to change permissions to let user apache have permissions on the user-files (that are not in the public_html folder). If you don’t know what this does or how to do this, look at the Apache pageYou should customize your file sharing site by implementing an additional feature or two as part of the creative portion.You will probably find the PHP guide on this wiki to be helpful: PHP#Other PHP Tips
Web Security and ValidationYour project needs to demonstrate that thought was put into web security and best practice. For more information, see this week’s Web Application Security guide: Web Application Security, Part 1
In particular:
Your application needs to follow the conventions of FIEO (Filter Input and Escape Output). Things you should filter include file names, usernames, and so on.Your project must pass the W3C Validator with no errors. For more information, see the HTML and CSS guide: HTML and CSS#Validation
PHP Calculator (15 Points):The calculator is able to perform all four functions with floating point numbers (2 points each, 8 points in total)Each function is given as a radio button choice (4 points)The calculator page passes the W3C HTML validator (3 points)Make sure you have a README.md file in your individual repo with the the link to your calculator. See the Creative Portion section for more information about .md files.File Sharing Site (40 Points):File Management (25 Points):Users should not be able to see any files until they enter a username and log in (4 points)Remember that users.txt should be stored in a secure location on your filesystem. That is, you should not be able to type any URL into your browser and see the raw users.txt file!Users can see a list of all files they have uploaded (4 points)Users can open files they have previously uploaded (5 points)Note: Users should be able to open not only plain text files but also other file formats: images, spreadsheets, etc.Users can upload files (4 points)Note: Like users.txt, uploaded files should be stored in a secure location on your filesystem. That is, do not keep your uploads directory underneath a directory served by Apache!Users can delete files. If a file is “deleted”, it should actually be removed from the filesystem (4 points)The directory structure is hidden (2 points)Users can log out (2 points)Note: If using session variables, you must actually log out the user by destroying their session; i.e., don’t just redirect them to the login screen.Best Practices (10 Points):Code is well formatted and easy to read, with proper commenting (4 points)The site follows the FIEO philosophy (3 points)All pages pass the W3C validator (3 points)Usability (5 Points):Site is intuitive to use and navigate (4 points)Site is visually appealing (1 point)Creative Portion (15 Points) (see below)Make sure you have a README.md file in your group repo with the following:An .md file is a plain text file called a markdown file [1] .The contents of your README.md file are shown on your repo, making it easier for us to gradeYou may style the page with bolding, hyperlings, images, block quotes and listsThis online markdown editor makes it easy to learn this formatThe link to your file sharing site. We need this to grade your work.A brief description of what you did for your creative portionAny additional login details needed for the TACreative PortionThis module and all future modules will require that you invest some time into creating additional features for your group project. Plan to invest at least 60 minutes of your time into the creative portion.
The creative portion is an opportunity for you to learn the material of your own interest.You will not earn credit for a creative-portion feature that simply rehashes something you’ve already done in a previous module.If you need ideas for a creative portion, or if you want to know whether or not your creative portion idea is “hard enough”, ask a TA.