⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.php

📁 还是WEB游戏源码 Darkstep 还是WEB游戏源码 Darkstep
💻 PHP
字号:
<script>

/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(theform,thelimit){
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters remaining on your input limit'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

</script>
<script language="JavaScript"> 

function closeIt() { 
close(); 
} 

</script> 
<script language="JavaScript"> 

function bb(openen, sluiten) 
    { 
    comp = navigator.userAgent.toLowerCase(); 
    vers = parseInt(navigator.appVersion); 
    msie = ((comp.indexOf("msie") != -1) && (comp.indexOf("opera") == -1)); 
    nets = ((comp.indexOf('mozilla')!=-1) && (comp.indexOf('spoofer')==-1) && (comp.indexOf('compatible') == -1) && (comp.indexOf('opera')==-1) && (comp.indexOf('webtv')==-1) && (comp.indexOf('hotjava')==-1)); 
    win  = ((comp.indexOf("win")!=-1) || (comp.indexOf("16bit") != -1)); 
     
    if ((vers >= 4) && msie && win) 
        { 
        selectie = document.selection.createRange().text; 
        if (!selectie) 
            { 
            document.schrijf.bericht.focus(); 
                        document.selection.createRange().duplicate().text = openen + " " + sluiten; 
            return; 
            } 
        else 
            { 
            document.schrijf.bericht.focus();             
            document.selection.createRange().text = openen + selectie + sluiten; 
            return; 
            } 

} 
    else 
        { 
        document.schrijf.bericht.value += openen + " " + sluiten; 
        document.schrijf.bericht.focus(); 
alert("NIETS"); 
        } 
    } 


function smilie(ubb) 
    { 
    var ubb = " "+ubb+" "; 
      if (document.schrijf.bericht.createTextRange) 
        { 
          document.schrijf.bericht.focus(); 
          document.selection.createRange().duplicate().text = ubb; 
           } 
    else 
        { 
          document.schrijf.bericht.value += ubb; 
           } 
      } 
     
</script>
<?PHP
// Xibitz berichtenbalk V1.6
// Copyright Hidde Stokvis

////////////////////Includen//////////////////////
include ("config.php");
///////////////////////////////////////////////////

if ($_POST) {
if (empty($_POST['naam']) || empty($_POST['bericht']) || $_POST["naam"] == "Naam") {
echo "
<table border=\"0\" width=\"150\" align=\"center\">
 <tr>
  <td><b>Fout!</b></td>
 </tr>
 <tr>
  <td colspan=\"2\">U heeft niet alle verplichte velden ingevuld.<br>
	<b><a href=\"post.php\">Ga terug.</b></a>
  </td>
 </tr>
</table>
";
} else {
////////////////////HTML Block//////////////////
$bericht = htmlspecialchars($_POST['bericht']); 
$bericht = str_replace("\r\n","<br>",$_POST['bericht']);
$naam = htmlspecialchars($_POST['naam']); 
$naam = str_replace("\r\n","<br>",$_POST['naam']); 
$email = htmlspecialchars($_POST['email']); 
$email = str_replace("\r\n","<br>",$_POST['email']);
//////////////////////////////////////////////////

////////////////////Smilies//////////////////////
$sql = "SELECT * FROM XBB_smilies"; 
$query = mysql_query($sql);
while ($show = mysql_fetch_object($query)) {
$bericht = str_replace("".$show->code."", "<img src=".$show->url." border=0>", $bericht);
}
//////////////////////////////////////////////////

////////////////////Scheldwoorden/////////////
$sql = "SELECT * FROM XBB_scheldwoorden"; 
$query = mysql_query($sql);
while ($show = mysql_fetch_object($query)) {
$naam = str_replace("".$show->scheldwoord."", "".$show->vervang."", $naam);
$email = str_replace("".$show->scheldwoord."", "".$show->vervang."", $email);
$bericht = str_replace("".$show->scheldwoord."", "".$show->vervang."", $bericht);
}
//////////////////////////////////////////////////

////////////////////UBB Codes//////////////////
$bericht = str_replace('[b]', '<B>', $bericht); 
$bericht = str_replace('[/b]', '</B>', $bericht); 
$bericht = str_replace('[i]', '<I>', $bericht); 
$bericht = str_replace('[/i]', '</I>', $bericht); 
$bericht = str_replace('[u]', '<U>', $bericht); 
$bericht = str_replace('[/u]', '</U>', $bericht);
//////////////////////////////////////////////////

////////////////////Bericht toevoegen////////////
$insert = "INSERT INTO XBB_posts (id, naam, email, bericht, ip, datum) VALUES  
('','$naam','$email','$bericht','$ip','$datum')";  
mysql_query($insert) or die(mysql_error());

echo "
<table border=\"0\" width=\"150\" align=\"center\">
 <tr>
  <td><b>Succesvol gepost</b></td>
 </tr>
 <tr>
  <td colspan=\"2\">$naam, u bericht is succesvol geplaatst<br>
  <input type=button value=\"Sluiten\" onClick=\"closeIt()\">
  </td>
 </tr>
</table>
";
}
} else {
echo "
<table border=\"0\" width=\"150\" align=\"center\">
 <tr>
  <td><b>Post</b></td>
 </tr>
 <tr>
  <td colspan=\"2\">
<form method=POST name=\"schrijf\">
<input type=\"text\" name=\"naam\" value=\"Naam\"  maxlength=\"20\">*<br>
<input type=\"text\" name=\"email\" value=\"email\"  maxlength=\"20\"><br>

<textarea name=\"bericht\"  rows=\"3\" cols=\"20\"></textarea>*<br><script>
displaylimit('document.schrijf.bericht',$max)
</script><br>";
$sql = "SELECT * FROM XBB_smilies"; 
$query = mysql_query($sql);
while ($show = mysql_fetch_object($query)) {
 echo "<a href=\"javascript:smilie('$show->code')\" onfocus=\"filter:blur()\"><img src=\"$show->url\" border=\"0\"></a> ";
}
echo "
<br><input type=\"submit\" name=\"submit\" value=\"Post\">
</td>
 </tr>
</table></form>
";
}
echo "<br><br>&copy; Hidde Stokvis ]||[ <a href=\"http://www.xibitz.org\">Xibitz.org</a>";
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -