jorgestradingpost/lobsterstorm — pull request #4 by peterhurford (2014-03-07 16:01:29+00:00)
Title: Added Craigslist links

**Note:** This is a big change, so while I tested it rather thoroughly, I still expect it to not work right the first time. Feel free to check the code over.

## Craigslist Links
**upload.php** is changed to (a) add a secret 8 character secret token to the database and (b) email the name provided links to edit or delete their item, corresponding to that secret token. (**To do:** We'll have to also make sure the email doesn't get sent to spam and such. We also might want to make the process friendlier, e.g., by telling the user to look for an email.)

**The MySQL server** is changed to accept and store the secret token(already done).

**item.php** is changed to look at action=### in the URL and use ### to determine what to do next. If the first letter is a "u", it will look at the rest of the ### to see if the secret token matches the token stored for the id. If it does, it will provide an update form that allows the user to change the item name, description, and price. (**Note:** Changing more things, especially pictures, will prove complex, so I'm leaving that for a future update.)

**item.php** is also changed to look at action=### in the URL and use ### to determine what to do next. If the first letter is a "d", it will look at the rest of the ### to see if the secret token matches the token stored for the id. If it does, it will provide a button to delete the item. If pressed, the item will be removed from the database.

If the letter "u" or "d" is not first, or the token doesn't match the id, the preview page will just be shown.