Viewing file: ftp_paso3_lardt.php (2.55 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es-es">
<?
error_reporting(E_ALL ^ E_NOTICE);
ini_set('auto_detect_line_endings',TRUE);
?><head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<BASE TARGET='ventana'>
<link rel="stylesheet" type="text/css" href="../nuevo.css">
<link rel="STYLESHEET" type="text/css" href="../estilo.css">
</head>
<body>
<?php
include("../zebraforms/class.htmlform.php");
//error_reporting(E_ERROR | E_WARNING | E_PARSE );
error_reporting(E_ALL ^ E_NOTICE);
include("../conn.php") ;
$debug=false;
if (!$_REQUEST['nombre']){
die();
}
echo "<pre>";
// print_r($_REQUEST);
// print_r($_SERVER);
// copiamos el fichero al rirectorio, con su nombre.
copy($_REQUEST['file'],$_SERVER['DOCUMENT_ROOT']."/bbpp/".$_REQUEST['nombre']);
$sql="insert into papyr225_papyre.bbpp (id_book,ruta_bbpp) values ({$_REQUEST['id']},'{$_REQUEST['nombre']}')
ON DUPLICATE KEY UPDATE
ruta_bbpp='{$_REQUEST['nombre']}'";
mysql_query($sql,$conn);
if (mysql_error()){
echo $sql."<br>";
echo mysql_error();
}
$form = new HTMLForm('form', 'post','');
echo "<center><h1> Libro subido</h1>";
$obj=$form->add('button', 'control_atras', 'Volver atr�s');
$obj->setAttributes(array('onclick' =>'history.back(-2)'));
$form->render();
@ deltree("../tmp/");
@ mkdir("../tmp/",0777,true);
@ chmod("../tmp/",0777);
function delTree($dir) {
$files = glob( $dir . '*', GLOB_MARK );
foreach( $files as $file ){
if( substr( $file, -1 ) == '/' )
delTree( $file );
else
unlink( $file );
}
if (is_dir($dir)) rmdir( $dir );
}
function chmodr($path, $filemode) {
if (!is_dir($path))
return chmod($path, $filemode);
$dh = opendir($path);
while (($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
$fullpath = $path.'/'.$file;
if(is_link($fullpath))
return FALSE;
elseif(!is_dir($fullpath) && !chmod($fullpath, $filemode))
return FALSE;
elseif(!chmodr($fullpath, $filemode))
return FALSE;
}
}
closedir($dh);
if(chmod($path, $filemode))
return TRUE;
else
return FALSE;
}
?>
|