我有以下的html页面: 我想要做的是大写第一个字母(这是工作没有任何问题),并剥离任何html代码或任何代码的文本框“”“>>”的结合,所以用户不能在服务器端插入恶意代码来执行。大写第一个字母并去掉html代码
我发现这条代码:
var StrippedString = OriginalString.replace(/(]+)>)/ig,"");
如何上面的代码添加到以下页面,以便充分发挥了两者的照顾?
/**
* ****************************************************************************
* Micro Protector
*
* Version: 1.0
* Release date: 2007-09-10
*
* USAGE:
* Define your requested password below and inset the following code
* at the beginning of your page:
* <?php require_once("microProtector.php"); ?>
*
*
*
******************************************************************************/
$Password = 'TESTPASS'; // Set your password here
/******************************************************************************/
if (isset($_POST['submit_pwd'])){
$pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
if ($pass != $Password) {
showForm("Wrong password");
exit();
}
} else {
showForm();
exit();
}
function showForm($error="LOGIN"){
?>
IMC - Authentication![test.png](test.png)
Your Name:
Password:
}
?>
+0
只能首字母大写或每个单词的第一个字母? –
+0
它的名字,所以我只是首字母大写。 –
+0
我在代码中看不到任何jQuery,是否有可能选择的标记不正确? –