[ create a new paste ] login | about

Link: http://codepad.org/wFDEMrNk    [ raw code | output | fork ]

PHP, pasted on Jun 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<html> 
<head> 
<title>Speak</title> 
</head> 
<body> 
<?php 
        if ($words){
		$link = mysqli_connect('localhost', 'xxx', 'xxx', 'ChatRoom');
        	$time = date('Y-m-d-a:i:s');
        	$str = "INSERT INTO chat(chtime,nick,words) values('$time','$nick','$words')" ;
      		mysqli_query($str,$link);
        	mysqli_close($link);
	}
?>
<form action = "Speak.php" method = "post" target = " _self"> 
<input type = "text" name = "words" cols="20"> 
<input type = "submit" value = "Speak"> 
</form> 
</body> 
</html>


Output:
1
2
3
4
5
6
7
8
9
10
11
<html> 
<head> 
<title>Speak</title> 
</head> 
<body> 
<form action = "Speak.php" method = "post" target = " _self"> 
<input type = "text" name = "words" cols="20"> 
<input type = "submit" value = "Speak"> 
</form> 
</body> 
</html>


Create a new paste based on this one


Comments: