Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2013, 10:49
DavidGR15
 
Fecha de Ingreso: noviembre-2013
Ubicación: Limon
Mensajes: 24
Antigüedad: 10 años, 5 meses
Puntos: 0
Subir archivos con php via url y crear paginas para postear los archivos

Quiero hacer una pagina para subir archivos y que cree una pagina html con el con el nombre del archivo que se subió, este es mi codigo que procesa el archivo pero me dice este error que ya no se que hacer.

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/uxxxxxxx/public_html/upload.php on line 24

Código PHP:
<?php
error_reporting
(0);
$get_url $_POST["url"];
$url trim($get_url);
if(
$url)
{
    
$file fopen($url,"rb");
    
$directory "upload/";
    
$valid_exts = array
(
"php","mp3","mp4","iso","3gp","rar","zip","
jpeg"
,"gif","png","doc","docx","jpg","html","
asp"
,"xml","JPEG","bmp");
    
$ext end(explode(".",strtolower
(basename($url))));
    if(
in_array($ext,$valid_exts))
    {
        
$rand rand(1000,9999);
        
$nombre $_POST["nombre"];
        
$filename "$nombre.$ext";
        
$newfile fopen($directory $filename,
"wb");
        if(
$newfile)
        {
            while(!
feof($file))
            {
                
fwrite($newfile,fread($file,1024 *
8),1024 8);
            }
            
$archivoYExtension ' .$nombre.
'".html"
;
$nuevoarchivo fopen($archivoYExtension ,
"w+");
$contenido="<!DOCTYPE html PUBLIC \"-//
W3C//DTD XHTML 1.0 Transitional//EN
\"\"http://www.w3.org/TR/xhtml1/DTD/
xhtml1-transitional.dtd\">
<html>
<head>
</head>
<body>
Nombre de su Archivo: [<b><font color="
#
0000FF">'.$filename.'</font></b>]
Descargar: [<b><font color="
#FF0040">'<a
href='./upload/.$filename.'>Click here</a>
to view
</div>
</
body>
</
html>
";
fwrite($nuevoarchivo, $contenido); fclose($
nuevoarchivo);
header("
Locationupload/.$nuevoarchivo.");
?>