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"; $contactos = mysql_pconnect($hostname_contactos, $username_contactos, $password_contactos) or trigger_error(mysql_error(),E_USER_ERROR); ?>
por otra banda, el archivo que recoge los datos de la BD y poder mostrarlos.
Código PHP:
Ver original
<?php if(isset($_SERVER[HTTP_ACCEPT_ENCODING]) && substr_count($_SERVER[HTTP_ACCEPT_ENCODING], gzip)) ob_start(ob_gzhandler); else ob_start(); ?> <?php ?> <?php require_once('../../Connections/contactos.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { } $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": break; case "double": 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; $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); $totalRows_Recordset2 = $_GET['totalRows_Recordset2']; } else { } _...._ $query_Recordset4 = "SELECT * FROM combo WHERE tipo = '7' "; _...._ $queryString_Recordset2 = ""; foreach ($params as $param) { } } } } $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.