Location: PHPKode > projects > Decider > decider/Questionaire/gethint.php
<?php

//get the q parameter from URL
$q=$_GET["quiz"];//lookup all hints from array if length of q>0

$k_p=$_GET["keyperson"];

require("../common/database.php");

//aquiring data for fake key person id
$my_query="select * from client_key_person where Id='".$k_p."'";

$my_result=mysql_query($my_query,$link);

$raw=mysql_fetch_array($my_result);

$k_p=$raw['Dkp_Id'];

//aquiring data for real key person id
$q_string="select distinct Q_Id from selected_quiz where turn='".$q."' and Person_Id='".$k_p."'";

$result=mysql_query($q_string,$link);

$q_ids;

if (strlen($q) > 0){
 	$question="";
 	$i=0;
  	while($row=mysql_fetch_array($result)){
		$q_ids[$i]=$row['Q_Id'];
      	$i++;
  	}


//creating text boxes	
    $quiz_no=1;
  	for($j=0;$j<count($q_ids);$j++){
  		$q_string1="select * from quiz where Id='".$q_ids[$j]."'";
  		$ques_result=mysql_query($q_string1,$link);

		$textarea=textarea.$q_ids[$j];
		$id=id.$j;
		
  		while($row1=mysql_fetch_array($ques_result)){
  			$question=$row1['Question'];

 			echo "<br>".$quiz_no.").".$question."<br>".'<textarea class="textboxarea" cols="40" id="'.$textarea.'" name="'.$textarea.'" ></textarea>';
			echo '<input type="checkbox" id="'.$q_ids[$j].'" name="'.$q_ids[$j].'" ></input> ok <br> <br>';
			$quiz_no++;
 		}
  	}
	
	echo '<input type="submit" value="     Add   " class="button" name="add" id="add">';
	
	//setting variables for further use
	echo '<input type="hidden" id="kp_id" name="kp_id" value="'.$k_p.'" >';
	
}

mysql_close($link);

?>


Return current item: Decider