Hola, buenas tardes,
Tengo una web, creada con código PHP basado en la
versión 5.5.38.
Me comentan, que debería actualizarlo a la última versión, pero desconozco que
tengo que actualizar.
El archivo que me dá conexión a la Base de datos (contactos.php)
Código PHP:
Ver original<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_contactos = "dbXXXXXXcom";
$database_contactos = "dbXXXXXX";
$username_contactos = "dboXXXXXX";
$password_contactos = "XXXXXX";
?>
por otra banda, el archivo que recoge los datos de la BD y poder mostrarlos.
Código PHP:
Ver original<?php
?>
<?php
header("Cache-Control: max-age=86400"); //30days (60sec * 60min * 24hours * 30days) ?>
<?php require_once('../../Connections/contactos.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
}
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;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Recordset2 = 5;
$pageNum_Recordset2 = 0;
if (isset($_GET['pageNum_Recordset2'])) { $pageNum_Recordset2 = $_GET['pageNum_Recordset2'];
}
$startRow_Recordset2 = $pageNum_Recordset2 * $maxRows_Recordset2;
$query_Recordset2 = "SELECT * FROM contactos WHERE categoria_anuncio = 'zapatos' ORDER BY fechaentrada DESC ";
$query_limit_Recordset2 = sprintf("%s LIMIT %d, %d", $query_Recordset2, $startRow_Recordset2, $maxRows_Recordset2);
if (isset($_GET['totalRows_Recordset2'])) { $totalRows_Recordset2 = $_GET['totalRows_Recordset2'];
} else {
}
$totalPages_Recordset2 = ceil($totalRows_Recordset2/$maxRows_Recordset2)-1;
_...._
$query_Recordset4 = "SELECT * FROM combo WHERE tipo = '7' ";
_...._
$queryString_Recordset2 = "";
if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset2") == false && stristr($param, "totalRows_Recordset2") == false) { }
}
if (count($newParams) != 0) { }
}
$queryString_Recordset2 = sprintf("&totalRows_Recordset2=%d%s", $totalRows_Recordset2, $queryString_Recordset2); ?>
y en la zona del Body
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
...
Código PHP:
Ver original<?php do { ?>
...
<?php echo $row_Recordset2['idempleado']; ?>">
...
<div align="center">
<?php if ($pageNum_Recordset2 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset2=%d%s", $currentPage, 0, $queryString_Recordset2); ?>" title="xxx" style="color: #000">Primero</a>
<?php } // Show if not first page ?></td>
<td style="font-size: small">
<?php if ($pageNum_Recordset2 > 0) { // Show if not first page ?>
</body>
</html>
<?php
?>
Un saludo, y muchas gracias.