首页 > phper

php ExcelReader 读取Excel类

$allow_url_override = 1; // set to 0 to not allow changed via post or get
if(!$allow_url_override || !isset($file_to_include))
{
 $file_to_include = "phprm.com.xls";
}
if(!$allow_url_override || !isset($max_rows))
{
 $max_rows = 0; //use 0 for no max
}
if(!$allow_url_override || !isset($max_cols))
{
 $max_cols = 5; //use 0 for no max
}
if(!$allow_url_override || !isset($debug))
{
 $debug = 0;  //1 for on 0 for off
}
if(!$allow_url_override || !isset($force_nobr))
{
 $force_nobr = 1;  //force the info in cells not to wrap unless stated explicitly (newline)
}

阅读全文

通过ICQ网关发送手机短信的PHP源程序

//###########################################################
//
// for questions and comments
// roland (alias -=: vlieg :=-)
// icq #78354631
// mail: vlieg@atoomnet.net
//
// nb: this script won't work on free hosting pages, because of the secure mode!
// nb: you must have registered your icq# at http://web.icq.com/sms/login/ in order for this script to work
//###########################################################

阅读全文

php ajax注册验证用户名是否存在代码

conn.php文件

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script >
var xmlhttp
function showhint(str)
{
if (str.length==0)
  {
  document.getelementbyid("txthint").innerhtml=""
  return
  }
xmlhttp=getxmlhttpobject()
if (xmlhttp==null)
  {
  alert ("browser does not support http request")
  return
  }
xmlhttp.onreadystatechange=statechanged

阅读全文

SupeSite利用join left联合查询出新闻表中带有图片附件记录

mysql教程_connect('localhost','root','root');
mysql_select_db('abc');
mysql_query("set names 'gbk'");

$sql = "select a.itemid,a.lastpost,a.city,b.thumbpath from supe_spaceitems  a left join supe_attachments  b on a.itemid = b.itemid where a.picid>0 order by a.itemid desc limit 0,3";
 
 $query  = mysql_query( $sql );
 while( $k = mysql_fetch_array( $query ) )
 {
  $str .= "<a href='/a/'".date("ymd",$k['lastpost']).'/v-'.$k['itemid'].".html><img src=".$url.'/attachments/'.$k['thumbpath']." /></a>";
 } 

阅读全文

php搜索csv表格中是否存在指定数据

//搜索csv中指定内容

$fh = @fopen("csv_file_name", "r");
if($fh) {
   if(flock($fh, lock_ex)) {
      while(!feof($fh)) {
         $line = fgets($fh);
         if(strstr($line, $target_email_address) !== false) {
            $data = split(",", $line); // $data *is* an array
         }
      }
      flock($fh, lock_un);
   }

阅读全文