Uploade un fichier avec un formulaire ?? Grr

phil75 Messages postés 9 Statut Membre -  
phil75 Messages postés 9 Statut Membre -
bonjour j'ai fait un formulaire pour fair un petit sondage et jai placer un case 'parcourire' pour que les gens puissent menvoyer des fichier
MAIS CA NE MARCHE PAS <les fichiers ne partent pas!!>
SI UNE BONNE AME POURRAIT REGARDER LA PAGE ET ME RENSEIGNER SUR MON ERREUR
I WOULD BE VERY VERY HAPPY
ICI
http://www.billderaime.com/sondage.htm

merci bien
phil
A voir également:

8 réponses

nabzone
 
aller sur ton site est inutile !!!!!

donnes nous les sources de ton script .....à la place
(au fait quelles sont les indications de ton herbergeur pour l'upload.....s'ils y en a )
0
phil75 Messages postés 9 Statut Membre
 
bon je poste ici le code du formulaire
cest surtout que le fichier selecyione avec le champs parcourire " file " ne part pas avec le formulaire ?
jesper que tu pourra maider merci
phil

<!-- start form -->
<form action="mailto:reponsesmessages@billderaime.com" method=post enctype="text/plain" target="droite">
<table width="507" border="0" cellspacing="0" cellpadding="0" class="text">
<tr>
<td colspan="5">&nbsp;1&nbsp;2&nbsp;3&nbsp;4&nbsp;5</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">
<div align="center">VOTRE NOM</div>
</td>
<td width="118">
<div align="center">VOTRE PRENOM</div>
</td>
<td width="203">
<div align="center">VOTRE PSEUDO</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">
<div align="center">
<input type="text" name="VOTRE NOM" size="20" maxlength="50">
</div>
</td>
<td width="118">
<div align="center">
<input type="text" name="VOTRE PRENOM" size="20" maxlength="50">
</div>
</td>
<td width="203">
<div align="center">
<input type="text" name="PSEUDO" size="20" maxlength="50">
</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">
<div align="center">VOTRE AGE</div>
</td>
<td width="118">
<div align="center">VOTRE SEX</div>
</td>
<td width="203">
<div align="center">VOTRE SIGNE ASTROLOGIQUE</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">
<div align="center">
<input type="text" name="VOTRE AGE" size="20">
</div>
</td>
<td valign="middle" width="118">
<input type="text" name="VOTRE SEX" size="20">
</td>
<td valign="middle" width="203">
<div align="center">
<input type="text" name="signe astro" size="20">
</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td rowspan="2" width="1">&nbsp;</td>
<td rowspan="3" width="151" >
<div align="right"><img src="last_pics/bill@.jpg" width="125" height="45"></div>
</td>
<td rowspan="2" width="118">
<div align="center">ARTIST </div>
</td>
<td width="203">
<input type="checkbox" name="artist" value="oui">
OUI </td>
</tr>
<tr>
<td width="203">
<input type="checkbox" name="artiste" value="non">
NON </td>
</tr>
<tr>
<td height="29" width="1">&nbsp;</td>
<td height="29" width="118">
<div align="center">SPECIFIER</div>
</td>
<td height="29" width="203">
<div align="center">
<input type="text" name="specifier" size="20" value="specifier">
</div>
</td>
<td height="29" width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1" rowspan="2">&nbsp;</td>
<td rowspan="3" width="151"><img src="last_pics/buttonsrec.jpg" width="140" height="67"></td>
<td rowspan="2" width="118">
<div align="center">TECHNICIEN</div>
</td>
<td width="203">
<input type="checkbox" name="technicien" value="oui">
OUI </td>
<td width="24" rowspan="2">&nbsp;</td>
</tr>
<tr>
<td width="203">
<input type="checkbox" name="technicien" value="non">
NON </td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="118">
<div align="center">SPECIFIER</div>
</td>
<td width="203">
<div align="center">
<input type="text" name="specifier" size="20" value="specifier">
</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td rowspan="2" width="118">
<div align="center">Ni l'UN NI L'AUTRE</div>
</td>
<td rowspan="2" width="203">
<div align="center">
<textarea name="ni lun ni lautre" cols="25">SPECIFIER</textarea>
</div>
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td colspan="2">
<div align="center">Si vous auriez le choix que choisiseriez vous
d'autre,<br>
comme services dans ce site?</div>
</td>
<td width="203">
<div align="center">Plus d'infos sur<br>
Bill Deraime</div>
</td>
<td width="24">
<input type="checkbox" name="Plus dinfo sur billderaime" value="yes">
</td>
</tr>
<tr>
<td height="23" width="1">&nbsp;</td>
<td height="23" width="151">&nbsp;</td>
<td height="23" width="118">&nbsp;</td>
<td height="23" width="203">
<div align="center">Plus d'infos sur<br>
Mystic Zebra</div>
</td>
<td height="23" width="24">
<input type="checkbox" name="Plus dinfo sur mystic zebra" value="checkbox">
</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">
<div align="center">Plus d'info sur <br>
les concerts</div>
</td>
<td width="24">
<input type="checkbox" name="plus dinfo sur les concert" value="checkbox">
</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">
<div align="center">Echange de fichiers</div>
</td>
<td width="24">
<input type="checkbox" name="echange de fichiers" value="checkbox">
</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">
<div align="center">Biblioteques de <br>
textes de chansons</div>
</td>
<td width="24">
<input type="checkbox" name="biblioteque de txt et de chansons" value="checkbox">
</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td colspan="2">
<div align="center">ECRIVEZ VOS COMMENTAIRES ET SUGESTIONS MERCI</div>
</td>
<td width="203">
<div align="center">Discuter avec d'autres fan (forum)</div>
</td>
<td width="24">
<input type="checkbox" name="discuter avec dautre fans" value="checkbox">
</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td colspan="2" rowspan="7">
<div align="center">
<textarea name="VOS COMMENTAIRES" cols="25"></textarea>
</div>
</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">
<input type="file" name="file">
</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">
<div align="left">
<input type=submit value="GO" name="submit" onClick="MM_validateForm('email','','RisEmail');return document.MM_returnValue">
<input type="hidden" name="u" value="phil75">
<input type="hidden" name="subject" value="Sondage site bill deraime">
<input type="hidden" name="redir" value=" http://www.billderaime.com" target="parent">
<input type="hidden" name="to" value="webmaster@billderaime.com"></div>

