Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2008, 09:11
wasapfear
 
Fecha de Ingreso: mayo-2008
Mensajes: 21
Antigüedad: 15 años, 11 meses
Puntos: 0
PHP cargar un swf segun la id obtenida de otr pagina

ola tengo un pagina en php k tiene varias imagenes con una id correspondiente al hacer click t envia a otra pagina k obtiene la ip pero necesito poner el swf correspondiente a la id obtenida, os dejo el codigo

recibirid.php (esta es la pagina k obtien la id y deberia mostrar el swf)


<!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=utf-8" />
<title>Documento sin t&iacute;tulo</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<?php
function conectar()
{
$base_de_datos = "xxxxxxxx";
$db_usuario = "xxxxxxxx";
$db_password = "xxxxxxx";

if (!($link = mysql_connect("xxxxxxxx", $db_usuario, $db_password)))
{
echo "Error conectando a la base de datos.";
exit();
}
if (!mysql_select_db($base_de_datos, $link))
{
echo "Error seleccionando la base de datos.";
exit();
}
return $link;
}

$db = conectar();


$id = $_GET["id"];
if(empty($id)) Header("Location: paginacion.php");

$sql = "SELECT id, swf FROM articulos WHERE id='$id' ";
$rs = mysql_query($sql);

if ($rs) {

while($articulo=mysql_fetch_array($rs)) {

echo "<img src=".$articulo["swf"].">";


?>

</body>
</html>

tengo k cambiar el ( echo "<img src=".$articulo["swf"].">"; )
por el archivo swf pero no se como hacerlo dinamicamente espero k me ayudeis grax.