Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/03/2005, 01:46
impala
 
Fecha de Ingreso: septiembre-2004
Mensajes: 203
Antigüedad: 19 años, 6 meses
Puntos: 0
Con este código me anda perfecto. Lo que quisiera hacer ahora es que el path y el nombre del fichero se almacenen desde un formulario en una variable y asi poder reemplazar $current_dir por el valor de la variable.

<?php
require( '../mysql_header.php' );
$current_dir = "D:\Archivos de programa\EasyPHP1-7\www\hostal\backup\hostal.sql";
$fp = fopen($current_dir, 'r');
$leido = fread($fp, 9999);
$i = -1;
$link = mysql_connect($host, $user);

while ($file_array = explode (';', $leido)){
$i++;
if (!empty($file_array[$i])){
//echo $i."<br>";
echo $file_array[$i]."<br><br>";
$query = $file_array[$i];
mysql_query("$file_array[$i]");
echo mysql_query("'".$file_array[$i]."'")."<br><br>";
} else {
exit;
}
}
?>
__________________
Impala