<?php
$current_subject = $_GET['subject_id'];
$current_content = $_GET['note_id'];
echo "<form method=\"post\" action=mainpage.php?subject_id=".$current_subject."¬e_id=".$current_content.">";
?>
<input type='text' name='list_item' value=''>
<input type='submit' name="new_item" value="New Item">
</form>
问题是,当GET
变量之一是两个单词链接不会这样写。因此,举例来说,如果$current_subject="Advanced Chemistry"
和$current_content="Valence Electrons"
链接会出来为:PHP GET方法空间错误
<form method="post" action="mainpage.php?subject_id=Advanced" chemistry¬e_id="Valence" electrons>
+1一个清晰,简洁的问题。 – 2011-12-28 23:48:33