<p align="left"><input type="reset" name="Submit2" value="Reset"></p>
</td>
<td width="118">

</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
<tr>
<td width="1">&nbsp;</td>
<td width="151">&nbsp;</td>
<td width="118">&nbsp;</td>
<td width="203">&nbsp;</td>
<td width="24">&nbsp;</td>
</tr>
</table>

</form>
<!-- end form -->
0
phil75 Messages postés 9 Statut Membre
 
voici ce que je recois ..
VOTRE NOM=toto
VOTRE PRENOM=toto
PSEUDO=phil75
VOTRE AGE=100
VOTRE SEX=m
signe astro=tauraux
artist=oui
artiste specifier=peintre
technicien=oui
technicien specifier=inge son
ni lun ni lautre=SPECIFIER
Plus dinfo sur billderaime=yes
Plus dinfo sur mystic zebra=checkbox
plus dinfo sur les concert=checkbox
echange de fichiers=checkbox
biblioteque de txt et de chansons=checkbox
discuter avec dautre fans=checkbox
VOS COMMENTAIRES=faire marcher ce putain de formulaire
file=E:\Photos_tot\smileys\bounce.gif
submit=GO
u=phil75
subject=Sondage site bill deraime
redir= http://www.billderaime.com
to=webmaster@billderaime.com

< la cas 'file m'indique bien le cvhemin du fichier mais je ne kle recois pas >
0
nabzone
 
okay okay .....
la methode que tu utilises (mailto://)ne permet pas l'upload de fichier
bon rapidement, ce qu'il te faut c'est pouvoir utiliser un script qui s'éxécute coté serveur (c'est lui qui va effectuer le boulot pour toi)

