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
| <html>
<head>
<title> formulaire de traitement des photos </title>
</head>
<body bgcolor=#000000>
<?
//recuperation des variables formulaires et affectation dans des variables php
$titre=$_GET['titre'];
$sujet=$_GET['sujet'];
$legende=$_GET['legende'];
$format=$_GET['format'];
$heure=$_GET['heure'];
$date=$_GET['date'];
$IDP=$_GET['IDP'];
$IDS=$_GET['IDS'];
//connexion à la base mysql club et message si probleme
$connexion=mysql_connect ('localhost','root','') or die ("impossible de se connecter à la base de données" );
mysql_select_db ('phototheque');
//on vérifie la saisie des informations
if($titre=='')
{
echo "
<body bgcolor=#000000>
<table width=\"50%\" height=\"95%\" align=\"center\" border=\"0\">
<tr>
<td height=\"20%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"10%\" valign=\"center\" align=\"center\" bgcolor=#7E7E7E>
<b>Votre enregistrement doit comporter un titre</b>
</td>
</tr>
<tr>
<td height=\"15%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"45%\" bgcolor=#000000> </td>
</tr>
</table>
</body>
";
exit();
}
elseif($date=='AAAA-MM-JJ')
{
echo "
<body bgcolor=#000000>
<table width=\"50%\" height=\"95%\" align=\"center\" border=\"0\">
<tr>
<td height=\"20%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"10%\" valign=\"center\" align=\"center\" bgcolor=#7E7E7E>
<b>La date doit être enregistrée sous la forme : AAAA-MM-JJ</b>
</td>
</tr>
<tr>
<td height=\"15%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"45%\" bgcolor=#000000> </td>
</tr>
</table>
</body>
";
exit();
}
elseif($IDP=='')
{
echo "
<body bgcolor=#bd3429>
<table width=\"50%\" height=\"95%\" align=\"center\" border=\"0\">
<tr>
<td height=\"20%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"10%\" valign=\"center\" align=\"center\" bgcolor=#7E7E7E>
<b>Votre enregistrement doit comporter le numéro de saisie du photographe
<br><br>
Revenez à la page précédente et cliquez sur le lien intitulé \"IDP\"</b>
</td>
</tr>
<tr>
<td height=\"15%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"45%\" bgcolor=#000000> </td>
</tr>
</table>
</body>
";
exit();
}
elseif($IDS=='')
{
echo "
<body bgcolor=#bd3429>
<table width=\"50%\" height=\"95%\" align=\"center\" border=\"0\">
<tr>
<td height=\"20%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"10%\" valign=\"center\" align=\"center\" bgcolor=#7E7E7E>
<b>Votre enregistrement doit comporter le numéro de saisie du support
<br><br>
Revenez à la page précédente et cliquez sur le lien intitulé \"IDS\"</b>
</td>
</tr>
<tr>
<td height=\"15%\" bgcolor=#000000> </td>
</tr>
<tr>
<td height=\"45%\" bgcolor=#000000> </td>
</tr>
</table>
</body>
";
exit();
}
//envoi de la requête SQL a la base de donnees
$query=mysql_query ("insert into photo (titre,sujet,legende,format,heure,date,IDP,IDS) VALUES
('" . $titre . "','" . $sujet . "','" . $legende . "','" . $format . "','" . $heure . "','" . $date . "','" . $IDP . "','" . $IDS . "')" )
or die ("l'insertion n'a pas été réalisée" );
//fermeture de la connection
mysql_close($connexion);
?>
<br>
<br>
<br>
<!--message confirmation-->
<body>
<table width="50%" height="95%" align="center" border="0">
<tr>
<td height="20%" bgcolor=#000000>  </td>
</tr>
<tr>
<td height="10%" valign="center" align="center" bgcolor=#7E7E7E>
<b>merci d'avoir rempli notre formulaire A bientot !</b>
</td>
</tr>
<tr>
<td height="10%" bgcolor=#000000>  </td>
</tr>
<tr>
<td height="25%" valign="center" align="center" bgcolor=#7E7E7E>
<center><a href="tableau_saisie_photo.php"><b>résultat de la recherche</b></a></center>
</td>
</tr>
<tr>
<td height="35%" bgcolor=#000000>  </td>
</tr>
</table>
</body>
</html> |
Partager