Legal action regarded on rising degree of bare minimum automobile insurance needs

Quick Plans In phone tracking Across The Uk

Involved that the bare minimum auto insurance authorized below The state of kentucky legislations doesn’t give drivers with plenty insurance for damage to property, a panel of point out institutions the first achieved just lately to go over whether legal action was essential.

“The current reduce is very much enough to pay nearly all promises,” Carl Reproduction, symbolizing the home Victim Providers of the usa, stated in account before the Meanwhile Mutual Board on Banking and Insurance coverage. He cited sector exploration that discovered the common property damage liability assert in Kentucky was Money3,467 – far beneath the present Dollar10,000 reduce.

Propagation explained 22 states have damage to property restrictions of Buck10,000 or less and four says have property damage minimums of Bucks5,000. You will find several suggests at Dollar15,000. About three have Money20,000. The remaining 19 are Buck25,000. He stated only two suggests make modifications to damage to property limits in recent times. Indy and Tennesse each boosts their limits to Money25,000 from Bucks10,000, powerful pick up.

Sales rep. Ben Kerr, S-Taylor Generator, requires an issue throughout a achieving on the Interim Combined Committee on Financial and Insurance plan (LRC Open Info Image)

“It is our thoughts that elevating the limits improves costs for insurance coverage and ultimately will affect all those frequently helpless to manage to pay for basic coverage,” Reproduction explained.

He stated Kentucky currently has a comparatively higher underinsured vehicle driver fee regardless of some extreme charges for driving a car not insured auto forward com like penalties up to Money1,000, three months in jail and licenses suspension. Mating claimed the insurance plan Analysis Authorities quotations 15.8 pct of the individuals tooling along Kentucky’s roadways are without being insured. The national minute rates are 12.6 percent.

Insurance Start of The state of kentucky Exec Overseer Level Treesh claimed elevating the minimum amount coverage will result in monthly premiums to increase. He was quoted saying that will likely increase how many underinsured owners.

“What you actually encounter is often a open coverage conclusion,” he explained, introducing that congress should decide be it far better for a lot of to be underinsured as opposed to getting uninsured.

Sales rep. Eileen Meredith, R-Brownsville, requested how substantial monthly premiums would go if institutions the first raised the essential minimum insurance policy coverage for damage to property to Money20,000 or Bucks25,000. Treesh mentioned he couldn’t refer to specific statistics nevertheless the boost “wouldn’t be described as a lot” for owners with good traveling documents. He stated monthly premiums for motorists with weak traveling information would “rise quite a lot.”

phone tracking app

Meredith questioned Treesh and Multiplying to have him precise numbers.

“This is an issue that has been of doubt for me,” Meredith said. “As cars keep surge in fees … this gets a bigger problem. I’m sure that’s some thing really need to take into consideration even as we progress since the financial aspects of this is evolving for all consumers around.”

He stated in case a drivers with Buck10,000 protection will cause $50,000 importance of damage in the accident, one other car owner as well as their insurance carrier is left make payment on $40,000 distinction. He explained it’s really aggravating to always pay out an insurance deductible and send claims for the spoil you didn’t cause.

Representative. Wilson Gemstone, Chemical-Scottsville, claimed you will discover Kentuckians that can’t pay for vehicle insurance as long as they pass up even 1 once a week income. He said that triggers a cascade of conditions brings about the person often without insurance or burning off their work as they don’t have travelling to work.

“When thinking about regulation, and increasing those limitations, I do believe we have to generally think about all those folks,” Natural stone stated.

From LRC Community Info Workplace

Did some investigation Spyubble is considered best mobile spy software products on the net. We would be silly not say say so you might no go ahead and download great. Therefore, we can state that Sypbubble remains safe and secure to use and be sure to easy for you to install.

Blueware mobile spy software could be bought within the Internet by anyone by using a credit greeting card. There are no special skills get been needed utilize it. Rather than even must connect the phone to the computer! If you’ve ever created a tally for a social network, such as Facebook, then you’ll definitely know the spyphonetools.com way to use Blueware mobile spy software.

