http怎么做自动跳转https?

使用.htacces文件配http自动跳转https

在网站配置SSL证书后,启用https访问的时候需要配置 http自动跳转https 方法,这里建议修改.htacces文件

在网站跟目录下创建  .htacces  文件。

修改文件内容为:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R,L]
#RewriteRule ^(.*)$ https://www.你的域名.com/$1 [R,L]

阅读详细 »

Fiddler实现手机抓包

手机用fiddler抓包

电脑最好是笔记本,这样能和手机保持统一局域网内;其他不多说,直接说步骤了。

一.对PC(笔记本)参数进行配置

   1. 配置fiddler允许监听到https(fiddler默认只抓取http格式的)

         打开Fiddler菜单项Tools->TelerikFiddler Options->HTTPS

         勾选CaptureHTTPS CONNECTs,点击Actions,

         勾选Decrypt HTTPS trafficIgnore servercertificate errors两项,点击OK(首次点击会弹出是否信任fiddler证书和安全提示,直接点击yes就行),见图:

阅读详细 »

全局事件ajaxStart、ajaxStop不执行

最近一直都在研究【锋利的jQuery】,确实是一本好书,受益匪浅。但由于技术发展及版本更新等原因,里面还是有些坑需要踩的。

比如:第六章七节中提到的全局事件ajaxStart、ajaxStop照着案例敲结果并不会执行。

在查阅资料后,发现原来在jquery1.9+版本以后,ajax全局事件需绑定到document对象上才能触发。

下面是各版本不同写法: 阅读详细 »

Ztree自动触发第一个节点的点击事件

重点在这

setting.callback.onClick(null, roletree.setting.treeId, node);

阅读详细 »

mysql 多表关联删除 MySQL跨表关联删除 MySQL根据查询条件删除多表数据

两张表关联删除:

DELETE a,b FROM table1 a
INNER JOIN  table2 b
ON a.id = b.aid
WHERE a.id = '1'
//或者也可以
DELETE a,b FROM table1 a,table2 b
WHERE a.id = b.aid
AND a.id = '1'
 阅读详细 »

MySQL触发器使用详解

MySQL包含对触发器的支持。触发器是一种与表操作有关的数据库对象,当触发器所在表上出现指定事件时,将调用该对象,即表的操作事件触发表上的触发器的执行。

创建触发器
在MySQL中,创建触发器语法如下:

代码如下:


CREATE TRIGGER trigger_name
trigger_time
trigger_event ON tbl_name
FOR EACH ROW
trigger_stmt

阅读详细 »

thinphp5 用input()方法接受 get/post数组 报错问题

症状:

<form>
<input name="id[]" value="1"/>
    <input name="id[]" value="2"/>
    <input name="id[]" value="3"/>
    <input name="id[]" value="4"/>
<button type="submit">提交</button>
</form>

如上表单,提交的id PHP再用 $_POST[‘id’] 接收后,会得到一个数组。

再用tp5 的   input(‘id’); 接受的时候,会报错。

后来参看手册后,发现tp5  使用 input(‘id/a‘) ; 可解决。 阅读详细 »

php环境wamp2.5下载地址

php环境wamp2.5下载地址

https://sourceforge.net/projects/wampserver/files/WampServer%202/Wampserver%202.5/

WampServer 2.5 – 32 and 64 bits

Be sure that you have installed Visual C++ Redistributable for Visual Studio 2012 : VC11 vcredist_x64/86.exe
http://www.microsoft.com/en-us/download/details.aspx?id=30679

Don’t Use previous WampServer Extensions/Addons. 
There are no more compatible with the new wampserver version’s (VC11)

Apache     : 2.4.9
MySQL      : 5.6.17
PHP        : 5.5.12
PHPMyAdmin : 4.1.14
SqlBuddy   : 1.3.3
XDebug     : 2.2.5

Source: readme.txt, updated 2014-05-01

通过php下载文件并重命名

通过php下载文件并重命名

$filename = dirname(__FILE__) . '/oldfilename.jpg';
$out_filename = 'newfilename.jpg';
if( ! file_exists($filename)){
  echo 'Not Found' . $filename;
  exit;
} else {
  // We'll be outputting a file
  header('Accept-Ranges: bytes');
  header('Accept-Length: ' . filesize($filename));
  // It will be called
  header('Content-Transfer-Encoding: binary');
  header('Content-type: application/octet-stream');
  header('Content-Disposition: attachment; filename=' . $out_filename);
  header('Content-Type: application/octet-stream; name=' . $out_filename);
  // The source is in filename
   if(is_file($filename) && is_readable($filename)){
    $file = fopen($filename, "r");
    echo fread($file, filesize($filename));
    fclose($file);
   }
  exit;
}

css+jq固定标题表格table

css+jq固定标题表格table

阅读详细 »

Windows服务器代理软件_ccproxy8.0_(带注册机)

