Código PHP:
<?
$url = 'http://www.lofftrrrs.com';
// la cambiare por esta direccion de un ROW que manejo
// $url = ".$row['url']."
$urlexists = url_exists($url);
function url_exists( $url = NULL ) {
if(( $url == '' ) ||( $url == NULL ) ){
return false;
}
$headers = @get_headers( $url );
sscanf($headers[0], 'HTTP/%*d.%*d %d', $httpcode);
//Aceptar solo respuesta 200 (Ok), 301 (redirección permanente) o 302 (redirección temporal)
$accepted_response = array(200,301,302);
if( in_array( $httpcode, $accepted_response ) ) {
echo "<center><a href=".$row['url']." target= '_blank' ><img src='botonpdf.png' width='32' height='32'></a></center>";
} else {
echo "<center><a href='pagina2.html' target='_blank'><img src='btn2.png' width='32' height='32'></a></center>";
}
}
?>
como hago para incluir ese código en esa tabla (ULTIMA CELDA DE LA TABLA) para que dependiendo de la información muestre el botón
pongo parte del código donde deseo incluir el código de arriba para que me funcione pues he intentado de las miles de maneras y no he podido.... A continuacion posteo una parte del código e indico en que celda de la tabla es que quiero que aparezca ese boton....
Código PHP:
if($row = mysql_fetch_array($consulta)) {
print "<center><table width='400' border=1 cellpadding=0 cellspacing=0>";
//-------------------------------------------------------------------
print "<tr>
<td height=59 colspan='4'><br><p><b> Placa: ".strtoupper($row['placa'])."</b><br>
<b> Nombre: ".strtoupper($row['nombre'])."</b><br>
<b> Identificación: ".$row["cedula"]."<br>
<b><p align=right>Notificaciones Encontradas: $numero </b><br><br>
</b></p></td>
</tr>
<tr>
<td width=90 bgcolor=#0066FF><center><b>Comparendo</b></center></td>
<td width=100 bgcolor=#0066FF><center><b>Fecha Fijación</b></center></td>
<td width=90 bgcolor=#0066FF><center><b>Fecha Desfijación</b></center></td>
<td width=80 bgcolor=#0066FF><center><b>Ver Notificación</b></center></td>
</tr>
";
do {
print"<tr class=off onMouseOver=this.className='on' onMouseOut=this.className='off'>
<td><center><a href=".$row["url"]." target= '_blank' >".$row["comparendo"]."</a></center></td>
<td><center><a href=".$row["url"]." target= '_blank' >".$row["fecha_fijacion"]."</a></center></td>
<td><center><a href=".$row["url"]." target= '_blank' >".$row["fecha_desfijacion"]."</a></center></td>
<td><center>--------- AQUI ES DONDE QUIERO QUE ME APAREZCA EL BOTON --------------</center></td>
</tr>";
}
while($row=mysql_fetch_array($consulta));
print"</table></center>";
print"<br>";
}
//*/