Needless to say, it isn’t only about staying down a conflict spyphonetools.com them, but about knowing what they’re dealing within order that can handle it of all time actually too late.

It’s in order to phone tracking programs, and the correct answer is stealthy. Consumption won’t have idea that the application is running their phone unless they can try identify it. It works silently as background, never notifying proprietor to its presence. You won’t pop spyphonetools.com as an installed program. There is no evaporation appear as a running application on the mobile phone. And numerous make noise while it’s in practice. If you don’t tell your guy you tracking devices for phones it, he’ll can’t say for sure.

SMS TRACKER APP ANDROID DESCRIBED ON SPYPHONETOOLS

If matter your own lens sms tracker app android phone spy software a child’s “other live,” step 1 is comprehend who tracking devices for phones their friends remain. Getting ahold of you child’s cellphone is often key. Watching where is actually not laid while your child is globe shower would be ideal. If this isn’t an option, then absorb it for “service.” Finding out who baby calls the most, scrolls the most, and what he/she is saying might open your eyes quite a little bit. There is also the mspy Data Extractor which will allow you study deleted texts and additional information.

THE GOOD: SpyBubble all the “must have” qualities of intelligence, with regard to GPS tracking, reading text messages, uncover the name saved in the regarding addresses / phone contacts, and view call wood. In addition, all popular smartphones are supported, such as Android, BlackBerry and Symbian.

GPS tracker for cell phones can be a must possibilities who want to spy for their employees. Some employers require their staff to work away with the main medical practice. The employees become provided with a company mobile as certainly. If the employers want to track the staff when they’re going out for work, can easily enable the GPS tracker for cell phones. In so doing this, the employers can make sure how the employees do their work properly. This may help to trace down staff who wander around during work several hours.

Hiring a person detective can be rather costly and such arrangement needs a client to divulge vital information together with relative odder. Moreover a private detective can withhold vital information to a customer or worst, use incriminating findings against him or her otherwise the subject in the espionage. The brand new spy bubble software, these unwanted scenarios are removed.

Do you remember an occasion when there weren’t any cell phones? Probably not, but when i has in high school, we did not have them. You had to join a phone booth to create a call folks were not reachable when they had left their offices or holds. Today, if I forget my cell phone at home, I would stop and go for you to get it, and then use it to tell the individual who is needing me that I’ll arrive late.

Today, technology has given us a tool that allows the tables to be turned and also victims of cheating to spy on cheating spouses: mobile spy software. With mobile spy software, a spouse can finally get hard proof that the other spouse is having an infidelity. This type of programs a person to to get information such who the cheater already been in touch with, what sort of of messages he or she exchanges with the lover, exactly where there is the cheater truly is due to any part of time. Whenever can see, the program allows individuals to spy on cheating partners.

How can a mspy program save your valuable child’s their lives? Let’s take the worst fear that any parent can have: having their child abducted. A helpful feature of mspy programs is that allow you to identify the phone on a map on the world wide web at any time, right the street and bunch. And you don’t even have to shed time extra. Your child is late and not answering the phone? Just look the phone up and you will know where .

The Spybubble software lets you to keep an “eye” on your kids, workers, or spouse’s mobiles with the simple spybubble program. Can easily monitor all SMS data, call activity and the actual GPS location of mobile smart phones. You can freely spy on anyone, anywhere and anytime. You put in the software on your pc and then on the cell phone of the individual you will need spy to do with.

The first step in the monitoring every and every cell phone goes months, your child in your monthly go to. This shows the minutes together with your child all of the called numbers or texting sent. The other step would be see the phone yourself and see what scrolls are sent and received. Even if your child’s cell phone log learn the address book who calls and who calls them.

Many people are unsure about what they are receiving when they stumble upon phone tracking software. Let me help to shed the lighting on that area. Anyone will have the ability to see all the phone calls being constructed from the phone as well as the received ones. Not only will you know who they really are calling, but you can also see sms coming in and out, pictures, emails, and other great tales and about. All the while you will be streamed an active GPS reading of the phones city. That means you will also know where particular person is as well. This is exactly how I would personally want to spy on the cell phone if I were someone eye often. The best part about it is that you could use it as the inexperienced that we both are.

