Location: PHPKode > projects > K-12 OSS Web Software Project > equest_0.1/teacher/finish.php
<?php
include("../config.php");

session_start();
if (!(isset($_SESSION['teacher']))) {
       header("Location: ../index.php");
       exit();
   }
?>

<html><head>
<title>eQuest Web Quest System</title>
<link type="text/css" rel="stylesheet" href="./styles.css">
</head>
<body>
<table class="maintable" bordercolor="#000066" cellspacing="0" cellpadding="3" align="center" border="1" width="600">
<tbody>
<?php include("./header.php"); ?>


<!-- start teacher list block -->
  <tr>
    <td class="text" bgcolor="#ffffff" valign="top">
<blockquote>
<?php
if (!get_magic_quotes_gpc()) { 
$mytitle = $_POST["mytitle"];
$intro = $_POST["intro"];
$task = $_POST["task"];
$process = $_POST["process"];
$resource = $_POST["resource"];
$evalu = $_POST["evalu"];
$conc = $_POST["conc"];
$label1 = $_POST["desc1"];
$label2 = $_POST["desc2"];
$label3 = $_POST["desc3"];
$label4 = $_POST["desc4"];
$label5 = $_POST["desc5"];
$label6 = $_POST["desc6"];
$label7 = $_POST["desc7"];
$label8 = $_POST["desc8"];
$label9 = $_POST["desc9"];
$label10 = $_POST["desc10"];
}

$mydate = date('Y-m-d H:i:s');
$quest_unique = $_POST["quest_unique"];
$quest_teacher = $_POST["quest_teacher"];
$pic = $_POST["pic"];
$link1 = $_POST["link1"];
$link2 = $_POST["link2"];
$link3 = $_POST["link3"];
$link4 = $_POST["link4"];
$link5 = $_POST["link5"];
$link6 = $_POST["link6"];
$link7 = $_POST["link7"];
$link8 = $_POST["link8"];
$link9 = $_POST["link9"];
$link10 = $_POST["link10"];

$insertSQL = "INSERT INTO quests SET
	      quest_unique='$quest_unique',
              quest_teacher='$quest_teacher',
              quest_title='$mytitle',
              quest_image='$pic',
              quest_intro='$intro',
              quest_task='$task',
              quest_process='$process',
              quest_resource='$resource',
              quest_eval='$evalu',
              quest_conclusion='$conc',
              quest_date='$mydate'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());

if($label1!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label1',
              link_url='$link1',
              link_unique='1',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label2!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label2',
              link_url='$link2',
              link_unique='2',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label3!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label3',
              link_url='$link3',
              link_unique='3',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label4!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label4',
              link_url='$link4',
              link_unique='4',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label5!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label5',
              link_url='$link5',
              link_unique='5',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label6!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label6',
              link_url='$link6',
              link_unique='6',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label7!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label7',
              link_url='$link7',
              link_unique='7',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label8!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label8',
              link_url='$link8',
              link_unique='8',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label9!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label9',
              link_url='$link9',
              link_unique='9',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}
if($label10!=NULL) {
$insertSQL = "INSERT INTO links SET
	      link_title='$label10',
              link_url='$link10',
              link_unique='10',
              link_quest='$quest_unique'";
mysql_query($insertSQL) or die ("Unable to insert data: ".mysql_error());
}


?>

		<h2>Congratulations, your web quest has been created!</h2>
		<?php //print_r($_POST);?>
		<?php //print_r($_FILES);?>	
		<p><a href="./members.php">Click here</a> to return to your list of web quests</p>

</blockquote>
    </td>
  </tr>
<!-- end teacher list block -->


<?php include("./footer.php"); ?>
Return current item: K-12 OSS Web Software Project