|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cretara Smarty n00b
Joined: 31 May 2011 Posts: 2
|
Posted: Tue May 31, 2011 11:50 pm Post subject: Passaggio file da tpl a php |
|
|
Salve,
nel mio *.tpl ho inserito una form, che include un tag input di tipo file.
Si tratta di un'immagine da memorizzare nel db per mezzo di un *.php esterno. Con la normale procedura ( $_FILES ) non riesco a recuperare l'immagine nel file php.
Le stesse righe di codice funzionano da un *.html a *.php
Qualcuno può aiutarmi o postarmi un esempio?
Grazie
[/b] |
|
Back to top |
|
cretara Smarty n00b
Joined: 31 May 2011 Posts: 2
|
Posted: Wed Jun 01, 2011 4:33 pm Post subject: |
|
|
Nel file *.tpl ho:
<form name="modulo" method="post" action="file.php?" >
<tr>
<td align="center">Inserisci un logo
<input class="login_input" align="right" type="file" value="Sfoglia" name="logo_b">
</td>
</tr>
In file.php ho:
$x = $_FILES["logo"]["tmp_name"];
$y = $_FILES["logo"]["name"];
$z = $_FILES["logo"]["type"];
Ho verificato che $_FILES risulta sempre vuoto.
Come mai? Grazie |
|
Back to top |
|
DjDrake Smarty n00b
Joined: 12 Feb 2010 Posts: 2
|
Posted: Tue Jul 12, 2011 11:15 am Post subject: |
|
|
Non so se sia un errore di copiatura, ma se l'input ha come name "logo_b" in $FILE dovresti trovare "logo_b" e non "logo". |
|
Back to top |
|
antoniog Smarty Rookie
Joined: 01 Dec 2011 Posts: 12
|
Posted: Mon Dec 12, 2011 9:32 pm Post subject: |
|
|
DjDrake wrote: | Non so se sia un errore di copiatura, ma se l'input ha come name "logo_b" in $FILE dovresti trovare "logo_b" e non "logo". |
Penso anche io che l'errore sia nel valore associato cioè "logo" invece di "logo_b". |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|