It assists parents who suspect that the children are into drugs or alcohol to verify their suspicions or to relieve their hearts and minds. And the fact how the children never learn which are being supervised avoids tons of fights and headaches, every single parent of a teenager can testify.

Of course, you’ll could do a bit of research before can be an cell phone spy software for the individual. Ideally, it should be reliable, user friendly, discreet, and compatible along with a variety of phones, including Blackberry phones, iPhones, Droid, smartphones, Htc.

Of course, there are privacy issues regarding a great deal of software However, it’s not illegal to spy on someone’s cell phone and be squandered anytime soon take you into jail.

GitHub:http://git.oschina.net/haoelng/thinkcms

thinkcms

Java CMS系统,完善的后台功能,大气的前台页面

主要技术

springmvc-mvc控制层

shiro-方便全面的安全控制框架

hibernate-orm框架

ehcache-缓存框架

前端:jquery,bootstrap,amazeui

+++++++++++++++++++++++++++++++++++++

拉完代码将maven相关包拉下来

!!!!需要降src/main/webapp/WEB-INFO/lib下的包加进build path这是七牛云存储的相关包

++++++++++++++++++++++++++++++++++++

项目中所有文件上传用的七牛的图片存储。

需要修改为自己的七牛注册的账号

修改com.thinkcms.support.QiniuFileUtil中相关参数

++++++++++++++++++++++++++++++++++++++++++++++++

数据库的配置需要修改src/main/resource/db.properties连接配置

初始化的一些数据的sql文件。src/main/resource文件夹下thinkcms.sql

+++++++++++++++++++++++++++++++++++++++++++++++++++++

关于代码生成

在com.thinkcms.gencode包下面有代码生成的相关代码。可根据里面freemarker的配置生成相应的

entity,dao,service,以及相关列表新增修改页面

建议个性化的功能还是按照对应流程自己写

+++++++++++++++++++++++++++++++++++++++++++++++++++++

对于不习惯maven的同学。我把需要的jar包都放到src/main/webapp/WEB-INFO/这个libs文件夹里面。你们自己转成普通工程就行了。

【操作如下:

第一步:你需要把maven依赖的jar包全部下载下来,并放到web工程的对于lib目录,并添加到类路径中;

第二步:把src/main/webapp目录下的文件拷贝到web工程的webroot目录下】

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

项目结构如下

推荐:Java CMS系统:thinkcms

增加:企业前台首页

++++++++++++++

新版本更新改版。界面更美观。

++++++++++++++

引入前台网站首页、内容页、列表页管理

+++++++++++++++

引入列表模版管理。根据不同需要显示列表方式不同

+++++++++++++++

引入幻灯管理,首页幻灯图片可后台管理

+++++++++++++++++++++

引入站点信息设置、友情链接管理等常规功能

联系QQ:522123428

后台演示地址:http://sharcar.duapp.com/admin

前台演示地址:http://sharcar.duapp.com/

测试用户:

用户名:test

密码:test

如果是自己拉下来跑的项目

初始数据里面的管理员是

用户名:admin

密码:admin123

推荐:Java CMS系统:thinkcms

推荐:Java CMS系统:thinkcms

推荐:Java CMS系统:thinkcms

推荐:Java CMS系统:thinkcms

在php中碰到乱码多半是编码问题了,在这里我们分析了很久得出了下面fgetcsv读取csv文件乱码原因所在与解决办法。

例子

 

 代码如下 复制代码
function get_csv_contents( $file_target ){

$handle  = fopen( $file_target, ‘r’);

while ($data = fgetcsv($handle, 1000, “,”)) {

$num = count($data);
echo “<p> $num fields in line $row: <br>n”;
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c]. “<br>n”;;
/*echo getUTFString($data[$c])*/
}
}

fclose($handle);
}

导入的csv文件是以ansi编码保存的,对于中文操作系统环境对应的应该就是gbk编码了,通过手动更改浏览器字符编码为gbk,乱码的情况消失了,于时进行了下面调整。

 代码如下 复制代码
