Ejemplo n.º 1
0
 public function askAction()
 {
     //include_once("connect.php");
     if ($_POST) {
         $content = $_POST['content'];
         $id = $_POST['UID'];
         $title = $_POST['title'];
         $abstract = substr($content, 0, 100);
         $nowtime = date('Y-m-d H:i:s');
         $tab = $_POST['tag'];
         //$tab = 'hahaha';
         $ask = new ask();
         $question = new question();
         $tag = new tag();
         $question_arr = array('QTitle' => $title, 'Qcontent' => $content, 'Qabstract' => $abstract, 'looknum' => 0);
         $qid = $question->insertQuestion($question_arr);
         $ask_arr = array('UID' => $id, 'QID' => $qid, 'time' => $nowtime);
         $ask->insertAsk($ask_arr);
         $tag_arr = array('QID' => $qid, 'tag' => $tab);
         $tag->insertTag($tag_arr);
         //$this->view->QID = $qid;
         echo $qid;
         //$this->render('questioned');
     }
 }