php ajax 留言板提供一款国人写的php ajax 留言板,他是利用了jquery php mysql ajax来实现php ajax 局部刷新留方板实例的喜欢就下载吧。
php教程 ajax 留言板
提供一款国人写的php ajax 留言板,他是利用了jquery php mysql教程 ajax来实现php ajax 局部刷新留方板实例的喜欢就下载吧。
*/
$link = @mysql_connect($db_host,$db_user,$db_pass) or die('unable to establish a db connection');
mysql_query("set names 'utf8'");
mysql_select_db($db_database,$link);
class comment
{
private $data = array();
public function __construct($row)
{
/*
/ the constructor
*/
$this->data = $row;
}
public function markup()
{
/*
/ this method outputs the xhtml markup of the comment
*/
// setting up an alias, so we don't have to write $this->data every time:
$d = &$this->data;
$link_open = '';
$link_close = '';
if($d['url']){
// if the person has entered a url when adding a comment,
// define opening and closing hyperlink tags
$link_open = '';
$link_close = '';
}
// converting the time to a unix timestamp:
$d['dt'] = strtotime($d['dt']);
// needed for the default gravatar image:
$url = 'http://'.dirname($_server['server_name'].$_server["request_uri"]).'/img/default_avatar.gif';
return '
';
}
public static function validate(&$arr)
{
/*
/ this method is used to validate the data sent via ajax.
/
/ it return true/false depending on whether the data is valid, and populates
/ the $arr array passed as a paremter (notice the ampersand above) with
/ either the valid input data, or the error messages.
*/
$errors = array();
$data = array();
// using the filter_input function introduced in php 5.2.0
if(!($data['email'] = filter_input(input_post,'email',filter_validate_email)))
{
$errors['email'] = 'please enter a valid email.';
}
if(!($data['url'] = filter_input(input_post,'url',filter_validate_url)))
{
// if the url field was not populated with a valid url,
// act as if no url was entered at all:
$url = '';
}
// using the filter with a custom callback function:
if(!($data['body'] = filter_input(input_post,'body',filter_callback,array('options'=>'comment::validate_text'))))
{
$errors['body'] = 'please enter a comment body.';
}
if(!($data['name'] = filter_input(input_post,'name',filter_callback,array('options'=>'comment::validate_text'))))
{
$errors['name'] = 'please enter a name.';
}
if(!empty($errors)){
// if there are errors, copy the $errors array to $arr:
$arr = $errors;
return false;
}
// if the data is valid, sanitize all the data and copy it to $arr:
foreach($data as $k=>$v){
$arr[$k] = mysql_real_escape_string($v);
}
// ensure that the email is lower case:
$arr['email'] = strtolower(trim($arr['email']));
return true;
}
private static function validate_text($str)
{
/*
/ this method is used internally as a filter_callback
*/
if(mb_strlen($str,'utf8') return false;
// encode all html special characters (, ", & .. etc) and convert
// the new line characters to
tags:
$str = nl2br(htmlspecialchars($str));
// remove the new line characters that are left
$str = str_replace(array(chr(10),chr(13)),'',$str);
return $str;
}
}
$comments = array();
$result = mysql_query("select * from comments order by id asc");
while($row = mysql_fetch_assoc($result))
{
$comments[] = new comment($row);
}
?>

Outils d'IA chauds

Undresser.AI Undress
Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover
Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool
Images de déshabillage gratuites

Clothoff.io
Dissolvant de vêtements AI

AI Hentai Generator
Générez AI Hentai gratuitement.

Article chaud

Outils chauds

MinGW - GNU minimaliste pour Windows
Ce projet est en cours de migration vers osdn.net/projects/mingw, vous pouvez continuer à nous suivre là-bas. MinGW : un port Windows natif de GNU Compiler Collection (GCC), des bibliothèques d'importation et des fichiers d'en-tête librement distribuables pour la création d'applications Windows natives ; inclut des extensions du runtime MSVC pour prendre en charge la fonctionnalité C99. Tous les logiciels MinGW peuvent fonctionner sur les plates-formes Windows 64 bits.

DVWA
Damn Vulnerable Web App (DVWA) est une application Web PHP/MySQL très vulnérable. Ses principaux objectifs sont d'aider les professionnels de la sécurité à tester leurs compétences et leurs outils dans un environnement juridique, d'aider les développeurs Web à mieux comprendre le processus de sécurisation des applications Web et d'aider les enseignants/étudiants à enseigner/apprendre dans un environnement de classe. Application Web sécurité. L'objectif de DVWA est de mettre en pratique certaines des vulnérabilités Web les plus courantes via une interface simple et directe, avec différents degrés de difficulté. Veuillez noter que ce logiciel

Listes Sec
SecLists est le compagnon ultime du testeur de sécurité. Il s'agit d'une collection de différents types de listes fréquemment utilisées lors des évaluations de sécurité, le tout en un seul endroit. SecLists contribue à rendre les tests de sécurité plus efficaces et productifs en fournissant facilement toutes les listes dont un testeur de sécurité pourrait avoir besoin. Les types de listes incluent les noms d'utilisateur, les mots de passe, les URL, les charges utiles floues, les modèles de données sensibles, les shells Web, etc. Le testeur peut simplement extraire ce référentiel sur une nouvelle machine de test et il aura accès à tous les types de listes dont il a besoin.

SublimeText3 version Mac
Logiciel d'édition de code au niveau de Dieu (SublimeText3)

Bloc-notes++7.3.1
Éditeur de code facile à utiliser et gratuit
'.$link_open.'
'.$link_close.'
'.$d['body'].'