utiliser un script ? ??? (eh oui j'anticipe)
tu peux utiliser plusieurs technologie .
la plus simple est la plus répandue est à base de php (à petites doses)

au fait que te proposes ton hebergeur?
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
phil75 Messages postés 9 Statut Membre
 
merci bien
je me doutai que cetait un truc dans ce genre ..
je suis chez online.fr

je vais regarder les faq sur le site et voire ce qui est disponible
je te remercie infiniement pour ton aide
a bientot
Phil
0
nabzone
 
tu peux en principe le faire .... ton hebergeur te proposes du php3

@+
0
phil75 Messages postés 9 Statut Membre
 
bonjour
et encore merci pour ton aide.
en effet l'hebergeur me propose un script php 3 pou envoyer un formulaire par mail
jai donc cree ce fichier
****************
<html>
<head><title>Une forme</title></head>
<body bgcolor="#FFFFFF">
<form action="form2mail.php3">
Votre Nom : <input type="text" name="nom">
<input type="submit" name="ok" value="ok" >
</body>
</html>
**************
avec le script php3 a la racine du répertoire
que voici
<?php

// IMPORTANT VOUS DEVEZ CONFIGURER
// L'ADRESSE EMAIL DE DESTINATION
$dest="webmaster@billderaime.com";

// on recupere les infos
$referer= getenv("HTTP_REFERER");

// validation de forme
//
// ici inserer si besoin
// les tests de validites
// (syntaxe, champ obligatoire)
// des champs de la forme
// ...
// mettre $ok a faux si c'est un echec


$ok=1;

if($ok){
// envoi du resultat par email
$sujet= "Form2Mail de ".$referer;
$body.="Page d'origine : $referer\n";
$body.="\n*** Valeurs resultats ***\n";

if(count($HTTP_POST_VARS)){
while (list($key, $val) = each($HTTP_POST_VARS)){
$body.="$key : $val\n";
}
}

if(count($HTTP_GET_VARS)){
while (list($key, $val) = each($HTTP_GET_VARS)){
$body.="$key : $val\n";
}
}

$body.="*************************\n";
if(!email("webmaster",$dest,$sujet,$body)){
print "erreur envoi email <br>";
}

// affiche le html qui suit si succes
?>
<html>
<head><title>Bravo</title></head>
<body bgcolor="white">
<h1> Bravo </h1>
</body>
</html>
<?php
}
// affiche le html qui suit si erreur
//
else{
?>
<html>
<head><title>Erreur de formulaire</title></head>
<body bgcolor="white">
<h1> Erreur de formulaire </h1>
</body>
</html>
<?php
}
?>

************
la page html me propose un boite input pour rentrr mon nom
un fois que je le fait et le valide < go>
il mouvre simplement le script php
:-D
He He
jai loupe qq chose

Eviodament je n'ai pas tout compris la logique de la chose et je ne veut pas te prendre tout ton temps .
De plus ca ne resout pas mon problem de uplouder un fichier avec ce formulaire
je m'apercois que la question est bien plus complex que je ne le pensais...

je me suis payé 'Pratique de MYSQL et PHP ' de OREILLY

je commence a faire des tables et des requetes mais cest long a comprendre..
merci phil
0
nabzone
 
je ne connais pas ce livre mais OREILLY fait de bon bouquin.

voici 2 tutorials qui à mon avis vont te servir.


pour l'upload va voir à cette adresse :
http://www.toutestfacile.com/phpinit.php?tef_site=php&chap=fu1


pour envoyer un mail avec piéce jointes :
http://www.toutestfacile.com/phpinit.php?tef_site=php&chap=mail1


PS:si à l'éxécution de ton script les sources s'affichent au lieu de véritablement s'éxécuter .... vérifie simplement l'extention de ton script (en suivant les recommendation de ton hebergeur c-a-d .php3 ou .php ou .ptml ou ......)

courage phil y a un début à tout ... (bon apprentissage :) )
@+
0
phil75 Messages postés 9 Statut Membre
 
merci mille fois
cest super sympa
enfin un vrai forum avec des gens qui sont a la hauteur

jai passe la journe dans php my admin ouf
.....
ca vient ca vient
@+phil
0