Attached Files: Purpose: Practice Database connection from client Web Page using
ID: 3603671 • Letter: A
Question
Attached Files:
Purpose: Practice Database connection from client Web Page using PHP Coding. (Chapter 9 Coding.)
Instruction:
1. Create a Web application Books that provides the following functions with their corresponding pages:
a. Login: Only valid users are allowed to access the Web applications. it perform credential checking by validating the email and the password against a database table at the server side.
b. Show Books: It provides a Tab of Show Books. When it is clicked, a list available books will be listed with the fields of ISBN, Title, Author and Year on a new page
c. Delete Book: It provide a Tab of Delete Book. When it is clicked, a page with a textbox will display to allow a user to enter a ISBN number for deletion.
d. Update Book Page: It provide a Tab of Update Book. When it is clicked, a page with text boxes of ISBN number, author, title and year will display to allow a user to enter new values for author, title and year. The ISBN number is required field and the rest of three fields should be entered at least one for updating.
2. A sample sql statements for creating Books database and database operations such as select, update and delete are attached.
Thing to submitted:
1. php and/or html files.
2. Screen shots showing successful operations of login, show book, update and delete operations.
3. All the files aabove should be zipped in a single file including all the css and folders if there is any.
Explanation / Answer
Content-Type: text/html Set-Cookie: PREF=ID=5b14f22bdaf1e81c:TM=1167000671:LM=1167000671; expires=Sun, 17-Jan-2038 19:14:07 GMT; path=/; domain=.google.com Server: GWS/2.1 def show_color(request): if "favorite_color" in request.COOKIES: return HttpResponse("Your favorite color is %s" % request.COOKIES["favorite_color"]) else: return HttpResponse("You don't have a favorite color.") def set_color(request): if "favorite_color" in request.GET: # Create an HttpResponse object... response = HttpResponse("Your favorite color is now %s" % request.GET["favorite_color"]) # ... and set a cookie on the response response.set_cookie("favorite_color", request.GET["favorite_color"]) return response else: return HttpResponse("You didn't give a favorite color.")
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.