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
| <?php
mysql_connect("localhost", "****", "****"); // Connexion à MySQL
mysql_select_db("lettre"); // Sélection de la base
$string = $_POST['texte'];
if (!empty($string)){
for ($i=0;$i<explode($string);$i++){
if($string[$i] == ' '){
echo '<img src="bleu/space.gif">';}
else{
$lettre = mysql_query("SELECT * FROM lettre WHERE lettre = '$string[$i]'");
while ($dodo = mysql_fetch_array($lettre))
{
$image = $dodo['image'];
}
echo '<img src="' . $image . '">';}
};
}
else
{
echo '<FORM method=post action="">
<input name="texte" type="text">
<INPUT type="submit" value="Envoyer"></form>';
}?> |
Partager