Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Nos llega el POST desde el formulario de chat_pie.php...
- header('Content-Type: text/html; charset=UTF-8');
- ini_set('display_errors',1);
- ini_set('display_startup_errors',1);
- error_reporting(-1);
- $bd_hostname = 'localhost';
- $bd_username = 'root';
- $bd_password = '16032201';
- $bd_basename = 'gusanonet';
- $con = mysql_connect($bd_hostname, $bd_username, $bd_password);
- mysql_select_db($bd_basename,$con)or die ($sqldb_err.': '.mysql_error());
- mysql_set_charset('utf8');
- $mensaje = preg_match(ā^[p{L}a-z0-9s]+$/uā, $_POST['mensaje']);
- $sql = "INSERT INTO `gusanonet`.`historialchat` (`id`, `nick`, `mensaje`) VALUES (NULL, '".$_POST['nick']."', '".$mensaje."');";
- mysql_query($sql)or die ($sqldb_err.': '.mysql_error());
- echo $sql;
- echo $mensaje;
- /*if (isset($_SERVER["HTTP_REFERER"])) {
- header("Location: " . $_SERVER["HTTP_REFERER"]."?nick=".$_POST['nick']);
- }*/
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement