Son archivos en pdf y cuando ingrese no solo quiero que pueda ver el nombre del archivo, sino que se le pueda dar clic para abrirlo y leerlo.
YO puse en la tabla, en el campo de phpmyadmin la ruta del archivo, pero....
Cómo hago el código para que lo muestre?
Este es mi código:
Código PHP:
<?php require_once('Connections/segurodb.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "error.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?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;
}
}
$colname_rc_logueo = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rc_logueo = $_SESSION['MM_Username'];
}
mysql_select_db($database_segurodb, $segurodb);
$query_rc_logueo = sprintf("SELECT empresa FROM registro WHERE nit = %s", GetSQLValueString($colname_rc_logueo, "int"));
$rc_logueo = mysql_query($query_rc_logueo, $segurodb) or die(mysql_error());
$row_rc_logueo = mysql_fetch_assoc($rc_logueo);
$totalRows_rc_logueo = mysql_num_rows($rc_logueo);
$colname_rc_prod = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rc_prod = $_SESSION['MM_Username'];
}
mysql_select_db($database_segurodb, $segurodb);
$query_rc_prod = sprintf("SELECT * FROM productos WHERE idprod = %s", GetSQLValueString($colname_rc_prod, "int"));
$rc_prod = mysql_query($query_rc_prod, $segurodb) or die(mysql_error());
$row_rc_prod = mysql_fetch_assoc($rc_prod);
$totalRows_rc_prod = mysql_num_rows($rc_prod);
?><!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>Palmera Junior - Control de Plagas</title><link rel="shortcut icon" href="favicon.ico" />
<link href="css/palmera.css" rel="stylesheet" type="text/css" />
<script src="js/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
</script>
</head>
<body>
<div align="center">
<table width="835" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<!--TABLA PRINCIPAL-->
<!--FIN TABLA PRINCIPAL-->
<tr>
<td width="835" height="328" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<!--TABLA SECUNDARIA PARA BANNER-->
<tr>
<td width="835" height="328" valign="top"><!--CELDA SECUNDARIA PARA BANNER--></td>
</tr>
</table></td>
</tr>
<tr>
<td height="18"></td>
</tr>
<tr>
<td height="252" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<!--TABLA MENU-->
<tr>
<td width="835" height="32" align="right" valign="middle" class="campos">Bienvenido, Sres. <?php echo $row_rc_logueo['empresa']; ?>. </td>
</tr>
<tr>
<td height="32" align="center" valign="middle" bgcolor="#FFFFFF" class="titulos_contenido">Has ingresado.
<!--CELDA MENU--></td>
</tr>
<tr>
<td height="50" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="835" height="50" valign="top">
<table border="1">
<tr>
<td>idprod</td>
<td>A1</td>
<td>A2</td>
<td>A3</td>
<td>A4</td>
<td>A5</td>
<td>A6</td>
<td>A7</td>
<td>A8</td>
<td>A9</td>
<td>A10</td>
<td>A11</td>
<td>A12</td>
<td>A13</td>
<td>A14</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rc_prod['idprod']; ?></td>
<td><?php echo $row_rc_prod['A1']; ?></td>
<td><?php echo $row_rc_prod['A2']; ?></td>
<td><?php echo $row_rc_prod['A3']; ?></td>
<td><?php echo $row_rc_prod['A4']; ?></td>
<td><?php echo $row_rc_prod['A5']; ?></td>
<td><?php echo $row_rc_prod['A6']; ?></td>
<td><?php echo $row_rc_prod['A7']; ?></td>
<td><?php echo $row_rc_prod['A8']; ?></td>
<td><?php echo $row_rc_prod['A9']; ?></td>
<td><?php echo $row_rc_prod['A10']; ?></td>
<td><?php echo $row_rc_prod['A11']; ?></td>
<td><?php echo $row_rc_prod['A12']; ?></td>
<td><?php echo $row_rc_prod['A13']; ?></td>
<td><?php echo $row_rc_prod['A14']; ?></td>
</tr>
<?php } while ($row_rc_prod = mysql_fetch_assoc($rc_prod)); ?>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="138"><!--DWLayoutEmptyCell--> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="37" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<!--TABLA BARRA-->
<tr>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="49" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<!--TABLA FIRMAS-->
<tr>
<td width="835" height="49" align="center" valign="middle" class="texto_firma"><!--TERMINA CELDA FIRMAS-->
<p>©2010 Palmera Junior - Todos los Derechos Reservados.</p>
<p><a href="home.html">Inicio</a> | <a href="empresa.html">Nosotros</a> | <a href="servicios.html">Servicios</a> | <a href="mecanismos.html">Mecanismos</a> | <a href="notas.html">Notas</a> | <a href="franquicias.html">Franquicias</a> | <a href="certificaciones.html">Certificaciones</a> | <a href="contactenos.html" target="_blank">Contáctenos</a> | <a href="http://mail.palmerajunior.com" target="_blank">Correo Corporativo</a></a></p>
<p class="formulario2">Este sitio dinámico está administrado por © Copyright 2010 <a href="http://www.isawebs.net" target="_blank">isawebs.net</a></p></td>
</tr>
</table></td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($rc_logueo);
mysql_free_result($rc_prod);
?>
Agradezco su orientación.