A calendar code

This class can be used to display month calendars in HTML tables.
It takes a given month and year and generates an HTML table with the days of that month. The calendar start week day may be set to Sunday or Monday.
Special event days may exhibit the title of the event in the respective calendar table [...]

PHP read Excel

?View Code PHP 
< ?php
/**
* <?php
* require "excel_class.php";
* Read_Excel_File("Book1.xls",$return);
* for ($i=0;$i<count($return[Sheet1]);$i++)
* {
* for ($j=0;$j<count($return[Sheet1][$i]);$j++)
* {
* echo $return[Sheet1][$i][$j]."|";
* }
* echo "<br>";
* }
* ?>
* < ?
* require "excel_class.php";
* Read_Excel_File("Book1.xls",$return);
* Create_Excel_File("ddd.xls",$return[Sheet1]);
* ?>
*/
define(’ABC_CRITICAL’, 0);
define(’ABC_ERROR’, [...]

I use frequently some PHP function

Before makes php the project development, uses frequently some functions, reorganize now, shares together with everybody

?View Code PHP< ?php
class function_class{
/**
* Get IP
*
* @return IP
*/
function GetIP() {
if ($_SERVER["HTTP_X_FORWARDED_FOR"]){
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
else if ($_SERVER["HTTP_CLIENT_IP"]){
$ip = $_SERVER["HTTP_CLIENT_IP"];
}
else if ($_SERVER["REMOTE_ADDR"]){
$ip = $_SERVER["REMOTE_ADDR"];
}
else if (getenv("HTTP_X_FORWARDED_FOR")){
$ip = getenv("HTTP_X_FORWARDED_FOR");
}
else if (getenv("HTTP_CLIENT_IP")){
$ip = getenv("HTTP_CLIENT_IP");
}
else if (getenv("REMOTE_ADDR")){
$ip = getenv("REMOTE_ADDR");
}
else{
$ip = "Unknown";
}
return [...]

MYSQL limit Optimization-2

The MYSQL optimization is very important. Other most commonly used also most need to optimize are limit. mysql limit has brought enormous convenient to the paging, but the data quantity one is big, the limit performance suddenly drops.
Similarly takes 10 data
select * from temp limit 10000,10
and
select * from temp limit 0,10
It is not a quantity rank.
Now [...]

MYSQL limit Optimization

select * from table LIMIT 5,10; #return to 6-15th line
select * from table LIMIT 5; #return to 0-5 line
select * from table LIMIT 0,5; #return to 0-5 line
 Performance optimization:
In MySQL5.0 limit high performance.
1.
Select * From cyclopedia Where ID>=(
Select Max(ID) From (
 Select ID From cyclopedia Order By ID limit 90001
) As tmp
) limit 100;
2.
Select * From [...]

Solar Form Validation Types

This is partially for my reference and partially for anyone looking at validating in their Solar_Form forms - here’s the validation methods (as defined in /Solar/Filter.php):
Each of these can be used when defining the form, commonly in the setElements structure like so:

Custom Form Helpers in Solar

Another thing that Solar makes easy is the creation of custom form helpers. These can be anything outside of the usual input types (like text, checkbox, textarea, etc) and can be used to make helpful, more complex inputs for your app.
In a previous post, I worked some with the Solar_Form class to create a login [...]

Being Binary in SOAP

Well, it might not be the best way to do it, but here’s a way I found to send binary data via PHP’s SOAP extension from one place to another:
Server:

?View Code PHPfunction recieveFile($data){
$data=base64_decode($data);
$path=’/my/file/path/img_out.gif’;
$fp=fopen($path,’w+’);
if($fp){ fwrite($fp,$data); fclose($fp); }
return strlen($data).’written’;
}
$input = file_get_contents(”php://input”);
$server = new SoapServer(’http://[my url here]/binary.wsdl’,array(’encoding’=>’ISO-8859-1′));
$server->addFunction(’recieveFile’);
$server->handle();

and the Client:

?View Code PHPini_set("soap.wsdl_cache_enabled", "0");
//send binary data
$client=new SoapClient(’http://[my url here]/binary.wsdl’,array(’encoding’=>’ISO-8859-1′));
$data=file_get_contents(’/my/file/path/img_to_send.gif’);
$ret=$client->recieveFile(base64_encode($data));
print_r($ret);
[/code]
 
It’s pretty [...]

Has optimized PHP click number statistics code

Has optimized PHP click number statistics code
< ?php
error_reporting(E_ALL);
$ROOT_PATH = ‘../’;
include_once($ROOT_PATH . “include/config.php”);$update_time = 1800;//The refresh time, second
$article_id = (isset($_GET['article_id']) && is_numeric($_GET['article_id']) && $_GET['article_id'] > 0) ? intval($_GET['article_id']) : 0;
if ($article_id > 0) {
    $filename = $ROOT_PATH . ‘log/click_log.txt’;

Simple yet powerfull PHP class to parse RSS.

<?php
/*
 ======================================================================
 lastRSS 0.9.1
 Simple yet powerfull PHP class to parse RSS files.
 by Vojtech Semecky, webmaster @ oslab . net
 Latest version, features, manual and examples:
     http://lastrss.oslab.net/
     http://www.easemarry.com/blog 
———————————————————————-
 LICENSE This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License (GPL)
 as published by the Free Software Foundation; either version 2
 of the [...]