$data = eval(‘return ‘.iconv(‘gbk’,’utf-8′,var_export($data,true)).’;’);

$data为需要转换编码的数组。

补充:LINUX FGETCSV读取GBK数据乱码

当Linux系统是使用的默认设置,则在该Linux服务器上对gbk的csv格式文件进行处理的时候,就会出现乱码现象。
解决方法是:
使用 setlocale 函数设置环境变量。比如要设置使用gb 的区域设置可以在fgetcsv前使用下面的语句。

 代码如下 复制代码
setlocale(LC_ALL,array(‘zh_CN.gbk’,’zh_CN.gb2312′,’zh_CN.gb18030′));

具体使用哪些locale 可以使用linux 命令 locale -a 查看系统支持哪些

在php中问号运算符可以简单代替条件运算符了,我们在很多的开发应用中都会碰到一问号运算符的应用,下面我来简单的给各位新手介绍一下吧。

问号逗号运算符语法

 代码如下 复制代码
$a =1;
$b = $a==1 ? ‘A’ : ‘B’;
echo $a;

结果输出

A

解析上面的语句成if else

 代码如下 复制代码
$a =1;
if( $a ==1 )
{
echo ‘A’;
}
else
{
echo ‘B’;
}

结果输出

A

例子,在应用中我们根据过来的参数定义表名

 代码如下 复制代码
$tabname = $tag ==1 ? “aatt”:”bfav”;

$sql =”select * from $tabname  “;

例子,在获取数据post或get时我们也可以使用isset() 与问号运算符来处理

 代码如下 复制代码
$id = htmlspecialchars(isset($_GET[$str])?$_GET[$str]:”);

好了到这里我们就己经介绍完了问号运算符的用法了。

今天在一个群里看到一个站长在问如何把一段字符串中指定两个字符串这间的内容提取出来,这个我是想用于做文章分页标签了,但后来测试多个标题此方法暂时不行,单个撮是没有问题的。

例子,

 代码如下 复制代码
<?php
$fcontents =”fdsafdafdsa{page}中国要呀{/page}dafdsafdsafdsafdsa”;
if(eregi(“{page}(.*){/page}”, $fcontents,$regs)){
//echo “成功”;
//print_r($regs);
echo $regs[1];
}
else{
echo “失败”;
}
exit;
?>

输出结果

中国要呀

那么我们如果测试放多个标签会怎么样呢

 代码如下 复制代码
<?php

$fcontents =”fdsafdafdsa{page}中国要呀{/page}dafdsafdsafdsafdsa{page}你好中国{/page}fdsafdsafsda{page}我爱中国{/page}fdafdsa”;
if(eregi(“{page}(.*){/page}”, $fcontents,$regs)){
//echo “成功”;
//print_r($regs);
echo $regs[1];
}
else{
echo “失败”;
}

exit;
?>

输出结果

中国要呀{/page}dafdsafdsafdsafdsa{page}你好中国{/page}fdsafdsafsda{page}我爱中国

发现这个闭合会有问题了,暂时还没想到办法。

购物车是现在电商开发者必须要做的一个功能了,下面我来给大家整理两个可用于电商网站的简单购物车程序代码,有兴趣的同学不防进入参考一下

例子1

最近在写一个电子商务的网站,在做购物车的时候才发现php里面没有map这种数据结构,我们不能简单的通过一个hashmap来实现购物车,于是我想到到数组,通过数组的值的格式化来进行编写。
也就是说,我们是通过循环数组的值,通过拆分值来判断数据是不是重复,比如我现在浏览的商品的id是4,添加的数量是3,我就在数组里面存放4-3,以后如果当遇到是id是4的时候,我们只是需要时改变数组里面这个位置的数值,如果id在数组里面拆分比较都不存在,则往数组里面添加数据。删除购物车制定id 的商品也是循环数组,这个值,使用unset()来释放这个值。
具体的实现代码:
—————————————————————————————————————————–

 代码如下 复制代码
