Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/01/2004, 18:42
jmaribau
 
Fecha de Ingreso: enero-2004
Mensajes: 235
Antigüedad: 20 años, 4 meses
Puntos: 0
Que ese puede poner en el action? Se le puede poner alguna instrucción en javascript.
Ni poniendo opener en el action funciona.

Seria valido ponerle:
<form action="javascript: opener.location='upload2.php?o=';" .....


Espera que te podré el código entero y con algunas modificaciones que he hecho:

Código PHP:
<html>
<head>
<title> New Document </title>
</head>
<body>

<?php

if (isset($_GET['p'])) {
    
?>
    <form action='upload2.php?o=' method="post" enctype="multipart/form-data" onsubmit="opener.location='upload2.php?o=';  return false;">
    <input type='file' name='file' id='file' onChange="document.imagen.src='file:///' + this.value">
    Escribir algo <input type='text' name='text' id='text'>
    <br>
    <input type='submit' name='submit' value='Ok'>
    <br>
    <img name='imagen' />
    </form>
    <?php
    
exit;
}

if (isset(
$_GET['o'])) {
    
//var_dump($_REQUEST);
    
echo ' Ejecucion';
    exit;
}

if (isset(
$_FILES['file'])) {
    
$fileupload=$_FILES['file']['tmp_name'];
    
$destination=$_FILES['file']['name'];
    if (
is_uploaded_file($_FILES['file']['tmp_name'])) {
        if (
move_uploaded_file($fileupload,$destination)) print("<br><br>Guardat correctament a: $destination");
        else print(
'No guardat, error');
    }
}

if (isset(
$_POST['text'])) {
    echo 
'Este es el texto:'.$_POST['text'];
    exit;
}

?>

<a href='upload2.php?p=' target='new' Onclick="window.open('upload2.php?p=','new','toolbar=no,width=300,height=300,status=no,scrollbars=no,resize=no,menubars=no'); return false;">click</a>
</body>
</html>