Réponse acceptée !
Salut,
<?php require_once('../Connections/contact.php'); ?>
<?php
if (phpversion() > "4.0.6") {
$HTTP_POST_FILES = &$_FILES;
}
define("MAX_SIZE",300000);
define("DESTINATION_FOLDER", "./docs");
define("no_error", "success.php");
define("yes_error", "error.php");
$_accepted_extensions_ = "doc,pdf";
if(strlen($_accepted_extensions_) > 0){
$_accepted_extensions_ = @explode(",",$_accepted_extensions_);
} else {
$_accepted_extensions_ = array();
}
/* modify */
if(!empty($HTTP_POST_FILES['file'])){
if(is_uploaded_file($HTTP_POST_FILES['file']['tmp_name']) && $HTTP_POST_FILES['file']['error'] == 0){
$_file_ = $HTTP_POST_FILES['file'];
$errStr = "";
$_name_ = $_file_['name'];
$_type_ = $_file_['type'];
$_tmp_name_ = $_file_['tmp_name'];
$_size_ = $_file_['size'];
if($_size_ > MAX_SIZE && MAX_SIZE > 0){
$errStr = "File troppo pesante";
}
$_ext_ = explode(".", $_name_);
$_ext_ = strtolower($_ext_[count($_ext_)-1]);
if(!in_array($_ext_, $_accepted_extensions_) && count($_accepted_extensions_) > 0){
$errStr = "Estensione non valida";
}
if(!is_dir(DESTINATION_FOLDER) && is_writeable(DESTINATION_FOLDER)){
$errStr = "Cartella di destinazione non valida";
}
if(empty($errStr)){
if(@move_uploaded_file($_tmp_name_,DESTINATION_FOLDER . "/" . $_name_)){
header("Location: " . no_error);
//enregistrement dans la base de données de contact
mysql_select_db($database_contact, $contact);
$insertRecordset1 = "INSERT INTO Recordset1 (nom, email, societe, site, tel, piece, message)
VALUES ('$nom', '$_name_' , 'societe', 'site', 'tel', 'piece', 'message')";
mysql_query($query_Recordset1, $contact) or die(mysql_error());
} else {
header("Location: " . yes_error);
}
} else {
header("Location: " . yes_error);
}
}
?>
<html>
<head>
<title>information aux entreprises</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (information aux entreprises.psd) -->
<table width="781" height="729" border="0" align="center" cellpadding="0" cellspacing="0" id="Tableau_01">
<tr>
<td width="780" height="176" colspan="8"><object
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="780" height="177">
<param name="movie" value="../haut.swf">
<param name="quality" value="high">
<embed
src="../haut.swf" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="780"
height="177"></embed>
</object></td>
<td>
<img src="images/spacer.gif" width="1" height="176" alt=""></td>
</tr>
<tr>
<td colspan="8">
<img src="images/nous-contacter_02.gif" alt="" width="780" height="36" border="0" usemap="#Map"></td>
<td>
<img src="images/spacer.gif" width="1" height="36" alt=""></td>
</tr>
<tr>
<td colspan="4" background="images/nous-contacter_03.gif"> </td>
<td>
<img src="images/nous-contacter_04.gif" width="1" height="51" alt=""></td>
<td colspan="3" valign="top" background="images/nous-contacter_05.gif"><table width="112">
<tr>
<td width="32"><a href="../english/index.html"><img
src="../drapeaux/angl.GIF" width="30" height="15"
border="0"></a></td>
<td width="32"><a href="../index.html"><img
src="../drapeaux/fr.GIF" width="30" height="15"
border="0"></a></td>
<td width="26"><img src="../drapeaux/chine.gif" width="30"
height="15"></td>
</tr>
</table></td>
<td>
<img src="images/spacer.gif" width="1" height="51" alt=""></td>
</tr>
<tr>
<td colspan="7">
<img src="images/nous-contacter_06.gif" width="764" height="5" alt=""></td>
<td rowspan="2" background="images/nous-contacter_07.gif"> </td>
<td>
<img src="images/spacer.gif" width="1" height="5" alt=""></td>
</tr>
<tr>
<td colspan="2" rowspan="3" background="images/nous-contacter_08.jpg"> </td>
<td rowspan="4" background="images/nous-contacter_09.gif">
<img src="images/nous-contacter_09.gif" width="2" height="330" alt=""></td>
<td colspan="3" rowspan="2" valign="top"><form
action="" method="post" enctype="multipart/form-data" name="form1">
<FONT face=Verdana color=#000066><B>Vous
désirez prendre contact avec nous ? Merci d'utiliser le
formulaire suivant pour nous envoyer votre message. Nous pourrons ainsi
vous répondre dans les meilleurs délais.
</B></FONT><br>
<br>
<table width="405" align="center">
<tr>
<td><B><FONT color="#000066" class=small>Nom / prenom
</FONT></B></td>
<td><input name="textfield" type="text" value="<?php echo
$row_Recordset1['nom']; ?>"></td>
</tr>
<tr>
<td><B><FONT color="#000066" class=small>Email :
</font></B></td>
<td><input name="textfield" type="text" value="<?php echo
$row_Recordset1['email']; ?>"></td>
</tr>
<tr>
<td><font color="#000066"><B><FONT
class=small>Société :</FONT></B></font></td>
<td><input name="textfield" type="text" value="<?php echo
$row_Recordset1['societe']; ?>"></td>
</tr>
<tr>
<td><strong><font color="#000066">Site web :
</font></strong></td>
<td><input name="textfield" type="text" value="<?php echo
$row_Recordset1['site']; ?>"></td>
</tr>
<tr>
<td><font color="#000066"><B><FONT
class=small>Téléphone :</FONT></B></font></td>
<td><input name="textfield" type="text" value="<?php echo
$row_Recordset1['tel']; ?>"></td>
</tr>
<tr>
<td><font color="#000066"><B>Piece jointe
</B></font></td>
<td><input name="file" type="file" value="<?php echo
$row_Recordset1['piece']; ?>"></td>
</tr>
<tr>
<td valign="top"><font
color="#000066"><strong>Message
</strong></font></td>
<td><textarea name="textarea" cols="30" rows="7"><?php
echo $row_Recordset1['message']; ?></textarea></td>
</tr>
<tr>
<td valign="top"><font
color="#000066"> </font></td>
<td><input type="submit" name="Submit"
value="Envoyer"></td>
</tr>
</table>
<br>
</form></td>
<td rowspan="4">
<img src="images/nous-contacter_11.gif" width="1" height="330" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="37" alt=""></td>
</tr>
<tr>
<td width="16" height="293" rowspan="3"> </td>
<td height="330">
<img src="images/spacer.gif" width="1" height="288" alt=""></td>
</tr>
<tr>
<td colspan="3" rowspan="2">
<img src="images/nous-contacter_13.gif" width="647" height="5" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
</tr>
<tr>
<td colspan="2">
<img src="images/nous-contacter_14.gif" width="114" height="4" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="4" alt=""></td>
</tr>
<tr>
<td colspan="8" background="images/nous-contacter_15.jpg"> </td>
<td>
<img src="images/spacer.gif" width="1" height="32" alt=""></td>
</tr>
<tr>
<td>
<img src="images/nous-contacter_16.gif" width="1" height="12" alt=""></td>
<td width="779" height="55" colspan="7" rowspan="2"> </td>
<td>
<img src="images/spacer.gif" width="1" height="12" alt=""></td>
</tr>
<tr>
<td width="1" height="43">
<img src="images/spacer.gif" width="1" height="43" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="43" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="113" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="2" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="551" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="95" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="16" height="1" alt=""></td>
<td></td>
</tr>
</table>
<!-- End ImageReady Slices -->
<map name="Map">
<area shape="rect" coords="38,10,89,28" href="../index.html">
<area shape="rect" coords="103,12,188,28" href="../fle/presentation.html">
<area shape="rect" coords="203,12,306,25" href="../stages/presentation.html">
<area shape="rect" coords="318,11,503,26" href="../infos_aux_entreprises/information-aux-entreprise.html">
<area shape="rect" coords="519,11,587,26" href="../carrieres/carrieres.html">
<area shape="rect" coords="603,9,708,27" href="nous-contacter.php">
<area shape="rect" coords="722,10,763,25" href="../liens/liens.html">
</map>
</body>
</html>
<?php
}
@mysql_free_result($Recordset1);
?>
T'avais oublié de fermer }
@+
Immortal-PC,
téléchargements,astuces ,entre-aide informatique , conseils pour vos problèmes d'ordi.
Grâce à Immortal-PC votre ordinateur passera les âges.