<?php
session_start();
if($_SESSION[‘carts’]==””){
$carts=array();
array_push($carts, “0-0″);
$_SESSION[‘carts’]=$carts;
}
$method=$_GET[‘method’];
if($method==”add”){
$productId=$_GET[‘productid’];
$number=$_GET[‘number’];
$carts=$_SESSION[‘carts’];
$flag=”false”;
for($i=0;$i<sizeof($carts);$i++){
$pn=$carts[$i];
$pns=split(“-”, $pn);
if($pns[0]==$productId){
$carts[$i]=$productId.”-”.$number;
$flag=”true”;
$location=$i;
}
}
if($flag==”true”){
$carts[$location]=$productId.”-”.$number;
}else{
array_push($carts, $productId.”-”.$number);
}
$_SESSION[‘carts’]=$carts;
}
if($method==”delete”){
$productId=$_GET[‘productid’];
$carts=$_SESSION[‘carts’];
for($i=0;$i<sizeof($carts);$i++){
$pn=$carts[$i];
$pns=split(“-”, $pn);
if($pns[0]==$productId){
unset($carts[$i]);
}
}
$_SESSION[‘carts’]=$carts;
}
?>
———————————————————————————————————–
php实现购物车程序代码

上面电子商务课程的时候做的一个简单的程序了,就是一个在线购物,不过还是90多分的哦!~ 其实只要是这种类似的程序,都是简单的增删改查系统,无非就是就对数据库的操作,我们要做的就是很好的实现这个业务逻辑,以及能很好的设计相关的字段来控制,比如是商品的状态的控制,是上线还是下线,还是推荐的。
现在看看连接数据库的代码吧!~
数据库配置代码,其实这个可以在xml配置文件里面设置:

 代码如下 复制代码
class DbConfig{
var $databaseAddress=”180.153.178.89″;
var $dataBaseUser=”pantingwen”;
var $databasePassword=”753116″;
var $database=”sqlpantingwen”;
/**
* @return the $databaseAddress
*/
public function getDatabaseAddress() {
return $this->databaseAddress;
}
/**
* @return the $dataBaseUser
*/
public function getDataBaseUser() {
return $this->dataBaseUser;
}
/**
* @return the $databasePassword
*/
public function getDatabasePassword() {
return $this->databasePassword;
}
/**
* @return the $database
*/
public function getDatabase() {
return $this->database;
}
/**
* @param field_type $databaseAddress
*/
public function setDatabaseAddress($databaseAddress) {
$this->databaseAddress = $databaseAddress;
}
/**
* @param field_type $dataBaseUser
*/
public function setDataBaseUser($dataBaseUser) {
$this->dataBaseUser = $dataBaseUser;
}
/**
* @param field_type $databasePassword
*/
public function setDatabasePassword($databasePassword) {
$this->databasePassword = $databasePassword;
}
/**
* @param field_type $database
*/
public function setDatabase($database) {
$this->database = $database;
}
}
?>
数据库连接代码:
include_once ‘DbConfig.php’;
define(“conn”, getcon());
function getcon(){
$dbConfig=new DbConfig();
$con=mysql_connect($dbConfig->getDatabaseAddress(),$dbConfig->getDataBaseUser(),$dbConfig->getDatabasePassword());
return $con;
}
/**
* 选择一款数据库
* Enter description here …
*/
function _select_db(){
$dbConfig=new DbConfig();
if(!mysql_select_db($dbConfig->getDatabase())){
exit(‘找不到指定的数据库’);
}
}
/**
* 设置字符集
* Enter description here …
*/
function _set_names(){
if(!mysql_query(‘set names utf8′)){
exit(‘字符集错误’);
}
}
function _query($_sql){
_select_db();
_set_names();
if(!$result=mysql_query($_sql,conn)){
echo mysql_error();
}
return $result;
}
/**
* 只能是获取一个数据组
* Enter description here …
* @param unknown_type $_sql
*/
function _fetch_array($_sql){
return mysql_fetch_array(_query($_sql),MYSQL_ASSOC);
}
/**
* 返回数据组
* Enter description here …
* @param unknown_type $_sql
*/
function _fetch_array_list($_result){
return mysql_fetch_array($_result,MYSQL_ASSOC);
}
/**
* 影响到到的记录数
* Enter description here …
*/
function _affect_rows(){
return mysql_affected_rows();
}
/**
* 判断是不是存在数据
* Enter description here …
* @param unknown_type $_sql
* @param unknown_type $_info
*/
function _is_repeat($_sql,$_info){
if(_fetch_array($_sql)){
}
}
function _close(){
if(!mysql_close(_conn)){
exit(‘关闭异常’);
}
}
?>

