Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/03/2009, 07:20
Dago
 
Fecha de Ingreso: mayo-2003
Mensajes: 312
Antigüedad: 21 años
Puntos: 2
Ayuda con FWRITE

Gente,
No puedo lograr escribir correctamente en un archivo PHP un codigo PHP.

Ej:

$datosar = "archivo.php";
$ar=fopen("$datosar","w+");
fputs($ar,"<?include(conex.php);");
fputs($ar,"$sql = 'select * from usuarios where tema = juan';");
fputs($ar,"$result = mysql_query($sql);");
fputs($ar,"if($row = mysql_fetch_array($result))");
fputs($ar,"{");
fputs($ar,"$sql = 'update temario SET leccion = 1 where tema = juan';");
fputs($ar,"mysql_query($sql);");
fputs($ar,"};");

fclose($datosar);



Si alguien me ayuda, estaria MAS que agradecido.

El resultado final del archivo PHP, no me queda como quiero. Por ende, no se ejecuta.