![lloron](http://static.forosdelweb.com/fdwtheme/images/smilies/chillando.png)
La página web donde podeis verlo es http://www.claxyy.com/nrjs/miembros/admin.php
La página esta echa en Dreamweaver.
Aqui dejo el código :
Código PHP:
<?php require_once('../Connections/Miembros.php'); ?>
<?php
$currentPage = $_SERVER["PHP_SELF"];
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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']);
}
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
$updateSQL = sprintf("UPDATE miembros SET Lado=%s, Nick=%s, Nivel=%s, Imagen=%s, Imagen2=%s, Imagen3=%s, Cargo=%s WHERE idMiembro=%s",
GetSQLValueString(isset($_POST['Lado']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($_POST['Nick'], "text"),
GetSQLValueString($_POST['Nivel'], "text"),
GetSQLValueString(isset($_POST['Imagen']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Imagen2']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString(isset($_POST['Imagen3']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($_POST['Cargo'], "text"),
GetSQLValueString($_POST['idMiembro'], "int"));
mysql_select_db($database_Miembros, $Miembros);
$Result1 = mysql_query($updateSQL, $Miembros) or die(mysql_error());
}
$maxRows_Modificar = 1;
$pageNum_Modificar = 0;
if (isset($_GET['pageNum_Modificar'])) {
$pageNum_Modificar = $_GET['pageNum_Modificar'];
}
$startRow_Modificar = $pageNum_Modificar * $maxRows_Modificar;
mysql_select_db($database_Miembros, $Miembros);
$query_Modificar = "SELECT * FROM miembros";
$query_limit_Modificar = sprintf("%s LIMIT %d, %d", $query_Modificar, $startRow_Modificar, $maxRows_Modificar);
$Modificar = mysql_query($query_limit_Modificar, $Miembros) or die(mysql_error());
$row_Modificar = mysql_fetch_assoc($Modificar);
if (isset($_GET['totalRows_Modificar'])) {
$totalRows_Modificar = $_GET['totalRows_Modificar'];
} else {
$all_Modificar = mysql_query($query_Modificar);
$totalRows_Modificar = mysql_num_rows($all_Modificar);
}
$totalPages_Modificar = ceil($totalRows_Modificar/$maxRows_Modificar)-1;
$queryString_Modificar = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Modificar") == false &&
stristr($param, "totalRows_Modificar") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Modificar = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Modificar = sprintf("&totalRows_Modificar=%d%s", $totalRows_Modificar, $queryString_Modificar);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Modificar</title>
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<form name="form1" method="POST" action="<?php echo $editFormAction; ?>">
<table border="0" width="50%" align="center">
<tr>
<td width="23%" align="center"><?php if ($pageNum_Modificar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Modificar=%d%s", $currentPage, 0, $queryString_Modificar); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="31%" align="center"><?php if ($pageNum_Modificar > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Modificar=%d%s", $currentPage, max(0, $pageNum_Modificar - 1), $queryString_Modificar); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Modificar < $totalPages_Modificar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Modificar=%d%s", $currentPage, min($totalPages_Modificar, $pageNum_Modificar + 1), $queryString_Modificar); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Modificar < $totalPages_Modificar) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Modificar=%d%s", $currentPage, $totalPages_Modificar, $queryString_Modificar); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<?php do { ?>
<table align="center">
<tr valign="baseline">
<td nowrap align="right"><span class="Estilo11"></span></td>
<td><input type="hidden" name="idMiembro" value="<?php echo $row_Modificar['idMiembro']; ?>" size="32"></td>
</tr>