Placement d'une image dans un chat.

Fermé
Max747 - 19 févr. 2019 à 15:10
Max747 Messages postés 258 Date d'inscription vendredi 11 juillet 2014 Statut Membre Dernière intervention 11 janvier 2024 - 20 févr. 2019 à 16:20
Bonjour,
Serait il possible d'afficher une image au format JPG dans ce chat fonctionnant uniquement en mode texte ?
//******************************************************************************
//  submit chat message
//******************************************************************************
if (isset($_POST['txtChatbox']) && ('' != $_POST['txtChatbox']))
{
	$_POST = sani($_POST);
	$private = (isset($_POST['private']) && 'on' == $_POST['private']) ? 'Yes' : 'No';
	// select the last post entered and make sure it is not a IE error duplicate message
	// (same message within 1 second)
	$query = "
		SELECT COUNT(*)
		FROM ".T_CHAT."
		WHERE c_message = '{$_POST['txtChatbox']}'
		AND c_time BETWEEN
		DATE_SUB(NOW( ), INTERVAL 1 SECOND)
		AND DATE_ADD(NOW( ), INTERVAL 1 SECOND)
	";
	$count = $mysql->fetch_value($query, __LINE__, __FILE__);	
	date_default_timezone_set('Europe/Paris');
        $test = new DateTime();
        $d= date_format($test, 'Y-m-d H:i:s');
	if (0 == $count)
	{  
	$query = " 
        INSERT INTO ".T_CHAT."
	(c_game_id, c_player_id, c_time, c_message, c_private)
	VALUES ('{$_SESSION['game_id']}', '{$_SESSION['player_id']}', '{$d}','{$_POST['txtChatbox']}',
        '{$private}')
        ";
	$mysql->query($query, __LINE__, __FILE__);
	}
	// refresh the page to avoid double posts
	if (!DEBUG) header('Location: chess.php');
}

form action="chess.php" method="post" name="chatdata" style="display:inline;">
<textarea style="width:339px;max-width:373px;max-height:90px;" name="txtChatbox" tabindex="2" cols="39" rows="4" onfocus="clearTimeout(intervalId);" onblur="if(''==this.value){intervalId = setTimeout('redo( )', autoreload * 1000);}"
tabindex="2" placeholder="Ecrivez vos commentaires ici..."></textarea> 							
<br>
<input type="submit" id="btnSubmit" name="chat" tabindex="3" value="Envoi" />
</form>


Si oui, comment faire?
Merci d'avance.

Configuration: Windows / Opera Next 36.0.2130.80
A voir également:

1 réponse

Max747 Messages postés 258 Date d'inscription vendredi 11 juillet 2014 Statut Membre Dernière intervention 11 janvier 2024
20 févr. 2019 à 16:20
Bonjour,

Quelqu' un peut il m' aider?
0