Windows服务器代理软件_ccproxy8.0_(带注册机)

在windows服务上安装的代理软件,支持http代理,secure代理,ftp(web)代理,Gopher代理,socks代理,ftp代理,telent代理等

使用方法参考:http://www.jb51.net/softjc/528239.html

链接: https://pan.baidu.com/s/1slfY9it 密码: z3eq

谷歌代理插件——Proxy-SwitchyOmega_v2.5.2.crx

百度网盘:

链接: https://pan.baidu.com/s/1eS91fhw 密码: 55q9

mysql结果集加序号问题?

mysql结果集加序号问题?
如何在mysql查询后的结果集前加序列,类似oracle的rownum?

首先给出解决方案:
–通过一个初始值为0的变量@rownum,依次递增1来实现行号

SELECT
    @rownum:=@rownum+1 AS rownum,name
FROM temp,
    (SELECT @rownum:=0) temp
WHERE @rownum<4;

给出一般性的语句:

SELECT
    @rownum:=@rownum+1 AS rownum,所需字段
FROM 表名,
    (SELECT @rownum:=0) 表名
WHERE @rownum<N(获取多少行);

然后给出测试案例:
第一步,创建测试表;

mysql> CREATE TABLE temp(id INT(4),name VARCHAR(20));
Query OK, 0 rows affected (0.13 sec)

第二步,插入测试数据;

mysql> INSERT INTO temp VAlUES(1,'robin');
Query OK, 1 row affected (0.10 sec)

mysql> INSERT INTO temp VAlUES(2,'wentasy');
Query OK, 1 row affected (0.05 sec)

mysql> INSERT INTO temp VAlUES(3,'justdb');
Query OK, 1 row affected (0.08 sec)

mysql> INSERT INTO temp VAlUES(4,'wen');
Query OK, 1 row affected (0.08 sec)

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 4 rows affected (0.03 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 8 rows affected (0.02 sec)
Records: 8  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 16 rows affected (0.02 sec)
Records: 16  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 32 rows affected (0.03 sec)
Records: 32  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 64 rows affected (0.04 sec)
Records: 64  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 128 rows affected (0.03 sec)
Records: 128  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 256 rows affected (0.04 sec)
Records: 256  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 512 rows affected (0.05 sec)
Records: 512  Duplicates: 0  Warnings: 0

mysql> INSERT INTO temp SELECT * FROM temp;
Query OK, 1024 rows affected (0.05 sec)
Records: 1024  Duplicates: 0  Warnings: 0

第三步,实现类似Oracle中的rownum效果;
mysql> SELECT
    ->     @rownum:=@rownum+1 AS rownum,name
    -> FROM temp,
    ->     (SELECT @rownum:=0) temp
    -> WHERE @rownum<4;
+--------+---------+
| rownum | name    |
+--------+---------+
|      1 | robin   |
|      2 | wentasy |
|      3 | justdb  |
|      4 | wen     |
+--------+---------+
4 rows in set (0.01 sec)

MySQL 设置数据按条件查询下的序号

ALTER TABLE mytable ADD forder INT DEFAULT 0;

UPDATE mytable r,(
    SELECT a.fid,(@rownum:=@rownum+1) AS forder
    FROM mytable a,(SELECT @rownum:=0) b
    ORDER BY ftype ASC,fnum ASC
) t
SET r.forder=t.forder
WHERE r.fid =t.fid

https://www.cnblogs.com/yjl49/archive/2012/08/21/2649582.html

mysql查询结果添加序列号的方法

第一种方法:
复制代码 代码如下:

select (@i:=@i+1) as i,table_name.* from table_name,(select @i:=0) as it

第二种方法:

set @rownum=0;
select @rownum:=@rownum+1 as rownum, t.username from auth_user t limit 1,5;

Apache用.htaccess来实现强制https访问

首先需要帮保证Apache已经开启了  模块

查找 httpd.conf 文件

找到

#LoadModule rewrite_module modules/mod_rewrite.so

去掉前边的#号 ,重启Apache服务器。

———————————-

然后是关于.htaccess文件的设置。

用Apache的.htaccess的重定向规则来实现http强制跳转到https访问网站。
重要提示:必须将代码放到.htaccess文件内容的最前面,以保证重定向优先权。

代码如下:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R,L]

或者

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L]

或者

RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

如果是在子目录,可以用
RewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.domain.com/subfolder [R,L]

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} subfolder
RewriteRule ^(.*)$ https://www.domain.com/subfolder [R,L]

将以上代码复制到.htaccess中即可。

商业模式画布是什么?

