偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

PHP hack的使用技巧詳解

開發(fā) 后端
對于初學(xué)者來說,PHP hack的使用是一個比較復(fù)雜,難以掌握的知識點。下面我們將以一段代碼示例來具體講解PHP hack的使用技巧。

PHP hack的使用方法是一個比較麻煩的過程。我們在這里給出的代碼示例,希望能夠作為大家在開發(fā)中的參考學(xué)習(xí)對象。這次講的是使用PHP hack實現(xiàn)類似TAB VIEW的效果哦,的確麻煩些。#t#

PHP hack示例:

 

  1. < ?php  
  2. $tabs = array();  
  3. function tabs_header()  
  4. {  
  5. ?> 
  6. <style type="text/css"> 
  7. .tab {  
  8. border-bottom: 1px solid black;  
  9. text-align: center;  
  10. font-family: arial, verdana;  
  11. }  
  12. .tab-active {   
  13. border-left: 1px solid black;   
  14. border-top: 1px solid black;   
  15. border-right: 1px solid black;   
  16. text-align: center;   
  17. font-family: arial, verdana;   
  18. font-weight: bold;  
  19. }  
  20. .tab-content {   
  21. padding: 5px;   
  22. border-left: 1px solid black;   
  23. border-right: 1px solid black;   
  24. border-bottom: 1px solid black;  
  25. }   
  26. < /style>  

 

  1. <?php 
  2. }  
  3. function tabs_start()  
  4. {   
  5. ob_start();   
  6. }  
  7. function endtab()   
  8. {   
  9. global $tabs;  
  10. $text = ob_get_clean();  
  11. $tabs[ count( $tabs ) - 1 ][ 'text' ] = $text;  
  12. ob_start();  
  13. }  
  14. function tab( $title )   
  15. {  
  16. global $tabs;  
  17. if ( count( $tabs ) > 0 )  
  18. endtab();  
  19. $tabs []= array(  
  20. title => $title,  
  21. text => ""  
  22. );  
  23. }  
  24.  
  25. function tabs_end( )  
  26. {  
  27. global $tabs;  
  28. endtab( );  
  29. ob_end_clean( );  
  30. $index = 0;  
  31. if ( $_GET['tabindex'] )  
  32. $index = $_GET['tabindex'];  
  33. ?> 
  34. < table width="100%" cellspacing="0" cellpadding="0"> 
  35. < tr> 
  36. < ?php  
  37. $baseuri = $_SERVER['REQUEST_URI'];  
  38. $baseuri = preg_replace( "/\?.*$/", "", $baseuri );  
  39. $curindex = 0;  
  40. foreach( $tabs as $tab )  
  41. {  
  42. $class = "tab";  
  43. if ( $index == $curindex )  
  44. $class ="tab-active";  
  45. ?> 
  46. < td class="< ?php echo($class); ?>"> 
  47. < a href="< ?php echo( $baseuri."?tabindex=".$curindex ); ?>"> 
  48. < ?php echo( $tab['title'] ); ?> 
  49. < /a> 
  50. < /td> 
  51. < ?php  
  52. $curindex += 1;  
  53. }  
  54. ?> 
  55. < /tr> 
  56. < tr>< td class="tab-content" colspan="< ?php echo( count( $tabs ) + 1 ); ?>"> 
  57. < ?php echo( $tabs[$index ]['text'] ); ?> 
  58. < /td></tr> 
  59. < /table> 
  60. < ?php  
  61. }  
  62. ?> 

 

以上這一大段的代碼就是有關(guān)PHP hack的具體實現(xiàn)方法。
 

責(zé)任編輯:曹凱 來源: 博客園
相關(guān)推薦

2014-11-03 10:14:22

2009-12-07 10:54:46

PHP uploade

2009-12-02 13:53:12

PHP使用技巧

2009-09-04 10:45:18

MyEclipse使用

2023-02-03 08:21:55

2009-11-25 17:28:26

PHP對話

2009-11-30 09:21:39

PHP函數(shù)rmdir(

2009-12-07 16:59:53

PHP匹配顏色函數(shù)

2009-11-23 18:47:51

PHP中用header

2009-12-01 19:23:22

PHP緩存技術(shù)

2009-12-01 10:50:45

PHP函數(shù)requir

2009-12-02 16:04:44

PHP fsockop

2009-08-17 08:42:48

LinuxScreen命令使用技巧

2023-02-01 08:22:37

2009-12-04 15:43:03

PHP JSON擴(kuò)展

2009-11-27 09:30:58

PHP函數(shù)mb_str

2009-11-30 17:43:54

PHP split()

2009-12-01 14:26:19

PHP函數(shù)ob_sta

2022-12-22 07:40:28

2009-12-07 14:29:08

PHP array_w
點贊
收藏

51CTO技術(shù)棧公眾號