Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Passaggio file da tpl a php

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Italian
View previous topic :: View next topic  
Author Message
cretara
Smarty n00b


Joined: 31 May 2011
Posts: 2

PostPosted: Tue May 31, 2011 11:50 pm    Post subject: Passaggio file da tpl a php Reply with quote

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
View user's profile Send private message
cretara
Smarty n00b


Joined: 31 May 2011
Posts: 2

PostPosted: Wed Jun 01, 2011 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
DjDrake
Smarty n00b


Joined: 12 Feb 2010
Posts: 2

PostPosted: Tue Jul 12, 2011 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message
antoniog
Smarty Rookie


Joined: 01 Dec 2011
Posts: 12

PostPosted: Mon Dec 12, 2011 9:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: Italian All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP