php basics

Friday, June 09, 2006

Lab: Mycrypt Functionality

Create a website that does these things:

script 1--- index.html -------------------------
  • create an html form with 3 text boxes, a textarea, and a submit button to get the following info:

    • textbox 1 - firstname
    • textbox 2 - passphrase
    • textbox 3 - email address
    • textarea - at least 5 lines of 'good advice'

  • pressing submit sents the form data to senddata.php.
---------------------------------------

script 2 --- senddata.php ------------------------------
  • encrypts the data using the passphrase as a "key"
  • writes the encrypted data to a textfile called "info.txt"
  • emails "info.txt" as an attachment to the specified e-mail
  • prints a notice to the user that the e-mail was sent
  • shows a link to "decrypteddata.html" using this format:

    • $myaddress = "http://".$_SERVER['SERVER_NAME'].":".$_SERVER['$_SERVER_PORT'].
      "/".basename(dirname(_FILE_))."/decrypt.html";
----------------------------------------------------------

script 3 --- decryptdata.html -----------------------------
  • has a form asking the user for their passphrase in a textbox
  • form action: "./decryptdata.php"
----------------------------------------------------------

script 4 --- decryptdata.php ----------------------------
  • opens the file "info.txt"
  • decrypts the data using the passphrase send from decryptdata.html
  • displays the decrypted data to the screen
-------------------------------------------------------------

0 Comments:

Post a Comment

<< Home