我正在创建对下一页的引用,所以<a href="changePakett.php?pakett_id=<?=$pakett['pakett_id']?> ">change</a>
点击链接后,我有一个结果/changePakett.php?pakett_id=1
。这是我需要的结果,但我有一个问题。现在我需要pakett_id的价值我的查询里面,但我不能让它
if(isset($_GET['pakett_id'])){
$pakett_id = $_GET['pakett_id'];
if(isset($_GET['changepakett'])){
$connection = db_connect();
if($connection)
{
$kirjeldus = $_GET['kirjeldus'];
$hetke_hind = $_GET['hetke_hind'];
//invisible there
echo $pakett_id;
}else echo "Can't connect to DataBase";
}
}else echo "Sorry, don't understand which pakett you want to change =(";
我$_GET['pakett_id']
是,当我检查,如果它isset可见,但里面看不见另一如果(见代码注释)。我怎样才能将它隐藏在它看不见的地方?
UPDATE: changePakett.php form
<form action="../lib/functions.php" method="get">
<input type="text" name="kirjeldus" placeholder="kirjeldus"/>
<input type="text" name="hetke_hind" placeholder="hetke_hind"/>
<input type="submit" name="changepakett" value="change"/>
</form>
打印$ _GET看它所包含的内容。你在那里看不见什么意思? – WizKid