Formulario email con archivos                                     
                                        Autore: Alejandro A.
                Visite 2301,
                Followers 2,
                Condiviso 0
                 
                    
Hola: ¿Porque el formulario email con archivos adjuntos no es compatible con todos los servidores de hosting? No funcciona adjuntar archivos desde el formulario. He probado todas las opciones de post, get, low, etc..
Postato il 

Autore
Desde el hosting me han dado este codigo para que funccione. Como se puede implementar en website x5? Gracias,
<?php
$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET"){
$query_vars = $_GET;
} elseif ($request_method == "POST"){
$query_vars = $_POST;
}
reset($query_vars);
$t = date("U");
$file = $_SERVER['DOCUMENT_ROOT'] . "/../data/gdform_" . $t;
$fp = fopen($file,"w");
while (list ($key, $val) = each ($query_vars)) {
fputs($fp,"<GDFORM_VARIABLE NAME=$key START>\n");
fputs($fp,"$val\n");
fputs($fp,"<GDFORM_VARIABLE NAME=$key END>\n");
if ($key == "redirect") { $landing_page = $val;}
}
fclose($fp);
if ($landing_page != ""){
header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
} else {
header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}
?>
Hello,
the attachment feature should correctly work if your server supports PHP5, what error did you get?
***** Google Translation:
Hola,
la función de adjunto correctamente debería funcionar si su servidor soporta PHP5, qué error te metiste?