-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwall.php
46 lines (32 loc) · 1.01 KB
/
wall.php
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
<html>
<body>
<form method="POST" action="addwall.php">
<strong>Ingresar mensaje:</strong> <input type="text" name="T1" size="20"><br><br>
<input type="submit" value="Agregar" name="valor">
</form>
<iframe id="request" hidden>
<iframe src="wall.php" height="40%" width="95%" align="middle"></iframe>
</iframe>
<div id="response"></div>
</body>
</html>
<?php
require_once 'login.php';
$obj_conexion = mysqli_connect($db_hostname, $db_username, $db_password, $db_database);
if(!$obj_conexion)
{
echo "<script>alert('Cabeza no encaraste un queso');</script>";
}
else
{
// echo "<h3>Conexion Exitosa PHP - MySQL</h3><hr><br>";
}
$query = "SELECT * FROM mensaje ORDER BY id DESC";
$resultado = mysqli_query($obj_conexion,$query);
if (!$resultado) die("El acceso a la base de datos ha fallado: " . mysqli_error());
while($row = mysqli_fetch_assoc($resultado)) {
$valor = $row['valor'];
$fecha = $row['fecha'];
echo $valor ." ". $fecha."<br>";
}
?>