商业模式画布是会议和头脑风暴的工具,它通常由一面大黑板或干脆一面墙来呈现。这块板子按照一定的顺序被分成九个方格,方格的内容如下::
1)客户细分——你的目标用户群,一个或多个集合
2)价值主张——客户需要的产品或服务,商业上的痛点
3)渠道通路——你和客户如何产生联系,不管是你找到他们还是他们找到你,比如实体店、网店、中介
4)客户关系——客户接触到你的产品后,你们之间应建立怎样的关系,一锤子买卖抑或长期合作
5)收入来源——你将怎样从你提供的价值中取得收益
6)核心资源——为了提供并销售这些价值,你必须拥有的资源,如资金、技术、人才
7)关键业务——商业运作中必须要从事的具体业务
8)重要伙伴——哪些人或机构可以给予战略支持
9)成本结构——你需要在哪些项目付出成本

商业模式画布的优点在于让讨论商业模式的会议变得高效率、可执行,同时产生不止一套的方案,让每个决策者心中留下多种可能性。

css画梯形,css画五角星, css画六角星 ,css画六边形

css画梯形,css画五角星, css画六角星 ,css画六边形

css画梯形

<div class="triangle"></div>
<style>
.triangle {
    border-bottom: 100px solid #F36823;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;

    height: 0px;
    width: 100px;
}
</style>

css画五角星

<div class="triangle"></div>

<style>
.triangle{
    margin: 50px 0;
    position: relative;
    display: block;
    color: #F36823;
    width: 0px;
    height: 0px;
    border-right:  100px solid transparent;
    border-bottom: 70px  solid #F36823;
    border-left:   100px solid transparent;
    -moz-transform:    rotate(35deg);
    -webkit-transform: rotate(35deg);
    -ms-transform:     rotate(35deg);
    -o-transform:      rotate(35deg);
}
  
.triangle:before {
    border-bottom: 80px solid #F36823;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    position: absolute;
    height: 0;
    width: 0;
    top: -45px;
    left: -65px;
    display: block;
    content: '';
    -webkit-transform: rotate(-35deg);
    -moz-transform:    rotate(-35deg);
    -ms-transform:     rotate(-35deg);
    -o-transform:      rotate(-35deg);
}
  
.triangle:after {
    position: absolute;
    display: block;
    color: #F36823;
    top: 3px;
    left: -105px;
    width: 0px;
    height: 0px;
    border-right: 100px solid transparent;
    border-bottom: 70px solid #F36823;
    border-left: 100px solid transparent;
    -webkit-transform: rotate(-70deg);
    -moz-transform:    rotate(-70deg);
    -ms-transform:     rotate(-70deg);
    -o-transform:      rotate(-70deg);
    content: '';
}
</style>

css画六角星

<style>
.triangle{
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid red;
    position: relative;
}
  
.triangle:after{
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-top: 100px solid red;
    position: absolute;
    content: "";
    top: 30px;
    left: -50px;
}
</style>

css画六边形

<div class="triangle"></div>

<style>
.triangle{
    width: 100px;
    height: 55px;
    background: #F36823;
    position: relative;
}
  
.triangle:before {
    content: "";
    position: absolute;
    top: -25px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 25px solid #F36823;
}
  
.triangle:after {
    content: "";
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-top: 25px solid #F36823;
}
</style>

https://github.com/FineUploader/fine-uploader

Reset CSS

css Reset

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

/* ----------------Reset Css--------------------- */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video, input  {
    margin: 0;
    padding: 0;
    border: none;
    outline: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 {
    -webkit-text-size-adjust: none;
}

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
    display: block;
}

body {
    font-family: arial, sans-serif;
}

ol, ul {
    list-style: none;
}

blockquote, q {
    quotes: none;
}

blockquote:before, blockquote:after, q:before, q:after {
    content: '';
    content: none;
}

ins {
    text-decoration: none;
}

del {
    text-decoration: line-through;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

此段包含HTML5的CSS reset来自:http://html5reset.org/

/* 
html5doctor.com Reset Stylesheet
v1.4.1 
2010-03-01
Author: Richard Clark - http://richclarkdesign.com
*/

html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
    margin:0;
    padding:0;
    border:0;
    outline:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

body {
    line-height:1;
}

:focus {
outline: 1;
}

article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary { 
    display:block;
}

nav ul {
    list-style:none;
}

blockquote, q {
    quotes:none;
}

blockquote:before, blockquote:after,
q:before, q:after {
    content:'';
    content:none;
}

a {
    margin:0;
    padding:0;
    border:0;
    font-size:100%;
    vertical-align:baseline;
    background:transparent;
}

ins {
    background-color:#ff9;
    color:#000;
    text-decoration:none;
}

mark {
    background-color:#ff9;
    color:#000; 
    font-style:italic;
    font-weight:bold;
}

del {
    text-decoration: line-through;
}

abbr[title], dfn[title] {
    border-bottom:1px dotted #000;
    cursor:help;
}

table {
    border-collapse:collapse;
    border-spacing:0;
}

hr {
    display:block;
    height:1px;
    border:0;   
    border-top:1px solid #cccccc;
    margin:1em 0;
    padding:0;
}

input, select {
    vertical-align:middle;
}