Va todo bien menos en la parte donde yo subo algun juego.
Lo que yo hago es subir bueno la imagen del juego y el .swf por ftp ya que no podia hacerlo mediante php, y hise digamos una pagina de administracion para que suba todo a la base de datos donde despues con los datos de esa base cree una pagina por cada juego y este para jugarlo
Le muestro el codigo
Administracion general donde subo todo para la base de datos:
Cita:
Lo que hace al darle al boton crear:<?php
session_start();
echo '<link href="style.css" rel="stylesheet" type="text/css" media="screen" />';
?>
<?php
require("connect.php");
echo '<div id="header">';
echo '<div id="logo">';
echo '<h1><a href="#">DivertiGame </a></h1>';
echo '<p><em> Juegos Flash</a></em></p>';
echo '</div>';
echo '<hr />';
echo '<div id="menu">';
echo '<ul>';
echo '<li><a href="#" class="first">Inicio</a></li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '<div id="wrapper">';
echo '<div id="wrapper-bgtop">';
echo '<div id="wrapper-bgbtm">';
echo '<div id="page">';
echo '<div id="content">';
echo '<div class="post">';
echo '<form action="adm_4.php" method="post">';
echo 'Nombre de Juego:<br>';
echo '<input name="name" type="text" /><br>';
echo 'Categoria:<br>';
echo '<input name="cat" type="text" /><br>';
echo 'Nombre del SWF:<br>';
echo '<input name="swf" type="text" /><br>';
echo 'Nombre de la Imagen:<br>';
echo '<input name="img" type="text" /><br>';
echo '<input name="asd" type="submit" value="Crear"/><br>';
echo '</form>';
echo $_SESSION['usuario'];
echo '<a href="deslogeo.php">Deslogear</a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div style="clear: both;"> </div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div id="footer-bgcontent">';
echo '<div id="footer">';
echo '<p>Copyright (c) 2010 nevia.com.ar Todos los derechos reservados.</p>';
echo '</div>';
echo '</div>';
echo '<div style="text-align: center; font-size: 0.75em;"><a href="administracion.php">ADMINISTRACION</a>.</div>';
?>
session_start();
echo '<link href="style.css" rel="stylesheet" type="text/css" media="screen" />';
?>
<?php
require("connect.php");
echo '<div id="header">';
echo '<div id="logo">';
echo '<h1><a href="#">DivertiGame </a></h1>';
echo '<p><em> Juegos Flash</a></em></p>';
echo '</div>';
echo '<hr />';
echo '<div id="menu">';
echo '<ul>';
echo '<li><a href="#" class="first">Inicio</a></li>';
echo '</ul>';
echo '</div>';
echo '</div>';
echo '<div id="wrapper">';
echo '<div id="wrapper-bgtop">';
echo '<div id="wrapper-bgbtm">';
echo '<div id="page">';
echo '<div id="content">';
echo '<div class="post">';
echo '<form action="adm_4.php" method="post">';
echo 'Nombre de Juego:<br>';
echo '<input name="name" type="text" /><br>';
echo 'Categoria:<br>';
echo '<input name="cat" type="text" /><br>';
echo 'Nombre del SWF:<br>';
echo '<input name="swf" type="text" /><br>';
echo 'Nombre de la Imagen:<br>';
echo '<input name="img" type="text" /><br>';
echo '<input name="asd" type="submit" value="Crear"/><br>';
echo '</form>';
echo $_SESSION['usuario'];
echo '<a href="deslogeo.php">Deslogear</a>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div style="clear: both;"> </div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '<div id="footer-bgcontent">';
echo '<div id="footer">';
echo '<p>Copyright (c) 2010 nevia.com.ar Todos los derechos reservados.</p>';
echo '</div>';
echo '</div>';
echo '<div style="text-align: center; font-size: 0.75em;"><a href="administracion.php">ADMINISTRACION</a>.</div>';
?>
Cita:
Al hacer eso crea la pagina todo bien pero que pasa no ejecuta el juego osea el .swf no se muestra :S nose cual seria el error<?php
require("connect.php");
$name = $_POST['name'];
$cat = $_POST['cat'];
$link = $_POST['swf'];
$photo = $_POST['img'];
$ins = "INSERT INTO game (game, id_cat, photo) VALUES ('$name','$cat','$photo')";
$ins2 = "INSERT INTO link (link) VALUES ('$link')";
mysql_query($ins2);
mysql_query($ins);
$pag=$_POST['pag'];
$arc = fopen("pag_swf/$name.php","w");
fwrite ($arc,'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>DivertiGames</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php
require("connect.php");
$query = "SELECT * FROM game, link WHERE id_game = id_link";
$ress = mysql_query($query);
$dato = mysql_fetch_array($ress);
?>
<embed src="swf/<?php echo $dato["link"]; ?>" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="458" class="FlashGame" id="FlashGame2" > </embed>
</body>
</html>');
fclose($arc);
echo "Pagina cargada";
require("connect.php");
$name = $_POST['name'];
$cat = $_POST['cat'];
$link = $_POST['swf'];
$photo = $_POST['img'];
$ins = "INSERT INTO game (game, id_cat, photo) VALUES ('$name','$cat','$photo')";
$ins2 = "INSERT INTO link (link) VALUES ('$link')";
mysql_query($ins2);
mysql_query($ins);
$pag=$_POST['pag'];
$arc = fopen("pag_swf/$name.php","w");
fwrite ($arc,'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>DivertiGames</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<?php
require("connect.php");
$query = "SELECT * FROM game, link WHERE id_game = id_link";
$ress = mysql_query($query);
$dato = mysql_fetch_array($ress);
?>
<embed src="swf/<?php echo $dato["link"]; ?>" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="458" class="FlashGame" id="FlashGame2" > </embed>
</body>
</html>');
fclose($arc);
echo "Pagina cargada";
Lo hice de muchas maneras y termine con esta ultima