PDA

View Full Version : [PHP] nome file da form


redcloud
15-03-2006, 12:12
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$formform=
<form name='formModifica' method='post' action=''>
<input type='file' size=60 name='filename' id='filename'>
</form>;

echo $formform;

?>
</body>
</html>

Vorrei ricavare la tringa (o solo il nome del file) del campo 'filename' tramite php. Come si fa? Grazie!

VICIUS
15-03-2006, 12:40
devi mettere in action un file .php. Quando clicchi sul bottone il nome viene inviato negli header http. Nel file .php non dovrai fare altro che usare:
echo $_REQUEST['filename'];

ciao ;)

redcloud
15-03-2006, 12:49
Se in action non metto niente, post non dovrebbe passare le variabili alla stessa pagina?

redcloud
15-03-2006, 12:56
E poi ho bisogno anche del percorso completo, non solo del nome file.