Cita:
read.phpWarning: mysql_free_result(): 5 is not a valid MySQL result resource in e:\servidor\www\ffextremo_cms\users\mail\read.php on line 160
Código PHP:
<?php require_once('../../Connections/ffextremo_cms.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;
}
}
mysql_select_db($database_ffextremo_cms, $ffextremo_cms);
$query_site = "SELECT sitename, sitedesc, siteauthor, sitekeywords, siteurl, siteys, siteyf FROM site";
$site = mysql_query($query_site, $ffextremo_cms) or die(mysql_error());
$row_site = mysql_fetch_assoc($site);
$totalRows_site = mysql_num_rows($site);
$colname_leer_mensaje = "-1";
if (isset($_POST['id'])) {
$colname_leer_mensaje = (get_magic_quotes_gpc()) ? $_POST['id'] : addslashes($_POST['id']);
}
mysql_select_db($database_ffextremo_cms, $ffextremo_cms);
$query_leer_mensaje = sprintf("SELECT * FROM email WHERE id = %s", GetSQLValueString($colname_leer_mensaje, "int"));
$leer_mensaje = mysql_query($query_leer_mensaje, $ffextremo_cms) or die(mysql_error());
$row_leer_mensaje = mysql_fetch_assoc($leer_mensaje);
$totalRows_leer_mensaje = mysql_num_rows($leer_mensaje);
?>
<!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><?php echo $row_site['sitename']; ?> » Zona de usuarios registrados »Leer mensajes</title>
<meta name="description" content="<?php echo $row_site['sitedesc']; ?>"/>
<meta name="keywords" content="<?php echo $row_site['sitekeywords']; ?>" />
<meta name="author" content="<?php echo $row_site['siteauthor']; ?>" />
<script language="javascript" type="text/javascript" src="../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash,searchreplace,print,contextmenu",
theme_advanced_buttons1_add_before : "save,separator",
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,zoom,separator,forecolor,backcolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
theme_advanced_buttons3_add_before : "tablecontrols,separator",
theme_advanced_buttons3_add : "emotions,iespell,flash,advhr,separator,print",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_path_location : "bottom",
plugin_insertdate_dateFormat : "%Y-%m-%d",
plugin_insertdate_timeFormat : "%H:%M:%S",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
external_link_list_url : "example_data/example_link_list.js",
external_image_list_url : "example_data/example_image_list.js",
flash_external_list_url : "example_data/example_flash_list.js"
});
</script>
</head>
<body>
<p><a href="<?php echo $row_site['siteurl']; ?>"><?php echo $row_site['sitename']; ?></a> » Zona de usuarios registrados » Leer mensajes </p>
<h2>Leer mensajes </h2>
<?php
if (!isset($_POST['id'])) {
echo "Error, no se ha definido la variable del mensaje seleccionado. Si ha accedido a esta error desde un enlace de la web contacte de immediato con el administrador.";
}
else
{
echo "<table width=\"60%\" border=\"0\">
<tr>
<td><strong>Asunto:</strong></td>
<td><label>"; echo $row_leer_mensaje['title']; echo "</label></td>
</tr>
<tr>
<td><strong>Remitente:</strong></td>
<td><label>"; echo $row_leer_mensaje['for']; echo "</label></td>
</tr>
<tr>
<td colspan=\"2\"><strong>Texto:</strong></td>
</tr>
<tr>
<td colspan=\"2\"><label>"; echo $row_leer_mensaje['text']; echo "</label></td>
</tr>
<tr>
<td><strong>Responder a </strong>"; echo $row_leer_mensaje['for']; echo "</td>
<td><form id=\"borrar\" name=\"borrar\" method=\"post\" action=\"delete.php\">
<input name=\"id\" type=\"hidden\" id=\"id\" value=\""; echo $row_leer_mensaje['id']; echo "\" />
<label>
<input type=\"submit\" name=\"Submit\" value=\"Borrar\" />
</label>
</form>
</td>
</tr>
</table>";
}
?>
<p> </p>
<p>Copyright ©
<?php echo $row_site['siteys']; ?> -
<?php echo $row_site['siteyf']; ?> <?php echo $row_site['sitename']; ?></p>
</body>
</html>
<?php
mysql_free_result($site);
mysql_free_result($leer_mensaje);
mysql_free_result($site);
?>