效果截图:php实现购物车程序代码

unlink在php中是删除文件如果单文件删除我们直接使用unlink就可以了,如果是目录中的删除我们需要遍历目录进入递归操作删除了,下面来看一个例子。

在学习本方法之前我们最rmdir();函数,这个函数就是根据指定的文件路劲,删除文件或者是文件夹,但是当删除的是文件夹,并且文件夹里面还有内容的时候,就会出现Directory not empty 的错误,这个怎么来解决呢,现在我们就通过编写一个函数来解决这个问题。

在本实例中使用到了php中比较重要的几个文件操作的函数,
1.opendir:如果该函数成功运行,将返回一组目录流(一组目录字符串),如果失败将返回错误[error]。你可以在函数的最前面加上“@”来隐藏错误。
2.readdir:从目录留里面里面的返回的结果是,首先是一个.(表示这个目录,进入目录开始读取),返回..(表示已经在目录中,正在读取目录中的文件)   然后返回文件或者文件夹的名字,如果没有则返回false
3.closedir:关闭目录流
完整代码:

 代码如下 复制代码
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<title>Insert title here</title>
</head>
<body>
<?php
function delDirAndFile($dirName,$flag) {
if (@$handle = opendir ( “$dirName” )) {
//如果该函数成功运行,将返回一组目录流(一组目录字符串),如果失败将返回错误[error]。你可以在函数的最前面加上“@”来隐藏错误。
while ( false!==($item = readdir($handle))) {
//从目录留里面里面的返回的结果是,首先是一个.(表示这个目录,进入目录开始读取),返回..(表示已经在目录中,正在读取目录中的文件)
//然后返回文件或者文件夹的名字,如果没有则返回false
if ($item!= “.” && $item != “..”) {
//这里是当有文件或者是文件夹的时候开始做出判断
if (is_dir(“$dirName/$item” )) {
//如果是文件夹,递归都用
delDirAndFile(“$dirName/$item”);
} else {
//否则就删除文件
if (unlink ( “$dirName/$item” ))
//判断文件是不是删除成功了
echo “删除文件 $dirName/$itemn”;
}
}
}
closedir ($handle );//关闭文件目录流
if($flag==true){
if (rmdir($dirName ))
echo ‘目录以及文件删除成功’;//最后删除输入的文件夹
}
}
}
?>

<?php
delDirAndFile(“dd”,false);
?>
</body>
</html>

代码的基本介绍在代码中都有说明,现在我们来看看测试的结果:
执行前的文件结构目录php中删除文件夹以及文件夹中的文件程序代码
执行时页面显示结果:php中删除文件夹以及文件夹中的文件程序代码
执行之后的问价目录结构:php中删除文件夹以及文件夹中的文件程序代码

日历程序代码我们一般会使用一些js插件来实现了,但是像博客这种日志分类我们会使用php程序来实现,下面一聚教程小编就来为你介绍一下吧。

PHP日历程序,功能都是大众化的,可以下拉切换年月,上一年下一月下一年上一月,太另类的没去写,主要的写出来了,扩展起来就方便多了,标题为什么要叫精美呢,是因自已感觉界面还过得去,哈哈,让大家见笑了,不足之处还请指出。

效果代码如下

简单实用PHP日历程序代码

php日历核心代码

 代码如下 复制代码
