Home > Backend Development > PHP Tutorial > The Tenth Day of PHP Practice_PHP Tutorial

The Tenth Day of PHP Practice_PHP Tutorial

WBOY
Release: 2016-07-14 10:11:08
Original
870 people have browsed it

今天算是把瀑布流留言板前台后台做完了.先上图欣赏下吧.

 

 

The Tenth Day of PHP Practice_PHP Tutorial

The Tenth Day of PHP Practice_PHP Tutorial

The Tenth Day of PHP Practice_PHP Tutorial

The Tenth Day of PHP Practice_PHP Tutorial

 

 

 

 

 


今天学习到的东西

serialize()串行化

unserialize()反串行化

由这两函数,编写出了 config_set() 和 config_get() 两函数.


[php]
/**
* 用于写出数组配置
*/ 
function config_set($fileName,$arr_var){ 
    file_put_contents($fileName, serialize($arr_var)); 

/**
* 用于读出配置,返回值为设置出去的数组
*/ 
function config_get($fileName){ 
    if(file_exists($fileName)){ 
        return unserialize(file_get_contents($fileName)); 
    } 

 /**
 * 用于写出数组配置
 */
 function config_set($fileName,$arr_var){
  file_put_contents($fileName, serialize($arr_var));
 }
 /**
 * 用于读出配置,返回值为设置出去的数组
 */
 function config_get($fileName){
  if(file_exists($fileName)){
   return unserialize(file_get_contents($fileName));
  }
 }调用方法


[php]
$config = array( 
    'title' => '瀑布流留言板', 
    "b"=>'aaaa' 
    ); 
 
config_set("data.php",$config); 
 
 
$config=config_get('data.php'); 
 
var_dump($config); 

 $config = array(
  'title' => '瀑布流留言板',
  "b"=>'aaaa'
  );

 config_set("data.php",$config);
 

 $config=config_get('data.php');

 var_dump($config);
2.jquery选择器中'[]'的使用方法,和 removedClass 移除样式, addClass 添加样式,利用这个可以轻松做出高亮效果

var focus_li = $("#menu li[class!=nav-header]");
focus_li.click(function() {

focus_li.removeClass("active"); //把所有高亮样式去掉
$(this).addClass("active"); //给被点击的添加高亮样式

 

3.关于session,unset($_sesstion),这是清除不了的.要使用 session_unset()

 


4.前台的留言表单重新编写chrome浏览器效果好,IE的话特效少,不太漂亮


[html]

 
   
 
         
       
 
             
       
 
   
 
 
   
 
         
       
 
             
                 
            联系方式 
               
             
                  
             
 
       
 
   
 
 
 

  


   

    
    

     
    

   

   


    
    

     
        
     联系方式
      
     
         
     

    


   

  


5.后台的下拉按钮,很漂亮噢.哈


[html]

 
       
 
         
           
       
 
 

     


             

             
               
             

     

 

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/477377.htmlTechArticle今天算是把瀑布流留言板前台后台做完了.先上图欣赏下吧. 今天学习到的东西 serialize()串行化 unserialize()反串行化 由这两函数,编写出了 c...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template