content = file_get_contents("C:/system.stmp");  list($authorized,$times)=explode("/",$content); // echo $authorized;
  //echo $times;
  if($authorized=="8a0e6cbd1d6c7deeac875a6774bddb11"){
       // echo "你好";
       // $nowdate=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"));        $nowdate=date("Y-m-d");        if(strtotime("$times+30   day") >= $nowdate)
        {
            //header('Location: error.php');            echo "试用期已过!";
            echo $nowdate.$times;
        }
        else
        {
             echo "试用期没过!";
             echo $nowdate.$times;
         //header('Location: index.php');
        }
  }system.stmp  里面的东西是:8a0e6cbd1d6c7deeac875a6774bddb11/2010-03-28
上面那个判断不对啊   如果时间相等的话 还是会显示 "试用期已过

解决方案 »

  1.   

    strtotime("$times+30 day") 返回的是timestamp
    $nowdate=date("Y-m-d");  是“2010-01-01”这种形式
    你直接比较这2个大小
      

  2.   

    list($authorized,$times)=explode("/", trim($content));
    if($authorized == "8a0e6cbd1d6c7deeac875a6774bddb11") {
      if(date('Y-m-d', strtotime("$times +30 day")) >= date('Y-m-d')) {
        echo "试用期已过!";
      }
    }
      

  3.   

    $nowdate=time();  if(strtotime("$times")+30*24*3600 >= $nowdate)
    {
    //header('Location: error.php');echo "试用期已过!";
    echo $nowdate.$times;
      

  4.   

    或者你只改这个$nowdate=time();也可以
      

  5.   

    if(date("Y-m-d",strtotime("$times +30 day")) >= $nowdate)
      

  6.   

    content = file_get_contents("C:/system.stmp");
    应该是
    $content = file_get_contents("C:/system.stmp");
      

  7.   

    if(strtotime("$times+30 day") >= time())
      

  8.   

    if($_POST['submit']){
      $content = file_get_contents("C:/system.stmp");  list($authorized,$times)=explode("/",$content); $date1=strtotime('+30 day');    $dates=$date1+$times;
      if($authorized=="8a0e6cbd1d6c7deeac875a6774bddb11"){      //if(strtotime("$times+30 day") >= time())
           if($dates-time()>=$date1)
            {
                //echo strtotime("+30 day")."<br>";
                echo "试用期已过!"."<br>";        }
            else
            {
             //echo strtotime("+30 day")."<br>".time()."<br>";
                  // echo $dates."..........";
                  echo "试用期没过!"."<br>";              //echo $dates-time();        }
      }}
    还是不对啊 挺郁闷的啊  
      

  9.   

    有那么纠结么<?php 
    $content = "8a0e6cbd1d6c7deeac875a6774bddb11/2010-03-28";
    list($authorized,$times)=explode("/",$content);
    $nowdate=date("Y-m-d");
    if($authorized=="8a0e6cbd1d6c7deeac875a6774bddb11"){
        if(date("Y-m-d",strtotime("$times +32 day")) >= $nowdate){
            echo "试用期已过!"."<br>";
        }else{
            echo "试用期没过!"."<br>";
        }
    }
    ?>
      

  10.   

      $content = file_get_contents("install/data/system.stmp");
      list($authorized,$times)=explode("/",$content);  if($authorized=="8a0e6cbd1d6c7deeac875a6774bddb11"){
    $news = (((time() - $times)/60)/60)/24;
    if($news>=30)
    {
    header('Location: error.php');
    }
    else
    {
    header('Location: main.php');
    }
      }已经搞定了啊 谢谢