易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

comparing strings in PHP with the == operator

最近在Greg Beaver's的blog上发表的一篇新文章 comparing strings in PHP with the == operator 中提及了PHP的 == 运算符在对字符串进行比较时值得注意的问题。
在某些情况下,PHP会把类数值数据(如含有数字的字符串等)转换成数值处理,== 运算符就是其中之一。在使用 == 运算符对两个字符串进行松散比较时,PHP会把类数 ......

PHP工程师笔试题

 一个公司简单的面试题:
1. 简答题
(1)一些相关LINUX方面的指令操作eg: mkdir 创建目录 touch 创建文件夹以及修改权限chmod之类等等
(2)简述不同版本的PHP有什么区别,试举例简述.
(3),简述接口技术的好处,试举例简述.
(4)如何使用下面的类,并解释下面什么意思?
class test{
    function ......

MYSQL 事件调度的例子

1.SET GLOBAL event_scheduler = ON;
2.show processlist;
3.创建一个表 test 主要字段 no,name,sex,age
4.对该表插如几条数据
5.创建存储过程add_age
drop procedure if exists add_age;
delimiter|
create procedure add_age()
begin
  start transaction;
  update eventtest set age = age +1;
&n ......

asp.net连接mysql的问题

一:asp.net怎么连接mysql数据库
   下载mysql connection的东西
   http://dev.mysql.com/downloads/connector/net/6.2.html
   有3个download选第一个下载
   Windows (x86, 32-bit), ZIP Archive 
   mysql-connector-net-6.2.2-noinstall.zip ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号