2011-05-22 113 views
0

嘿,夥計們,我無法通過......這傳遞變量「配置文件」與Smarty模板BTWphp表單不通過變量傳遞?

{if $commentpossible == true} 
     <form name="form1" method="get" action="comment.php?profile=5"> 
      <p> 
      <label for="comment"></label> 
      <textarea name="comment" id="comment" cols="45" rows="5" ></textarea> 
      <br> 
<input type="submit" name="Submit" id="Submit" value="Submit"> 
      </p> 
</form> 
     {/if} 

基本上這頁是個人資料?個人資料= 5做,我想通過通過該配置文件...我有5個manaully輸入atm而不是一個變量,只是看看它是否會起作用......它仍然不會......當提交被擊中時,它會轉到comment.php?comment = & Submit = Submit ....(評論有意空白)...我需要更多comment.php?profile = 5comment = blablabla等等

任何想法可能是什麼問題?

回答

3

添加profile作爲隱藏字段,當你使用GET方法:

{if $commentpossible} 
     <form name="form1" method="get" action="comment.php"> 
      <input type="hidden" name="profile" value="5"> 
      <p> 
      <label for="comment"></label> 
      <textarea name="comment" id="comment" cols="45" rows="5" ></textarea> 
      <br> 
      <input type="submit" name="Submit" id="Submit" value="Submit"> 
      </p> 
     </form> 
{/if} 
+0

哦甜蜜謝謝:d – 2011-05-22 11:29:48