css手型

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html
>
<head>
<title
>cursor</title
>
</head>
<body>
<p style=cursor:hand>手形</p>
<p style=cursor:move>移动标志</p>
<p style=cursor:wait>等待状态
</p>
<p style=cursor:crosshair>定位指示
</p>
<p style=cursor:help>寻求帮助</p>
</body>
</html
>

 

IE与Firefox中兼容
html
中巧用CSS改变鼠标
为手形

<div style="cursor: pointer" mce_style="cursor: pointer"> 说明文字 内容
</div>

开源 PHP 验证码 Securimage 带语音识别

 

 

官方网站http://www.phpcaptcha.org/
下载地址http://www.phpcaptcha.org/download/
原文地址http://www.21andy.com/blog/20100417/1886.html

验证码图 片:

<img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image"  />

验证码文 本框:

<input type="text" name="captcha_code" size="10" maxlength="6" />

看不清验证码

<a href="#" rel="nofollow" target="_blank">Reload Image</a>

后端PHP验 证:

<?php
session_start();
 
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
 
if ($securimage->check($_POST['captcha_code']) == false) {
  // the code was incorrect
  // handle the error accordingly with your other error checking
 
  // or you can do something really basic like this
  die('The code you entered was incorrect.  Go back and try again.');
}

Securimage 属性

$img->image_width = 275;
$securimage->image_height = 90;
$securimage->perturbation = 0.9; // 1.0 = high distortion, higher numbers = more distortion
$securimage->image_bg_color = new Securimage_Color("#0099CC");
$securimage->text_color = new Securimage_Color("#EAEAEA");
$securimage->text_transparency_percentage = 65; // 100 = completely transparent
$securimage->num_lines = 8;
$securimage->line_color = new Securimage_Color("#0000CC");
$securimage->signature_color = new Securimage_Color(rand(0, 64), rand(64, 128), rand(128, 255));
$securimage->image_type = SI_IMAGE_PNG;
$securimage->show('backgrounds/bg5.jpg')

Securimage AJAX 完整示例

AJAX 前端HTML:

<html>
<head>
  <title>PHP Captcha with Ajax</title>
  <script type="text/javascript" src="prototype.js"></script>
 
  <script type="text/javascript">
  <!--
 
  function processForm()
  {
    $('submit').disabled = true;
    $('submit').value = "Processing.  Please Wait...";
 
    $('contact_form').request({
      onSuccess: function(transport)
      {
        if(transport.responseText.match(/^OK/) != null) {
          alert('Your message has been sent!');
          $('contact_form').reset();
        } else {
          alert(transport.responseText);
        }
 
        $('submit').value = 'Send Message';
        $('submit').disabled = false;
      }
    });
 
    return false;
  }
 
  -->
  </script>
</head>
 
<body>
 
<form id="contact_form" action="process.php" method="post" onsubmit="return processForm()">
  <div style="float: left; width: 100px">Your name:</div>
  <div style="float: left"><input type="text" name="sender_name" size="20" /></div>
  <div style="clear: both"></div>
 
  <div style="float: left; width: 100px">Email:</div>
  <div style="float: left"><input type="text" name="sender_email" size="30" /></div>
  <div style="clear: both"></div>
 
  <div style="float: left; width: 100px">Message:</div>
  <div style="float: left"><textarea name="message" rows="4" cols="30"></textarea></div>
  <div style="clear: both"></div>
 
  <div style="float: left; width: 100px">Security Image:</div>
  <div style="float: left"><img src="securimage/securimage_show.php" alt="CAPTCHA Image" /></div>
  <div style="clear: both"></div>
 
  <div style="float: left; width: 100px">Security Code:</div>
  <div style="float: left"><input type="text" name="code" size="8" /></div>
  <div style="clear: both"></div>
 
  <div style="float: left; width: 100px">&nbsp;</div>
  <div style="float: left"><input id="submit" type="submit" value="Send Message" /></div>
  <div style="clear: both"></div>
</form>
 
 
</body>
</html>

AJAX 后端PHP:

<?php


$your_email = 'you@example.com';  // Email to send message to
 
if ($_SERVER['REQUEST_METHOD'] != 'POST') exit; // Quit if it is not a form post
 
// quick way clean up incoming fields
foreach($_POST as $key => $value) $_POST[$key] = urldecode(trim($value));
 
// get form data into shorter variables
// each $_POST variable is named based on the form field's id value
$name    = $_POST['sender_name'];
$email   = $_POST['sender_email'];
$message = $_POST['message'];
$code    = $_POST['code'];
 
$errors  = array(); // array of errors
 
// basic validation
if ($name == '') {
  $errors[] = "Please enter your name";
}
 
if ($email == '') {
  $errors[] = "Please enter your email address";
} else if (strpos($email, '@') === false) {
  $errors[] = "Please enter a valid email address";
}
 
if ($message == '') {
  $errors[] = "Please enter a message to send";
}
 
 
if (sizeof($errors) == 0) {
  // only check the code if there are no other errors
  require_once 'securimage/securimage.php';
  $img = new Securimage;
  if ($img->check($code) == false) {
    $errors[] = "Incorrect security code entered";
  } // if the code checked is correct, it is destroyed to prevent re-use
}
 
if (sizeof($errors) > 0) {
  // if errors, send the error message
  $str = implode("\n", $errors);
  die("There was an error with your submission!  Please correct the following:\n\n" . $str);
}
 
$time = date('r');
$body = <<<EOD
Hi!
 
A message was sent to you from $name on $time.
 
Here is their message:
 
$message
EOD;
 
// send email
mail($your_email, "Contact Form Sent", $body, "From: $your_email\r\nReply-To: $email\r\nContent-Type: text/plain; charset=ISO-8859-1\r\nMIME-Version: 1.0");
 
die('OK'); // send success indicator
 
?>

更详细的文档请看官方网站

 

标签: div, style, float, img, left

纯CSS下拉菜单精简代码

 

<style type="text/css">

ul, li{list-style:none; padding:0; margin:0; line-height:160%}

a{font:normal 14px "宋体"; text-decoration:none}

li.mainnav{margin:10px; border:1px solid #039; float:left}

.mainnav ul{display:none}

.mainnav:hover ul, .mainnav:hover li{display:block}

.mainnav:hover{z-index:2; background:#fff}

</style>

<div style="position:relative; width:600px; height:40px">

<div style="position:absolute">

<ul>

<li class="mainnav">

<!--[if IE 6]><a class="mainnav" href="#"><table><tr><td><![endif]-->

<a href="#">导航01</a>

<ul class="catnavbox">

<li><a href="0101">导航01-05</a></li>

<li><a href="0102">导航01-04</a></li>

<li><a href="0103">导航01-03</a></li>

<li><a href="0104">导航01-02</a></li>

<li><a href="0105">导航01-01</a></li>

</ul>

<!--[if IE 6]></td></tr></table></a><![endif]-->

</li>

<li class="mainnav">

<!--[if IE 6]><a class="mainnav" href="#"><table><tr><td><![endif]-->

<a href="#">导航02</a>

<ul class="catnavbox">

<li><a href="#">导航02-05</a></li>

<li><a href="#">导航02-04</a></li>

<li><a href="#">导航02-03</a></li>

<li><a href="#">导航02-02</a></li>

<li><a href="#">导航02-01</a></li>

</ul>

<!--[if IE 6]></td></tr></table></a><![endif]-->

</li>

</ul>

</div></div>

<div style="clear:both; width:600px; height:100px; background:#390"></div>

标签: href, div, style, class