$res = GetQuestion_ByID($_GET['var']); //echo question; echo "<legend>\n"; echo $res[0]['Title']; echo "</legend>\n"; echo "<div>\n"; echo $res[0]['Content']; echo "</div>\n"; echo "<div>\n"; echo $res[0]['Name']; echo "</div>\n"; echo "<div>\n"; echo $res[0]['Time']; echo "</div>\n"; //echo $_GET['var']. "<br/>"; $results = GetQuestion_Answer($_GET['var']); //foreach ($results as $key => $val){ // echo "$key => $val<br/>"; //} if ($results <= 0 || count($results) == 0) { } else { foreach ($results as $keys => $values) { //echo each file echo "<div class='jumbotron'>\n"; echo "<div>\n"; echo "<h6>\n"; //generate body here echo "Poster: " . $values['Name']; echo "</h6>\n"; echo "<p>\n"; //generate body here
<label for="Content">Content:</label> <textarea id="Content" name="Content" rows="5" cols="40"></textarea> </div> </div> </div> <button type="submit" class="btn btn-primary" name="answer_submit" id="answer_submit">Submit</button> </fieldset> </form> </div> <div class="container"> <fieldset> <legend>Answers</legend> <?php $answer_content = GetQuestion_Answer($question_id); //print_r($answer_content); $i = 0; $num = count($answer_content); while ($i < $num) { $answer_uid = Get_UID_By_AID($answer_content[$i]['AID']); $up_count = GetUpCount($answer_content[$i]['AID']); $down_count = GetDownCount($answer_content[$i]['AID']); echo "<div class=\"jumbotron\">\n"; echo "<h6>Answer by:" . $answer_content[$i]['Name'] . "</h6>\n"; echo "<h6>Time:" . $answer_content[$i]['Time'] . "</h6>\n"; echo "<p><font size=\"3\">" . $answer_content[$i]['Content'] . "</font></p>"; if (isset($_SESSION['login']) && $_SESSION['login'] == true) { echo "<div id=\"answer_info\" style=\"display: none;\">" . $answer_content[$i]['AID'] . "</div>"; echo "<a href=\"#\" class=\"up_count_btn\" id=\"up_count_" . $answer_content[$i]['AID'] . "\"><span class=\"glyphicon glyphicon-thumbs-up\" aria-hidden=\"true\"></span><span class=\"count\"> " . $up_count . "</span> Up</a>"; echo "<span>     </span>";