http://211.152.179.35/job/codes/jobsDetails.php?jobID=2
上面的是演示地址,我需要的功能是,在求值人员回答了发布者的问题(数量不定,选项个数不定)后,就可以发送应聘申请了.但是,我现在不知道如何把这些问题的答案放进数据库保存.
请高手给个思路.
相关代码如下:
template :
[PHP]
{webTitle}
<script LANGUAGE="JavaScript">
</script>
| {header} |
| {menu} |
|
| Jobs Details |
 |
| position |
{position} |
| description |
{description} |
| number |
{number} |
| salary |
{salary} |
| request |
{request} |
| date |
FROM:{startDate} TO:{endDate} |
|
|
|
| {footer} |
[/PHP]
code
[PHP]
<?php
/*
*/
//
include_once '../includes/config.inc.php';
include_once '../includes/db.inc.php';
include_once '../includes/template.inc.php';
include_once '../includes/functions.inc.php';
//
page_start ($cfg['webRoot'] .'/templates');
// include header and footer page
include_once 'header.php';
include_once 'footer.php';
// include menu
include_once 'menu.php';
//
$tpl->set_file ('jobsDetails', 'jobsDetails.htm');
//
$tpl->set_block ('jobsDetails', 'question', 'questionOut');
$tpl->set_block ('question', 'questions', 'questionsOut');
//
$tpl->set_var ('webTitle', $cfg['webTitle']);
//
$tpl->set_var ('jobID', $_GET['jobID']);
//
$sql = "SELECT * ";
$sql.= "FROM `jobs` ";
$sql.= "WHERE 1 ";
$sql.= "AND `id` = '$_GET[jobID]'";
$rs = $db->execute ($sql);
if ($rs)
{
$position = $rs->fields['position'];
$description = $rs->fields['description'];
$number = $rs->fields['number'];
$salary = $rs->fields['salary'];
$request = $rs->fields['request'];
$startDate = $rs->fields['startDate'];
$endDate = $rs->fields['endDate'];
$questions = $rs->fields['questions'];
$tpl->set_var ('position', $position);
$tpl->set_var ('description', nl2br ($description));
$tpl->set_var ('number', $number);
$tpl->set_var ('salary', $salary);
$tpl->set_var ('request', nl2br ($request));
$tpl->set_var ('startDate', $startDate);
$tpl->set_var ('endDate', $endDate);
if ($questions != '')
{
$questionsArray = explode('|X|', $questions);
for ($i = 0; $i < count ($questionsArray); $i ++)
{
$no = $i+1;
$questionsInfo = @getQuestionsInfo ($questionsArray[$i]);
$questionID = $questionsInfo->fields['id'];
$title = $questionsInfo->fields['title'];
$point = $questionsInfo->fields['point'];
$content = $questionsInfo->fields['content'];
$contentArray = explode('|X|', $content);
$tpl->set_var ('questionsOut');
$tpl->set_var ('no', $no);
$tpl->set_var ('questionID', $questionID);
$tpl->set_var ('title', $title);
$tpl->set_var ('point', $point);
for ($j = 0; $j < sizeof ($contentArray); $j ++)
{
$contentNo = $j + 1;
$tpl->set_var ('contentNo', $contentNo);
$tpl->set_var ('content', $contentArray[$j]);
$tpl->parse ('questionsOut', 'questions', true);
}
$tpl->parse ('questionOut', 'question', true);
}
}
}
//
page_end ('jobsDetails');
?>
[/PHP]