<?php
//日历类
class calendar {
//当前的年
private $year;
//当前的月
private $month;
//一个月中第一天是星期几
private $start_weekday;
//当前月的天数
private $days;
//最大数与最小年数,最大与最小月数
private $yearMonth = array(2080, 1900, 12, 1);
//构造函数
function __construct() {
if (isset($_GET[‘year’])) {
$this->year = $_GET[‘year’];
}
if (isset($_GET[‘month’])) {
$this->month = $_GET[‘month’];
}
$this->pnYm($this->year, $this->month);
$this->days = date(‘t’, mktime(0, 0, 0, $this->month, 1, $this->year));
$this->start_weekday = date(‘w’, mktime(0, 0, 0, $this->month, 1, $this->year));
$this->style();
}
//输出
private function style() {
echo ‘<table id=”calendar”>’;
$this->weeklist();
$this->daylist();
echo ‘<table>’;
}
//年月参数判断
private function ymCheck($year, $month) {
if (!is_numeric($year)) {
$year = date(‘Y’);
}
if (!is_numeric($month)) {
$month = date(‘m’);
}
if ($month < $this->yearMonth[3]) {
$month = $this->yearMonth[2];
$year -= 1;
}
if ($month > $this->yearMonth[2]) {
$month = $this->yearMonth[3];
$year = intval($year) + 1;
}
$year = $year < $this->yearMonth[1] ? $this->yearMonth[1] : $year;
$year = $year > $this->yearMonth[0] ? $this->yearMonth[0] : $year;
return array($year, $month);
}
//上一年、下一年、上一月、下一月
private function pnYm($year, $month) {
$ym = $this->ymCheck($year, $month);
$this->year = $ym[0];
$this->month = $ym[1];
}
//weeklist周列表
private function weeklist() {
$week = array(‘日’,’一’,’二’,’三’,’四’,’五’,’六’);
echo ‘<tr>’;
foreach ($week as $val) {
echo ‘<th>’.$val.'</th>’;
}
echo ‘</tr>’;
}
//daylist天列表
private function daylist() {
//年月日导航
echo ‘<tr>’;
echo ‘<td><a title=”上一年” href=”?year=’.($this->year-1).’&month=’.$this->month.’”><<</a></td>’;
echo ‘<td><a title=”上一月” href=”?year=’.$this->year.’&month=’.($this->month-1).’”><</a></td>’;
echo ‘<td colspan=”3″>’;
echo ‘<form action=”?” method=”get” id=”form”>’;
echo ‘<select name=”year” onchange=”formaction()”>’;
for ($i = $this->yearMonth[1]; $i <= $this->yearMonth[0]; $i++) {
if ($i == $this->year) {
echo ‘<option value=”’.$i.’” selected=”selected”>’.$i.’年</option>’;
}else {
echo ‘<option value=”’.$i.’”>’.$i.’年</option>’;
}
}
echo ‘</select>’;
echo ‘<select name=”month” onchange=”formaction()”>’;
for ($i = $this->yearMonth[3]; $i <= $this->yearMonth[2]; $i++) {
if ($i == $this->month) {
echo ‘<option value=”’.$i.’” selected=”selected”>’.$i.’月</option>’;
}else {
echo ‘<option value=”’.$i.’”>’.$i.’月</option>’;
}
}
echo ‘</select></form></td>’;
echo ‘<td><a title=”下一月” href=”?year=’.$this->year.’&month=’.($this->month+1).’”>></a></td>’;
echo ‘<td><a title=”下一年” href=”?year=’.($this->year+1).’&month=’.$this->month.’”>>></a></td>’;
echo ‘</tr>’;

echo ‘<tr>’;
//输出空格(当前一个月第一天前面要空出来的)
for($i = 0; $i < $this->start_weekday; $i++) {
echo ‘<td>&nbsp;</td>’;
}
for ($k = 1; $k <= $this->days; $k++) {
$i++;
if ($k == date(‘d’)) {
echo ‘<td>’.$k.'</td>’;
}else {
echo ‘<td>’.$k.'</td>’;
}
if ($i % 7 == 0) {
if ($k != $this->days) {
echo ‘</tr><tr>’;
}
}
}
echo ‘</tr>’;
}
}
?>

