Jump to content

D3158

New Members
  • Posts

    3
  • Joined

  • Last visited

D3158's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. That kind of helped. It displayed the text below the table like this: Select your option: Radio button: Add Radio button: Modify Radio button: Delete Line No. to Delete/Modify = dropdown (doesnt have any values to it... I am assuming it's because the content within the table isn't shown which is indicated by line number 1 to 10 or something.. BUT it has this mean thing: Notice: Undefined variable: arrayContent in /home/..../..../..../public_html/..../Lab6/classes.php on line 89 ) Content to Add/Modify = Hrs [Dropdown from 1:00-24:00] Mins[Dropdown from 1:00-59:00] Day [Dropdown from 1-31] Month[Dropdown from 1-12] Year [Whatever year user wants to input] E-mail[Whatever email user wants to input] Message[Whatever message user wants to input] SUBMIT RESET Thanks!
  2. Well for lab6part2menu.php, when I use Google Chrome it doesn't show any error. Just plain white page. But when I use Mozilla Firefox, it shows me the following. The only thing that it displays is a "Content of your reminders" and a blank table. Fatal error: Class 'ModFile' not found in /home/student/2009/cst09020/public_html/comp170/Lab6/lab6part2menu.php on line 9 For lab6part2decision.php, i see "No selection made. Go back". Go back goes back to lab6part2menu.php For classes.php, it doesn't show any error. Just plain white page. Thank you!
  3. Content of your reminder file: <?php include "classes.php"; $orgFile = new ModFile; $orgFile->loadContent('cronpart2.txt'); $size=$orgFile->countLine(); $orgFile->displayContent(); ?> Select your options: Add a line Delete a line Modify a line Line No. to Delete/Modify: <?php for ($i=0; $i<$size; $i++) { echo "$i"; } ?> Content to Add/Modify: <?php echo "Hour"; echo ""; for ($hour=1; $hour<=24; $hour++) { echo "$hour"; } echo ""; echo "Minute"; echo ""; for ($min=0; $min<=59; $min++) { if ($min<10){ echo "$min"; } else { echo "$min"; } } echo ""; echo "Day"; echo ""; for ($day=1; $day<=31; $day++) { echo "$day"; } echo ""; echo "Month"; echo ""; for ($month=1; $month<=12; $month++) { echo "$month"; } echo ""; echo "Year"; echo ""; echo "Email"; echo ""; echo "Message"; echo ""; ?> lab6part2decision.php <?php if (!isset($_POST["doWhat"])){ die("No selection made.Back"); } $choice=$_POST["doWhat"]; include "classes.php"; $oldFile = new ModFile; $oldFile->loadContent("email.txt"); $oldFile->countLine(); switch ($choice) { case "add": if (!preg_match('/\b\d\d\d\d\b/', trim($_POST['year']))) { die("Year is not valid. Back"); } if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", trim($_POST['email']))) { die("Email is not valid. Back"); } $new=$_POST['hour'].",".$_POST['minute'].",". $_POST['day'].",".$_POST['day'].",".$_POST['month'].",". trim($_POST['year']).",".trim($_POST['email']).",".trim($_POST['message']); $oldFile->addLine($new); $oldFile->countLine(); $oldFile->writeToFile('email.txt'); break; case "delete": $lineToDelete=$_POST["chooseLine"]; $oldFile->deleteLine($lineToDelete); $oldFile->countLine(); $oldFile->writeToFile('email.txt'); break; case "modify": $lineToModify=$_POST["chooseLine"]; if (!preg_match('/\b\d\d\d\d\b/', trim($_POST['year']))) { die("Year is not valid. Back"); } if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", trim($_POST['email']))) { die("Email is not valid. Back"); } $change=$_POST['hour'].",".$_POST['minute'].",". $_POST['day'].",".$_POST['day'].",".$_POST['month'].",". trim($_POST['year']).",".trim($_POST['email']).",".trim($_POST['message']); $oldFile->modifyLine($lineToModify,$change); $oldFile->countLine(); $oldFile->writeToFile('email.txt'); break; } ?> Content of your REVISED reminder file: <?php $oldFile->countLine(); $oldFile->displayContent(); ?> Back for More Change
×
×
  • Create New...