Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
另一个输入类型为php的文件的php4到php5调用无效_Php_Forms_Post_Hidden_Php4 - Fatal编程技术网

另一个输入类型为php的文件的php4到php5调用无效

另一个输入类型为php的文件的php4到php5调用无效,php,forms,post,hidden,php4,Php,Forms,Post,Hidden,Php4,从PHP4更改为PHP5后,出现了一个问题,我在迁移常见问题中找不到它 <form method='post' action='galerie.php'> <input type='hidden' name='kategorieid' value='$id'> <input type='hidden' name='echtkategorie' value='$kategorie'> <input type='hidden' value='' name='

从PHP4更改为PHP5后,出现了一个问题,我在迁移常见问题中找不到它

<form method='post' action='galerie.php'>
<input type='hidden' name='kategorieid' value='$id'>
<input type='hidden' name='echtkategorie' value='$kategorie'>
<input type='hidden' value='' name='geaendert'>
<input name='imageField' type='image' src='../images/bearbeiten.gif' width='39' height='40' border='0' alt='Galerie &quot;$kategorie&quot; bearbeiten'>

galerie.php
I do
$befehl=“从$tabelle中选择kategorie,id,其中id='$kategorieid'”
但是kategorieid不在那里。

你使用的是
方法=“post”
,这意味着你应该使用
$\u post['id']
,而不是
$\u GET['id']

id=$\u post['kategorieid']
?var\u dump($\u post['kategorieid']);可以,但是如何在我的代码中使用它呢;这是有效的,我不知道为什么你应该像使用$\u GET['id']一样使用它,但是使用$\u POST['id']。请记住,由于您是从表单获取这些变量,因此必须对它们进行清理,否则您的站点将容易受到SQL注入和XSS的攻击。关于如何防范这些威胁,有很多解释<代码>mysql\u real\u escape\u string()
是不够的,只能防止SQL注入。同样,您应该使用改进版的
mysqli\u real\u escape\u string()。
$_GET['id']