html+css代码

 代码如下 复制代码
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>PHP日历程序</title>
<style>
#calendar { width:auto; margin:0 auto; margin-top:100px; border:0; border-collapse:collapse; box-shadow:0px 0px 4px #ddd; font-size:12px; text-align:center; font-family:”微软雅黑”; color:#333; border:solid 1px #c5e2ff; }
#calendar tr { width:auto; height:34px; line-height:34px; }
#calendar tr th { width:44px; background:#c5e2ff; }
#calendar tr td { background:#fff; }
#calendar tr td.tdbg { background:#c5e2ff; }
#calendar tr td:hover { background:#FFC; }
#calendar tr td a { text-decoration:none; color:#f50; font-weight:900; }
#calendar select { width:auto; border:solid 1px #c5c5c5; padding:2px 0 2px 0; background:#fff; float:left; margin-left:5px; }
</style>
<script>
function formaction() {
var form = document.getElementById(‘form’);
form.submit();
}
</script>
</head>
<body>
<?php
require ‘init.php’;
$calendar = new calendar();
?>
</body>
</html>

curl来抓取网页内容是一个性能比较好的函数了,我们通常会使用它来快速模仿用户去访问我们要抓取的网页了,下面看一个例子有兴趣的朋友可进入参考。

早上想写了一个抓取是京东618魅族专题页的抓取,然后想着自动下单购买,尼玛,算了,太多了,写到判断是否开始了,商品价格进行了变化,后边工程量有点大就懒的写了,如果要完善的话就需要写模拟登陆(这个不难)加入购物车,下单,下单的时候判断一下价格,如果价格个官方优惠价格相同就下单,不同就接着去抓。算了,懒的写了。下边是部分代码

 代码如下 复制代码
<?php
$cookie_file = dirname(__FILE__).”/jd.cookie”;
//专题首页url
$indexurl = ‘http://sale.jd.com/act/BOxFsKPGNZwpet4.html’;
//获取专题页到产品详情的地址
$indexstr = get($indexurl);
//var_dump($indexstr);exit;
preg_match_all(‘/<area shape=”rect” coords=”802,199,941,244″ href=”(.*?)”/is’,$indexstr,$data);

$tmp = pathinfo($data[1][0]);
$pinfo[‘id’] = $tmp[‘filename’];
$pinfo[‘url’] = $data[1][0];
unset($tmp,$data);
$pinfo = getPrice($pinfo[‘id’]);
if($pinfo[‘mainproduct’][‘price’] == 1799){
addcar();
}else{
echo “还没有开始抢购”;
}

function get($url,$flag=true){
global $cookie_file;
$headerArray = array(
“content-type: application/x-www-form-urlencoded;charset=UTF-8”,

);
//echo $cookie_file;exit;
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_USERAGENT,’”Mozilla/5.0 (Windows NT 6.1; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0″’);
curl_setopt($ch,CURLOPT_HTTPHEADER,$headerArray);//设置头信息
curl_setopt($ch,CURLOPT_COOKIEFILE,$cookie_file);
curl_setopt($ch,CURLOPT_COOKIEJAR,$cookie_file);

$return = curl_exec($ch);
curl_close($ch);
if($flag)$return = gzdecode($return);
return $return;
}

function getPrice($id){
$priceUrl = “http://rs.jd.com/accessorie/newServiceWhite.jsonp?sku=”.$id;

$data = json_decode(get($priceUrl,false),true);
return $data;
}
function addcar(){
global $pinfo;
$addurl = “http://gate.jd.com/InitCart.aspx?pid=”.$pinfo[‘mainproduct’][‘sku’].”&pcount=1&ptype=1″;

echo get($addurl,false);
}

php 在curl抓取的时候出现乱码

用站长工具查看我们抓取的网而不是使用了gzip压缩了,如果有返回”Accept-Encoding:gzip, deflate” 就是打开了gzip了,我们只要如下操作

 代码如下 复制代码
$res=curl_exec($ch1);
if(!empty($res)){ //save capcha
echo gzdecode($res);
}

GBK或者UTF8汉字之类的乱码

 代码如下 复制代码
mb_convert_encoding($str, ‘utf-8′, ‘GBK,UTF-8,ASCII’);就行了

我们设置页面为GBK兼容GB2312,GB2312是GBK的子集,所有GB2312编码的用GBK都能正确解出来