易截截图软件、单文件、免安装、纯绿色、仅160KB

php学习笔记(12):PHP+MYSQL留言板(下

1、提交表单Javascript验证
<form action="" method="post" name="myform" onsubmit="return CheckPost();">
SCRIPT language=javascript>
function CheckPost()
{
 
if (myform.user.value=="")
 {
  alert("请填写用户");
  myform.user.focus();
  return false;
 }
 if (myform.title.value.length<5)
 {
  alert("标题不能少于5个字符");
  myform.title.focus();
……
}
2、str_replace替换函数
替换的值,被替换的内容);
function htmtocode($content) {
   $content = str_replace("\n", "<br>", str_replace(" ", "&nbsp;", $content));
   return $content;
}
3、htmlspecialchars 格式化html
主要功能是将HTML格式化,防止在输出html时被浏览器执行
htmlspecialchars(所要格式化对象,定义单双引号,编码)
4、md5加密函数
md5( 加密对象 )
hearder.php:
<?php
/*
* Created on 2010-1-5
* Author :CHAUVET
* Function:被包含在其他页面的头部页面,演示include()
*/
function ReplaceSomeWords($words){
$words=str_replace("\n","<br/>",str_replace(" "," ",$words));
return $words;
}
?>
<a href="add.php" mce_href="add.php">添加页面</a>|<a href="list.php" mce_href="list.php">查看页面</a>|<a href="add.php" mce_href="add.php">登陆页面</a><br/>
<hr/>

add.php:
 <html>
 <head>
  <title>添加页面</title>
  <style type="text/css">
   body{font-size:12px;text-align:center;}
   #capation{font-size:24px;font-famliy:"华文新魏";}
  </style>
  <script type="text/javascript">
   function ClearInputWords(){
    document.myForm[0].value="";
    document.myForm[1].value="";
    document.myForm[2].value="请在此输入您的留言!";
   }
   function CheckInput(){
 &nb


相关文档:

PHP安装步骤(以apache 2 + php5.3为例)

1.     
Download Apache for windows MSI
file, and run it
By
default, port is 80, root dir is %apache_dir%/htdocs. You can update the
settings in conf/httpd.conf file
2.  If Apache Service can't be installed in "Control Panel > Admin Tools > Services&quo ......

php学习笔记(12):PHP+MYSQL留言板(上

require()  与  require_once()
    
      通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require
所指定引入的文件,如果出现错误是致命的。
nclude()  与  include_once()
    
    &n ......

PHP Session 变量

当您运行一个应用程序时,您会打开它,做些更改,然后关闭它。这很像一次会话。计算机清楚你是谁。它知道你何时启动应用程序,并在何时终止。但是在因特网上,存在一个问题:服务器不知道你是谁以及你做什么,这是由于 HTTP 地址不能维持状态。
通过在服务器上存储用户信息以便随后使用,PHP session 解决了这个问题(比如 ......

MySQL 字符串函数:字符串截取

截取province字符串中第一个<br>前的字符串~!
update lcjd
set  `province` = substring_index( `province` , '<br>', '1' );
在需要添加‘0’的位置添加一个‘0’
update lcjd
set lc_name2 = concat('0', lc_name2)
WHERE length(lc_name2) = 3
http://www.sqlstudy.com/s ......

linux mysql配置


卸载mysql
1、查找以前是否装有mysql
命令:rpm -qa|grep -i mysql
可以看到mysql的两个包:
mysql-4.1.12-3.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
2、删除mysql
删除命令:rpm -e --nodeps 包名
( rpm -ev mysql-4.1.12-3.RHEL4.1 )
3、删除老版本mysql的开发头文件和库
命令:rm -fr /usr/lib/mysql
r ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号