方法$ _GET和$ _POST在Joomla上不起作用 [英] Methods $_GET and $_POST doesn't work on Joomla
问题描述
通过单击表单的提交按钮可以执行页面,但是我无法将数据插入到表单中. 如果将php和html代码像在Joomla之外的文件一样上传到服务器上,则可以工作,但是如果将html代码上传到Joomla文章(在数据库内部)中,则该代码不起作用. 如果我用回声随机写一些东西,它将正确显示
The page gets executed by clicking on the submit button of the form but I can't get the data insered into the form. The php and the html code work if they are uploaded on the server like a file outside Joomla, but the code doesn't work if the html code gets uploaded on the Joomla articles (inside the database). if i write something random with echo it gets displayed correctly
Php代码
<php
$codice = $_GET["sblocca"];
echo $codice;
?>
HTML代码
<form action="/home/arioxurl/public_html/scriptPHP/ChiusuraPrestazione/generaFattura.php" class="form-horizontal" method="get">
<fieldset>
<!-- Form Name -->
<legend>Chiusura prestazione</legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="sblocca">inserisci il codice a sei cifre per sbloccare il pagamento</label>
<div class="col-md-4">
<input name="sblocca" type="text" placeholder="XXXXXX" class="form-control input-md" required="">
<>
<>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="NumFatt">inserisci il numero della fattura, deve essere incrementato di uno rispetto all'ultima generata (anche all'esterno di dashup)</label>
<div class="col-md-4">
<input id="NumFatt" name="NumFatt" type="text" placeholder="numero fattura es: 312" class="form-control input-md">
<>
<>
<!-- Multiple Checkboxes -->
<div class="form-group">
<label class="col-md-4 control-label" for="Conferma"></label>
<div class="col-md-4">
<div class="checkbox">
<label for="Conferma-0">
<input type="checkbox" name="Conferma" id="Conferma-0" value="1">
Conferma numero fattura
</label>
<>
<>
<>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="Download"></label>
<div class="col-md-4">
<button name="annulla" class="btn btn-info">Annulla</button>
<input type="submit" value="Sblocca pagamento e scarica fattura" class="btn btn-primary">
<>
<>
</fieldset>
</form>
推荐答案
$ _ GET应该始终有效,无论-如果看不到这些值,则意味着正在检查$ _GET数组的页面是不同的页面(通常是在提交页面上检查$ _GET数组时发生的情况). $ _POST也应该始终有效,但是在大多数情况下,表单提交都存储在$ _POST的嵌套数组中.
$_GET should always work, regardless - if you can't see the values, then this means that the page that you are checking the $_GET array is a different page (which is typically what happens when you check the $_GET array on the submitted page). $_POST should also always work, but, in most cases, the form submissions are stored in a nested array of $_POST.
正如其他人提到的那样,您应该使用Joomla函数来检索$ _GET和$ _POST值,主要是因为这些函数更安全.
As others have mentioned, you should use Joomla's function to retrieve $_GET and $_POST values, mainly because these functions are more secure.
这篇关于方法$ _GET和$ _POST在Joomla上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!