table_reference [, table_reference] …



  | join_table


    tbl_name [[AS] alias]

        [{USE|IGNORE|FORCE} INDEX (key_list)]

  | ( table_references )

  | { OJ table_reference LEFT OUTER JOIN table_reference

        ON conditional_expr }


    table_reference [INNER | CROSS] JOIN table_factor [join_condition]

  | table_reference STRAIGHT_JOIN table_factor

  | table_reference STRAIGHT_JOIN table_factor ON condition

  | table_reference LEFT [OUTER] JOIN table_reference join_condition

  | table_reference NATURAL [LEFT [OUTER]] JOIN table_factor

  | table_reference RIGHT [OUTER] JOIN table_reference join_condition

  | table_reference NATURAL [RIGHT [OUTER]] JOIN table_factor


    ON conditional_expr | USING (column_list)


SELECT * FROM t1 LEFT JOIN (t2, t3, t4) ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)


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




验证码图 片:

<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验 证:

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 AJAX 完整示例


  <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...";
      onSuccess: function(transport)
        if(transport.responseText.match(/^OK/) != null) {
          alert('Your message has been sent!');
        } else {
        $('submit').value = 'Send Message';
        $('submit').disabled = false;
    return false;
<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>



$your_email = '';  // 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
A message was sent to you from $name on $time.
Here is their message:
// 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