muchas gracias ahora voy entendiento..el tema es que nose como implementear eso a mi codigo... mira vamos a desmenuzarlo...
el code completo
Código :
<?php require_once('Connections/firmas.php'); ?>
<?php require_once('Connections/firmas.php'); ?>
<?php
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_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO comentarios (Nombre, Url, Email, Comentario) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['Nombre'], "text"),
GetSQLValueString($_POST['Url'], "text"),
GetSQLValueString($_POST['Email'], "text"),
GetSQLValueString($_POST['Comentario'], "text"));
mysql_select_db($database_firmas, $firmas);
$Result1 = mysql_query($insertSQL, $firmas) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO comentarios (Nombre, Url, Email, Comentario) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['Nombre'], "text"),
GetSQLValueString($_POST['Url'], "text"),
GetSQLValueString($_POST['Email'], "text"),
GetSQLValueString($_POST['Comentario'], "text"));
mysql_select_db($database_firmas, $firmas);
$Result1 = mysql_query($insertSQL, $firmas) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$maxRows_comentarios = 15;
$pageNum_comentarios = 0;
if (isset($_GET['pageNum_comentarios'])) {
$pageNum_comentarios = $_GET['pageNum_comentarios'];
}
$startRow_comentarios = $pageNum_comentarios * $maxRows_comentarios;
mysql_select_db($database_firmas, $firmas);
$query_comentarios = "SELECT * FROM comentarios";
$query_limit_comentarios = sprintf("%s LIMIT %d, %d", $query_comentarios, $startRow_comentarios, $maxRows_comentarios);
$comentarios = mysql_query($query_limit_comentarios, $firmas) or die(mysql_error());
$row_comentarios = mysql_fetch_assoc($comentarios);
if (isset($_GET['totalRows_comentarios'])) {
$totalRows_comentarios = $_GET['totalRows_comentarios'];
} else {
$all_comentarios = mysql_query($query_comentarios);
$totalRows_comentarios = mysql_num_rows($all_comentarios);
}
$totalPages_comentarios = ceil($totalRows_comentarios/$maxRows_comentarios)-1;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>FIRMA!!</title>
<style type="text/css">
<!--
body {
background-color: #999999;
}
.Estilo1 {
font-size: 18px;
font-weight: bold;
}
a:link {
color: #FFFFFF;
}
-->
</style></head>
<body>
<table width="721" border="1" align="center">
<tr>
<td width="144"> </td>
<td width="411"><hr align="left" width="10" />
<p align="left" class="Estilo1">aca estan las firmas, que copado.... </p>
<div align="left">
<table width="460" border="0" align="center">
<?php do { ?>
<tr>
<td width="441"><p>Comentario de<strong> <?php echo $row_comentarios['Nombre']; ?></strong> <a href="mailto:<?php echo $row_comentarios['Email']; ?>">Email</a> <a href="<?php echo $row_comentarios['Url']; ?>">Url</a></p></td>
</tr>
<tr>
<td height="21"><p><?php echo $row_comentarios['Comentario']; ?></p></td>
</tr>
<tr>
<td height="21"><hr noshade="noshade" /></td>
</tr>
<?php } while ($row_comentarios = mysql_fetch_assoc($comentarios)); ?>
</table>
</div>
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<div align="left">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Nombre:</td>
<td><input type="text" name="Nombre" value="" size="50" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Url:</td>
<td><input type="text" name="Url" value="http://" size="50" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Email:</td>
<td><input type="text" name="Email" value="" size="50" /></td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap="nowrap">Comentario:</td>
<td><textarea name="Comentario" cols="50" rows="8"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input name="submit" type="submit" value="Post!" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</div>
</form> <p align="left"> </p></td>
<td width="144"> </td>
</tr>
</table>
<p> </p>
<p> </p>
</body>
</html>
<?php
mysql_free_result($comentarios);
?>
Bueno, la parte que vos me estas diciendo se parece a esta
Código :
mysql_select_db($database_firmas, $firmas);
$query_comentarios = "SELECT * FROM comentarios";
$query_limit_comentarios = sprintf("%s LIMIT %d, %d", $query_comentarios, $startRow_comentarios, $maxRows_comentarios);
$comentarios = mysql_query($query_limit_comentarios, $firmas) or die(mysql_error());
$row_comentarios = mysql_fetch_assoc($comentarios);
Ahi veo que hay algo de las limitaciones de entradas..debe ser que yo estableci repetir region solo 15 veces...debe ser eso...
Aca tenemos el formulario de envio
Código :
<form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
<div align="left">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Nombre:</td>
<td><input type="text" name="Nombre" value="" size="50" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Url:</td>
<td><input type="text" name="Url" value="http://" size="50" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Email:</td>
<td><input type="text" name="Email" value="" size="50" /></td>
</tr>
<tr valign="baseline">
<td align="right" valign="top" nowrap="nowrap">Comentario:</td>
<td><textarea name="Comentario" cols="50" rows="8"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input name="submit" type="submit" value="Post!" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1" />
</div>
</form>
y creo que nada mas, despues lo otro es configuracion que hay
...bueno es un avance para mi que soy principiante....identifique mas o menos las partes del code...pero la pregunta seria, como puedo adaptar el code que me pasaste a esto?...
Saludos y muchas gracias!!