¿Cómo puedo hacer que este código someterse al cargar la página ..
- Mozzi
- Student


- Registrado: Ago 19, 2004
- Mensajes: 70
- Status: Offline
Hola .. He actualización de esta página .. pero tengo un formulario en ella .. Quiero formar a autosubmit en la carga
o mejor aún la recodificación de modo de actualizar sin tener que presentar...
¿Hay alguna forma de volver a codificar esto???
He tratado de eliminar el if (isset ($ _POST [ "button"])) por lo que automáticamente las actualizaciones .. pero no tengo suerte, como parece que esto debe ser presionado para hacer la función .. soy un poco novato para codificar la codificación manual .. asà que si alguien podrÃa ayudar, entonces serÃa una gran
o mejor aún la recodificación de modo de actualizar sin tener que presentar...
¿Hay alguna forma de volver a codificar esto???
He tratado de eliminar el if (isset ($ _POST [ "button"])) por lo que automáticamente las actualizaciones .. pero no tengo suerte, como parece que esto debe ser presionado para hacer la función .. soy un poco novato para codificar la codificación manual .. asà que si alguien podrÃa ayudar, entonces serÃa una gran
Código: [ Select ]
<?php require_once('../Connections/customer_zone.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
mysql_select_db($database_customer_zone, $customer_zone);
$query_Recordset1 = "SELECT * FROM claims";
$Recordset1 = mysql_query($query_Recordset1, $customer_zone) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
// *** FX Update Multiple Records in form1
if (isset($startRow_Recordset1)) $upd_Recordset1 = $startRow_Recordset1; else $upd_Recordset1 = 0; // counter
if (isset($_POST['button'])) {
$FX_sqlerror = "";
$FX_updredir = "view_claim.php";
mysql_select_db($database_customer_zone, $customer_zone);
for ($N=$upd_Recordset1+1; $N<=$totalRows_Recordset1; $N++) {
$updt_SQL = sprintf("UPDATE claims SET policy_gi_ref=%s, `read`=%s WHERE policy_gi_ref=%s",
isset($_POST["policy_gi_ref$N"]) ? ($_POST["policy_gi_ref$N"] != "" ? ("'".addslashes(stripslashes($_POST["policy_gi_ref$N"]))."'") : "NULL") : "''",
isset($_POST["read$N"]) ? ($_POST["read$N"] != "" ? ("'".addslashes(stripslashes($_POST["read$N"]))."'") : "NULL") : "''",
isset($_POST["fx_updmatch$N"]) ? ($_POST["fx_updmatch$N"] != "" ? ("'".addslashes(stripslashes($_POST["fx_updmatch$N"]))."'") : "NULL") : "''");
$updt_Result = mysql_query($updt_SQL, $customer_zone) or $FX_sqlerror .= "Row ".$N.": " . mysql_error() . "<br><br>";
}
if ($FX_updredir == "") $FX_updredir = basename($_SERVER['SCRIPT_NAME']);
if (isset($_SERVER['QUERY_STRING'])) {
$FX_updredir .= (strpos($FX_updredir, '?')) ? "&" : "?";
$FX_updredir .= $_SERVER['QUERY_STRING'];
}
if ($FX_sqlerror != "") {
echo '<font color="red">'.$FX_sqlerror.'</font>';
} else header("Location: " . $FX_updredir);
}
?>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<?php do { ?>
<?php $upd_Recordset1++; ?>
<input type="hidden" name="fx_updmatch<?php echo $upd_Recordset1; ?>" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
<input name="policy_gi_ref<?php echo $upd_Recordset1; ?>" type="hidden" id="policy_gi_ref" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
<input name="read<?php echo $upd_Recordset1; ?>" type="hidden" id="read" value="no" />
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<input type="submit" name="button" id="button" value="Submit" />
</form>
<?php
mysql_free_result($Recordset1);
?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
mysql_select_db($database_customer_zone, $customer_zone);
$query_Recordset1 = "SELECT * FROM claims";
$Recordset1 = mysql_query($query_Recordset1, $customer_zone) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
// *** FX Update Multiple Records in form1
if (isset($startRow_Recordset1)) $upd_Recordset1 = $startRow_Recordset1; else $upd_Recordset1 = 0; // counter
if (isset($_POST['button'])) {
$FX_sqlerror = "";
$FX_updredir = "view_claim.php";
mysql_select_db($database_customer_zone, $customer_zone);
for ($N=$upd_Recordset1+1; $N<=$totalRows_Recordset1; $N++) {
$updt_SQL = sprintf("UPDATE claims SET policy_gi_ref=%s, `read`=%s WHERE policy_gi_ref=%s",
isset($_POST["policy_gi_ref$N"]) ? ($_POST["policy_gi_ref$N"] != "" ? ("'".addslashes(stripslashes($_POST["policy_gi_ref$N"]))."'") : "NULL") : "''",
isset($_POST["read$N"]) ? ($_POST["read$N"] != "" ? ("'".addslashes(stripslashes($_POST["read$N"]))."'") : "NULL") : "''",
isset($_POST["fx_updmatch$N"]) ? ($_POST["fx_updmatch$N"] != "" ? ("'".addslashes(stripslashes($_POST["fx_updmatch$N"]))."'") : "NULL") : "''");
$updt_Result = mysql_query($updt_SQL, $customer_zone) or $FX_sqlerror .= "Row ".$N.": " . mysql_error() . "<br><br>";
}
if ($FX_updredir == "") $FX_updredir = basename($_SERVER['SCRIPT_NAME']);
if (isset($_SERVER['QUERY_STRING'])) {
$FX_updredir .= (strpos($FX_updredir, '?')) ? "&" : "?";
$FX_updredir .= $_SERVER['QUERY_STRING'];
}
if ($FX_sqlerror != "") {
echo '<font color="red">'.$FX_sqlerror.'</font>';
} else header("Location: " . $FX_updredir);
}
?>
<form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<?php do { ?>
<?php $upd_Recordset1++; ?>
<input type="hidden" name="fx_updmatch<?php echo $upd_Recordset1; ?>" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
<input name="policy_gi_ref<?php echo $upd_Recordset1; ?>" type="hidden" id="policy_gi_ref" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
<input name="read<?php echo $upd_Recordset1; ?>" type="hidden" id="read" value="no" />
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
<input type="submit" name="button" id="button" value="Submit" />
</form>
<?php
mysql_free_result($Recordset1);
?>
- <?php require_once('../Connections/customer_zone.php'); ?>
- <?php
- if (!function_exists("GetSQLValueString")) {
- function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
- {
- $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
- $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
- switch ($theType) {
- case "text":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "long":
- case "int":
- $theValue = ($theValue != "") ? intval($theValue) : "NULL";
- break;
- case "double":
- $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
- break;
- case "date":
- $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
- break;
- case "defined":
- $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
- break;
- }
- return $theValue;
- }
- }
- $editFormAction = $_SERVER['PHP_SELF'];
- if (isset($_SERVER['QUERY_STRING'])) {
- $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
- }
- mysql_select_db($database_customer_zone, $customer_zone);
- $query_Recordset1 = "SELECT * FROM claims";
- $Recordset1 = mysql_query($query_Recordset1, $customer_zone) or die(mysql_error());
- $row_Recordset1 = mysql_fetch_assoc($Recordset1);
- $totalRows_Recordset1 = mysql_num_rows($Recordset1);
- // *** FX Update Multiple Records in form1
- if (isset($startRow_Recordset1)) $upd_Recordset1 = $startRow_Recordset1; else $upd_Recordset1 = 0; // counter
- if (isset($_POST['button'])) {
- $FX_sqlerror = "";
- $FX_updredir = "view_claim.php";
- mysql_select_db($database_customer_zone, $customer_zone);
- for ($N=$upd_Recordset1+1; $N<=$totalRows_Recordset1; $N++) {
- $updt_SQL = sprintf("UPDATE claims SET policy_gi_ref=%s, `read`=%s WHERE policy_gi_ref=%s",
- isset($_POST["policy_gi_ref$N"]) ? ($_POST["policy_gi_ref$N"] != "" ? ("'".addslashes(stripslashes($_POST["policy_gi_ref$N"]))."'") : "NULL") : "''",
- isset($_POST["read$N"]) ? ($_POST["read$N"] != "" ? ("'".addslashes(stripslashes($_POST["read$N"]))."'") : "NULL") : "''",
- isset($_POST["fx_updmatch$N"]) ? ($_POST["fx_updmatch$N"] != "" ? ("'".addslashes(stripslashes($_POST["fx_updmatch$N"]))."'") : "NULL") : "''");
- $updt_Result = mysql_query($updt_SQL, $customer_zone) or $FX_sqlerror .= "Row ".$N.": " . mysql_error() . "<br><br>";
- }
- if ($FX_updredir == "") $FX_updredir = basename($_SERVER['SCRIPT_NAME']);
- if (isset($_SERVER['QUERY_STRING'])) {
- $FX_updredir .= (strpos($FX_updredir, '?')) ? "&" : "?";
- $FX_updredir .= $_SERVER['QUERY_STRING'];
- }
- if ($FX_sqlerror != "") {
- echo '<font color="red">'.$FX_sqlerror.'</font>';
- } else header("Location: " . $FX_updredir);
- }
- ?>
- <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
- <?php do { ?>
- <?php $upd_Recordset1++; ?>
- <input type="hidden" name="fx_updmatch<?php echo $upd_Recordset1; ?>" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
- <input name="policy_gi_ref<?php echo $upd_Recordset1; ?>" type="hidden" id="policy_gi_ref" value="<?php echo $row_Recordset1['policy_gi_ref']; ?>" />
- <input name="read<?php echo $upd_Recordset1; ?>" type="hidden" id="read" value="no" />
- <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
- <input type="submit" name="button" id="button" value="Submit" />
- </form>
- <?php
- mysql_free_result($Recordset1);
- ?>
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Enero 22nd, 2010, 11:22 pm
- nexuslite
- Newbie


- Registrado: Feb 11, 2010
- Mensajes: 10
- Loc: Keizer, OR
- Status: Offline
Generalmente uso
en lugar de
de esta manera sólo es comprobar si la variable se ha puesto de contenido. a continuación, presentar un formulario de JavaScript tendrá que formar parte de ella para que sea auto enviar el formulario.
Código: [ Select ]
if (isset($_POST) && count($_POST)) {
}
}
- if (isset($_POST) && count($_POST)) {
- }
en lugar de
Código: [ Select ]
if (isset($_POST['button'])) {
}
}
- if (isset($_POST['button'])) {
- }
de esta manera sólo es comprobar si la variable se ha puesto de contenido. a continuación, presentar un formulario de JavaScript tendrá que formar parte de ella para que sea auto enviar el formulario.
Página 1 de 1
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 2 mensajes
- Usuarios navegando por este Foro: Zealous y 209 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
