iT邦幫忙

0

hi,我剛學程式語言, 照著書上做,居然不能work,嗚嗚~ 懇請各位大爺指教~~

<?php
if(isset($_POST['q1'])){
      $ans = $_POST['q1'];
      if($ans == 'a'){
         $result = '相當有創意';
	  }else if($ans == 'b'){
	     $result = '相當屌';
	  }else if($ans == 'c'){
	     $result = '相當智障';
}else { 
	  $result = '相當好笑';
	  }
	}
	  ?>

<html xmlins="http://www.w3.org/1999/xhtml" xmlns:fb="www.facebook.com/2008/fbml">


<meta http-equiv="Content-Type" content="text/html;  />


<?php
if (isset($result)){
     echo $result;
}else{
?>	 
<form method="post" action="?">
你最喜歡地球上的什麼?<br />
<input name="q1" type="radio" value="a" />A. 遊戲<br />
<input name="q1" type="radio" value="b" />B. 女人<br />
<input name="q1" type="radio" value="c" />C. 男人<br />
<input name="q1" type="radio" value="d" />D. 不是人<br />
<input type="hidden" name="signed_request" value="<?php echo $_REQUEST["signed_request"]; ?>" />

<input type="submit" name="btn" value="送出" />

</form>
<?php
}
?>
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

12
wiseguy
iT邦超人 1 級 ‧ 2012-05-07 21:43:57
最佳解答

第 19 行的最後,少了一個雙引號
text/html; />
改成
text/html;" />

qaw3388 iT邦新手 5 級 ‧ 2012-05-08 14:51:33 檢舉

簡直大意!!

@@

我要發表回答

立即登入回答