Changeset 185 for Dev/trunk/createObject.php
- Timestamp:
- 12/15/11 17:09:49 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/createObject.php
r166 r185 6 6 if (!empty($_POST['objectToCreate'])) { 7 7 $otc = $_POST['objectToCreate']; 8 } 9 else { 8 } else { 10 9 //die ("Invalid arguments passed!"); 11 10 } 12 } 13 else { 11 } else { 14 12 //die ("No arguments passed!"); 15 13 } 16 14 17 15 $dbi = new DatabaseInterface(); 18 $creator_results = $dbi->get("User", array("name" =>$_SESSION['username']));16 $creator_results = $dbi->get("User", array("name" => $_SESSION['username'])); 19 17 if (count($creator_results) > 0) { 20 18 $creator = $creator_results[0]; 21 } 22 else { 23 //die ("Invalid creator, make sur0e you are logged in!"); 19 } else { 20 //die ("Invalid creator, make sure you are logged in!"); 24 21 } 25 22 … … 39 36 //TODO 40 37 break; 38 case "question": 39 $newQuestion = new Question(null, "new Question", "int", "Default description", "Standard category", array()); 40 $dbi->set($newQuestion); 41 $uid = $newQuestion->uid; 42 break; 41 43 default: 42 44 //die ("Variable \$otc: $otc does not match a compatible object type!"); … … 45 47 46 48 echo $uid; 47 48 49 ?>
Note: See TracChangeset
for help on using the changeset viewer.