I am working on a web site using PHP
and JQuery Mobile
.
On a page I have a form:
<form method="post" name="form1" id="form1" onsubmit="return comprobardatos()" data-ajax="false" action="<?php echo $editFormAction; ?>">
<p>
Nombre:
<input type="text" name="nombre_plato" id="nombre_plato" value="" size="32" >
<div id="mensajealias"></div><div id="ajaxBusy" style="display: none;"><p><img src="wait.gif"></p></div>
</p>
<p>Descripción:
<input type="text" name="descripcion_plato" id="descripción_plato" value="" size="32"><div id="mensajenombre"></div>
</p>
<p>Precio 1:
<input type="text" name="precio1_plato" value="" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" size="32">
</p>
<p>Precio 2:
<input type="text" name="precio2_plato" value="" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" size="32">
</p>
<p>Precio 3:
<input type="text" name="precio3_plato" value="" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" size="32">
</p>
<p>Precio 4:
<input type="text" name="precio4_plato" value="" onkeypress="if ( isNaN(this.value + String.fromCharCode(event.keyCode) )) return false;" size="32">
</p>
<p>
<input type="button" name="clear" data-role="button" data-theme="e" value="Limpiar formulario" onclick="clearForm(this.form);">
<div id="boton"><input type="submit" data-role="button" data-theme="b"id="insertar" value="Insertar Nuevo Contenido de la Carta" ></div><div id="mensajeboton"></div>
</p>
<p>
<input type="hidden" name="cadena_plato" value="<?php echo $_SESSION[Region]?>">
<input type="hidden" name="restaurante_plato" value="<?php echo $_GET['rest']?>">
<input type="hidden" name="categoria_plato" id="categoria_plato" value="<?php echo $_GET['cat']?>">
<input type="hidden" name="MM_insert" value="form1">
</p>
</form>
The URL from the page is:
http://.../NuevoAdminPlato.php?rest=1&cat=9
When the user clicks on the submit button, the page AdminPlatos.php should be shown. This is the part of the code that I am using to go to the page>
$insertGoTo = "AdminPlatos.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
But the launched URL is?
http://.../AdminPlatos.php?rest=1&cat=9
And I don't want to get there the params> rest=1&cat=9
I guess this is a JQuery
issue, but I don't know how to avoid it.