Are you sure you want to delete the bookmark: Untitled ?
Confirm Delete Bookmark
Here are the requirements for your project:
Your Hw2.zip folder should have a readme.txt file with all the names and ids for your group.
All pages produced by your app should be valid XHTML 5.
Your app should work regardless of what folder under DOCUMENT_ROOT the grader chooses to grade it. If you have variables/constants
that need to be set to ensure this, they should be in a file config.php which is require_once'd by your index.php file.
All urls used by your app (for links, form data, etc) should be of one of the following forms:
(1) index.php
(2) index.php?a=some_activity&arg1=some_argument1
(3) index.php?a=some_activity&arg1=some_argument1&arg2=some_argument2
Here allowed activities are: landing, edit, goUrl, confirm. An example possible use of the arg1 variable might be to hold a file title.
Your index.php should have four functions: landingView, editView, goUrlView, confirmView. These are supposed to draw the Landing Page, The Edit Page, the Update-Visits-Go-to-Url page, and the Confirm Page respectively, according to the mock-ups shown above. The only HTML that is output by your code, must be output in one of these four methods.
The h1 tag with Bookmark Manager in it on all pages should link back to the landing page.
On the landing page, the input text field should have Title for Bookmark as a placeholder attribute.
On the landing page, if a user enters a title which is empty, only white space characters, or has characters which are non-alpha numeric or space, then clicking create will take on back to the landing page.
On the landing page, if a user enters a non-empty, title which consists of alphanumeric and space characters, they should be taken to the edit page, and the title should appear in the h2 tag next to the words Edit:
Similarly, if a user clicks the edit button next to an existing file name they should be taken to the edit page. In this case, the url from a previous edit session should be loaded.
Clicking the save button on the Edit Page should save the text in the textarea into the url_files subfolder of your web application's folder. The name should be the string url concatenated with the php md5 function applied to title that was given on the landing page followed by .txt. For example, the above Edit page with title Yahoo would save to "url1334b6ec0ff0dc970481738a2374448c.txt".
The Return button on the Edit Page should just go to the landing page without saving the document.
If a user clicks on a link under my files, the browser should first go back to the bookmark site, update the number of visit count for that url which should be stored in a file in the url_files subfolder with the name "cnt" concatenated with the md5 of the title ."txt" (i.e., for our example, "cnt1334b6ec0ff0dc970481738a2374448c.txt"). The php script which updated this count should then output an HTTP Location: header to take the user to the desired URL.
If a Delete button on the Landing Page is clicked, the user should be taken to a Confirm Delete Page. This should have the text as in the mock-up above except that the name of the title should correspond to the Delete button clicked.
Clicking Confirm on a Delete Page should delete the corresponding file and return the user to the Landing Page.
Clicking Cancel on a Delete Page should return the user to the Landing Page without deleting the file.
Point Breakdown
Items (c)-(e), and (m) are each worth up 1pt
4pts
Items (a), (b), (f)-(p) (excluding (m)) are each worth a 1/2pt