1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
| <?php
session_start();
if(!isset($_SESSION["login"])|| $_SESSION["login"]==""){ //si le login faux ou vide
header('location:acces.php'); //redirection vers acces.htm
}else{ //sinon on affiche la page
?>
<?php
//extension autorisés
$extensions = array('.JPG', '.jpg', '.jpeg');
// l'image décortiquer nom et extension
$file_extension_create = strrchr($_FILES['file']['name'], '.');
//nom du sous-dossier
$dossier =$_POST['dossier'];
//nom de l'image
$file_name_create =$_POST[ 'name' ];
//newname voudra dire nom+ext qui arriverons du formulaire biensur ex:monchien/.gif
$file_newname_create =($file_name_create.$file_extension_create);
//chemin voudra dire le chemin de deplacement de l'image (votre repertoire img que vous aurez creer bien sur
$file_chemin_create =("../page/collection/".$dossier."/".$file_newname_create);
$message = "";
if ( !isSet($_POST ['name']) )
{
while (list($key) = each($HTTP_POST_VARS))
{
$message .= "$key\n";
}
echo "Vous n'avez pas saisi $message.";
}
if (!in_array($file_extension_create, $extensions) )
{
while (list($key) = each($HTTP_POST_VARS))
{
$message .= "$key\n";
}
echo "Vous n'avez pas saisi $message.";
}
else {
move_uploaded_file($HTTP_POST_FILES["file"]["tmp_name"],$file_chemin_create);
header('location:file_collection.php');
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>insertion fichier cra</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="fr">
<link rel="stylesheet" href="../css/style.css" type="text/css">
</head>
<body bgcolor="#ffffff" text="#000000">
<?php
include('../inc/head_webmaster.php');
?>
<table width="990" align="center">
<tr>
<td width="980" height=61 valign="middle" align="center" class="webmaster_titre" >INSERER
UNE IMAGE</td>
</tr>
</table>
<table width="990" height="40" align="center">
<tr>
<td width="321" height=30 valign="middle" align="center" class="ssmenu_web">
<div align="center"><a href="menu_webmaster.php">Retour au menu</a> </div>
</td>
<td width="319"></td>
<td width="328" valign="middle" >
<div align="center"><a href="file_collection.php">Retour à
la liste</a></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="971" height="310" valign="top">
<form action=action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post" enctype="multipart/form-data">
<table width="610" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="610" valign="top" height="223">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="109" height="33"></td>
<td width="130" valign="middle" bgcolor="#CCCCCC"><font size="2">Collection
:</font> </td>
<td width="25"></td>
<td width="213" valign="top">
<select name="dossier" size="1">
<option>mariee</option>
<option>cocktail</option>
<option>enfant</option>
<option>soiree</option>
<option>cortege</option>
</select>
</td>
<td width="133"></td>
</tr>
<tr>
<td height="22"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="33"></td>
<td valign="middle" class="cartitle" bgcolor="#CCCCCC"><font size="2">Nom
:</font> </td>
<td></td>
<td valign="middle">
<input name="name" type="text">
</td>
<td></td>
</tr>
<tr>
<td height="27"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="33"></td>
<td valign="middle" class="cartitle" bgcolor="#CCCCCC"><font size="2">Image:</font></td>
<td></td>
<td valign="middle">
<div align="right">
<input name="file" type="file">
</div>
</td>
<td></td>
</tr>
<tr>
<td height="33"></td>
<td colspan="3" valign="top">
<p align="center"><font size="2"><i>Pensez à réduire
la taille des images avant de les insérer<br>
(à l'affichage hauteur = 410 pixels et largeur =
650 pixels</i></font></p>
</td>
<td></td>
</tr>
<tr>
<td height="33"></td>
<td valign="middle" class="annonce" bgcolor="#CCCCCC"><font size="2">Date
de saisie :</font></td>
<td></td>
<td valign="middle"><font size="2">
<?php
$date = date("d-m-Y");
Print("$date");
?>
</font></td>
<td></td>
</tr>
<tr>
<td height="9"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="14"></td>
</tr>
<tr>
<td valign="top" height="33">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="33" width="610" valign="top">
<div align="center">
<input type='submit' value='CREER' name="submit">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<?php
include('../inc/footer.php');
?>
</body>
</html>
<?php
}
?> |
Partager