個人web框架

個人web框架php

==========================================================css

前端:css(bootstrap,本身的代碼片斷),js(jquery,本身的代碼片斷),html,交互設計。html

後端:php(數據庫配置,數據操做,具體頁面邏輯,控制器),smarty(smarty引用,實例化等都放到一個文件中,參考其餘用smarty寫的網站),mysql(經常使用的數據庫操做語句)。
工具:服務器php環境(擅長),用WAMP集成環境,sublime編輯器(用svn,emmet等插件),git和svn版本控制(在本身的網站中沒有用到,由於須要在服務器端配置環境),photoshop,虛擬機和IETester以及其餘瀏覽器,FlashFXP(ftp管理工具)。
==========================================================
 
個人css代碼片斷:
 
個人js代碼片斷:
 
php代碼片斷:
 
smarty代碼片斷:
配置:
1 <?php
 2 
 3     //建立smarty對象
 4     require_once './libs/Smarty.class.php';
 5 
 6     $smarty = new Smarty;//創建smarty實例對象$smarty
 7     $smarty -> caching = false;//是否使用緩存
 8     $smarty -> template_dir = "./templates";//設置模板目錄
 9     $smarty -> compile_dir = "./templates_c";//設置編譯目錄
10     $smarty -> cache_dir = "./smarty_cache";//緩存文件夾
11     //修改左右邊界符號
12     $smarty -> left_delimiter="<{";
13     $smarty -> right_delimiter="}>";
14 
15     $smarty -> assign("var1","hello world");//
16     $smarty -> display("hello.tpl");//
17     
18 ?>
View Code

smarty模板操做變量:前端

http://www.cnblogs.com/snowinmay/p/3170092.htmlmysql

smarty模板的內置函數:jquery

 
mysql代碼片斷:
 1 建立數據庫:
 2 create database books;
 3 建立用戶:
 4 mysql> grant select,insert,delete,uptate
 5     -> on books.*
 6     -> to dada identified by 'yujianqi2011';
 7  
 8 使用數據庫:
 9 use dbname;
10 use dada;
11  
12 新建數據庫表
13 create table tablename(columns);
14 create table demo(
15      userid int unsigned not null auto_increment primary key,
16      username char(50) not null,
17      password char(20) not null,
18      age int not null,
19      city char(20) not null     
20 );
21  
22 顯示數據庫表
23 show tables;
24  
25 在數據庫中插入數據
26 insert into demo values(NULL,"dada","yujianqi2011",27,"beijing");
27 insert into demo values(NULL,"xiaoyin","yujianqi2011",26,"shanghai");
28  
29 查詢數據
30 select name, city from customers where name="dada";
31  
32 更新數據
33 update customers 
34 set address =  "北京市海淀區";
35  
36 刪除數據
37 delete from dada where name = "dada";
38  
39 表的刪除
40 DROP TABLE table;
41  
42 數據刪除
43 DROP DATABASE database;
View Code

 

 
==========================================================
 
參考學習的網站:
 
============================
bootstrap網站連接: http://www.bootcss.com/
 
 
 
 
==============================
 
web代碼分佈:
 
相關文章
相關標籤/搜索