Remember that you must...
Use WinSCP to connect to our remote server.
Details about your specific server, userid and password were emailed to you. Here is the general information:
ftp.sienasellbacks.com
or ftp.breimer.net
userid@sienasellbacks.com
or userid@breimer.net
Be sure to replace userid
with your actual Siena userid; But, do not add @siena.edu
project3
folder, open manage_courses.php
or create the file if you haven't alreadyDELETE FROM $table_name WHERE cid='$cid' AND uid='$uid'
Show your instructor that both manage courses and delete are now secured, i.e., they will only work for logged in users and will only delete the courses of a logged in user
functions.php
make sure your page generation function includes the custom.js scriptmanage_courses.php
entirely remove the href
attribute of the delete link and instead "pass" the cid
using the id
attributedelete
to the list of class nameshref
this a
tag will act as a button instead of a hyperlinkjs
folder, open custom.js
and add the following code:$(function () { $('[data-toggle="popover"]').popover() $(".delete").click(doIt); function doIt() { var cid = this.id; // HTML nodes have an id field that we can use to know exactly which delete button was clicked alert("CID: " + cid); var btn = $(this); // btn is now a jquery object constructed from the HTML node alert("BTN: " + btn.html()) // jquery objects have useful methods like html, which fetches the inner HTML of the tag // Rather than have the browser hyperlink to the script, we call the script asynchronously using the jQuery ajax method var myurl = "delete_course.php?cid="+cid; $.ajax({ url: myurl, success: function(data){ btn.parent().parent().remove(); alert(data); } }); } });
Show your instructor that delete is now working using asynchronous javascript.
None. To get credit for lab you must work productively for the 2 hour period.
While it is OK to help other students with concepts and general trouble-shooting, you should not share code. It is expected that each individual project will be unique.