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

checkcode.php
====================
<?php
session_start();
$funcs = array('imagecreatetruecolor','imagecolorallocate','imagefill','imageline','imagedestroy','imagecolorallocatealpha','imageellipse','imagepng');
if(!function_exists('ob_gzhandler'))
    ob_clean();
 //crea ......

PHP工程师笔试题

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

关于mysql 的order by rand()

 官方手册上是这么写的:
<!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{f ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号