Bienvenue sur mon site !
Je vous souhaite la bienvenue sur mon site ! Choisissez un lien dans les menus pour accéder aux différentes sections de ce site.
<html>
<head>
<title>form</title>
<base target="_self">
</head>
<div align="center">
<form name="f" method="post" action="chat.php" target="principal" onSubmit="document.f.com.focus();">
<table width="405">
<tr>
<td valign="top" align="center">
<p align="left">Pseudo
<input name="pseudo" value="Votre pseudo" size="12" onFocus="this.select()" style="float: left">
</td>
</tr>
<tr>
<td valign="top" align="center">
<input name="com" rows="3" cols="30" wrap="virtual" size="38" onFocus=this.value='' style="float: left"><input type="submit" name="submit" value="Tchat!!" >
</td>
</tr>
<tr>
<td valign="top" align="center"></td></tr></table>
</form>
</div>
</font></p>
</body>
</html>
<script>
document.f.pseudo.focus();
</script>
<?php
function tchat(){
$connect=mysql_connect("localhost","login","pass");
mysql_select_db("basededonnee",$connect);
$query=mysql_query("SELECT DISTINCT pseudo FROM chat");
$nombre_connecte=mysql_num_rows($query);
echo"",$nombre_connecte," connecté(s) sur le chat<br><br>";
$affich_dialogue="SELECT * FROM chat ORDER BY id DESC";
$chat=mysql_query($affich_dialogue,$connect);
while($tab=mysql_fetch_array($chat,MYSQL_ASSOC)){
$pseudo = stripslashes($tab['pseudo']);
$com = stripslashes($tab['com']);
echo"<table width='435'><tr><td>";
echo"<font color='navy' size='2'><b>$pseudo</b><font>:";
echo"<font color='black' size='2'>({$tab[date]} à
{$tab[heure]})</font><br>";
echo"<font color='maroon' size='2'>$com<br></font>";
echo"</td></tr></table>";
}
}
?>
<html>
<head>
<meta http-equiv="Refresh" content="5; url=chat.php">
<base target="_self">
</head>
<body>
<?php
$connect=mysql_connect("localhost","login","pass");
mysql_select_db("test",$connect);
$temps = 300;
$heure_debut_chat = time();
$date = date("d-m-y");
$heure = date("H\hi");
$heure_fin_chat = $heure_debut_chat-$temps;
mysql_query("DELETE FROM chat WHERE time<'$heure_fin_chat'");
if($submit){
if(empty($pseudo) or empty($com) or $pseudo=='Votre
pseudo'){
tchat();
exit();
}else{
$pseudo = trim($pseudo);
$pseudo = AddSlashes($pseudo);
$pseudo = strip_tags($pseudo);
$com = strip_tags($com);
$com = AddSlashes($com);
$insert_text="INSERT INTO chat(time,date,heure,pseudo,com)";
$insert_text.="VALUES('$heure_debut_chat','$date','$heure','$pseudo','$com')";
mysql_query($insert_text,$connect);
}
}
tchat();
mysql_close();
?>
</body>
</html>
<head>
<title>form</title>
<base target="_self">
</head>
<div align="center">
<form name="f" method="post" action="chat.php" target="principal" onSubmit="document.f.com.focus();">
<table width="405">
<tr>
<td valign="top" align="center">
<p align="left">Pseudo
<input name="pseudo" value="Votre pseudo" size="12" onFocus="this.select()" style="float: left">
</td>
</tr>
<tr>
<td valign="top" align="center">
<input name="com" rows="3" cols="30" wrap="virtual" size="38" onFocus=this.value='' style="float: left"><input type="submit" name="submit" value="Tchat!!" >
</td>
</tr>
<tr>
<td valign="top" align="center"></td></tr></table>
</form>
</div>
</font></p>
</body>
</html>
<script>
document.f.pseudo.focus();
</script>
<?php
function tchat(){
$connect=mysql_connect("localhost","login","pass");
mysql_select_db("basededonnee",$connect);
$query=mysql_query("SELECT DISTINCT pseudo FROM chat");
$nombre_connecte=mysql_num_rows($query);
echo"",$nombre_connecte," connecté(s) sur le chat<br><br>";
$affich_dialogue="SELECT * FROM chat ORDER BY id DESC";
$chat=mysql_query($affich_dialogue,$connect);
while($tab=mysql_fetch_array($chat,MYSQL_ASSOC)){
$pseudo = stripslashes($tab['pseudo']);
$com = stripslashes($tab['com']);
echo"<table width='435'><tr><td>";
echo"<font color='navy' size='2'><b>$pseudo</b><font>:";
echo"<font color='black' size='2'>({$tab[date]} à
{$tab[heure]})</font><br>";
echo"<font color='maroon' size='2'>$com<br></font>";
echo"</td></tr></table>";
}
}
?>
<html>
<head>
<meta http-equiv="Refresh" content="5; url=chat.php">
<base target="_self">
</head>
<body>
<?php
$connect=mysql_connect("localhost","login","pass");
mysql_select_db("test",$connect);
$temps = 300;
$heure_debut_chat = time();
$date = date("d-m-y");
$heure = date("H\hi");
$heure_fin_chat = $heure_debut_chat-$temps;
mysql_query("DELETE FROM chat WHERE time<'$heure_fin_chat'");
if($submit){
if(empty($pseudo) or empty($com) or $pseudo=='Votre
pseudo'){
tchat();
exit();
}else{
$pseudo = trim($pseudo);
$pseudo = AddSlashes($pseudo);
$pseudo = strip_tags($pseudo);
$com = strip_tags($com);
$com = AddSlashes($com);
$insert_text="INSERT INTO chat(time,date,heure,pseudo,com)";
$insert_text.="VALUES('$heure_debut_chat','$date','$heure','$pseudo','$com')";
mysql_query($insert_text,$connect);
}
}
tchat();
mysql_close();
?>
</body>
</html>
<html>
<head>
<title>TCHAT!!</title>
</head>
<frameset rows="51%,49%">
<frame name="principal" scrolling="auto" marginwidth="10" marginheight="14" frameborder="0" src="chat.php" target="_self">
<frame name="notes" scrolling="no" marginwidth="10" marginheight="14" frameborder="0" src="formchat.htm" target="_self">
</noframes>
<noframes>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<p>Cette page utilise des cadres. Pour pouvoir la consulter, votre navigateur doit supporter les cadres.</p>
</body>
</noframes>
</html>
<head>
<title>TCHAT!!</title>
</head>
<frameset rows="51%,49%">
<frame name="principal" scrolling="auto" marginwidth="10" marginheight="14" frameborder="0" src="chat.php" target="_self">
<frame name="notes" scrolling="no" marginwidth="10" marginheight="14" frameborder="0" src="formchat.htm" target="_self">
</noframes>
<noframes>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<p>Cette page utilise des cadres. Pour pouvoir la consulter, votre navigateur doit supporter les cadres.</p>
</body>
</noframes>
</html>