<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8534926122732220139</id><updated>2024-09-12T04:43:06.022-07:00</updated><category term="php"/><category term="javascript"/><title type='text'>php網頁設計</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-9163294258459586148</id><published>2016-11-29T18:56:00.004-08:00</published><updated>2016-11-29T18:56:45.801-08:00</updated><title type='text'>php 透過ssh遠端操作其他server</title><content type='html'>&lt;span style=&quot;background-color: white; color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif; font-size: 12px;&quot;&gt;使用php進行ssh連線至遠端linux執行指令 (只要是開放ssh連線的server，皆可以用此模式下指令)&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;centos 6 安裝SSH2 extension for PHP&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://programster.blogspot.tw/2013/06/centos-64-install-ssh2-extension-for-php.html&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://programster.blogspot.tw/2013/06/centos-64-install-ssh2-extension-for-php.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;參考以下網址，複製其PHP SSH CONNECT，存成ssh2.php&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;http://nsysumis94.pixnet.net/blog/post/17328247-%E5%A6%82%E4%BD%95%E7%94%A8php%E5%81%9Assh%E9%80%A3%E7%B7%9A&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;使用ssh2 class套件 進行遠端下指令&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;&lt;code class=&quot;php syntaxhl&quot;&gt;&lt;span class=&quot;CodeRay&quot;&gt;&lt;span class=&quot;inline-delimiter&quot; style=&quot;color: #666666; font-weight: bold;&quot;&gt;&amp;lt;?php
&lt;/span&gt;
&lt;span class=&quot;predefined&quot; style=&quot;color: #336699; font-weight: bold;&quot;&gt;include_once&lt;/span&gt;(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;ssh2.php&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt; = &lt;span class=&quot;keyword&quot; style=&quot;color: #993399; font-weight: bold;&quot;&gt;new&lt;/span&gt; ssh2(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;172.31.0.1&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;); //連線ip
&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;authPassword(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;admin&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;1234&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;); //帳密

&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;openShell(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;xterm&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;); //開啟一個Terminal
//開始下指令
&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;writeShell(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;cd /&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);
&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;writeShell(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;ls&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;);

&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;writeShell(&lt;span class=&quot;string&quot;&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;content&quot; style=&quot;color: #4466aa;&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;delimiter&quot; style=&quot;color: #4466aa;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;); //關閉此Terminal

&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$result&lt;/span&gt;=&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$shell&lt;/span&gt;-&amp;gt;getResult(); //將下指令的過程與結果(&lt;/span&gt;&lt;/code&gt;Terminal畫面存進$result)
&lt;span class=&quot;local-variable&quot;&gt;printr(&lt;/span&gt;&lt;span class=&quot;local-variable&quot; style=&quot;color: #996633;&quot;&gt;$result)&lt;/span&gt;;

?&amp;gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&amp;nbsp;ssh2.php &amp;nbsp;(ssh2 class)&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;// ssh protocols&lt;br /&gt;// note: once openShell method is used, cmdExec does not work&lt;br /&gt;&lt;br /&gt;class ssh2 {&lt;br /&gt;&lt;br /&gt;&amp;nbsp; private $host = &#39;host&#39;;&lt;br /&gt;&amp;nbsp; private $user = &#39;user&#39;;&lt;br /&gt;&amp;nbsp; private $port = &#39;22&#39;;&lt;br /&gt;&amp;nbsp; private $password = &#39;password&#39;;&lt;br /&gt;&amp;nbsp; private $con = null;&lt;br /&gt;&amp;nbsp; private $shell_type = &#39;xterm&#39;;&lt;br /&gt;&amp;nbsp; private $shell = null;&lt;br /&gt;&amp;nbsp; private $log = &#39;&#39;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function __construct($host=&#39;&#39;, $port=&#39;&#39;&amp;nbsp; ) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $host!=&#39;&#39; ) $this-&amp;gt;host&amp;nbsp; = $host;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $port!=&#39;&#39; ) $this-&amp;gt;port&amp;nbsp; = $port;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;con&amp;nbsp; = ssh2_connect($this-&amp;gt;host, $this-&amp;gt;port);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( !$this-&amp;gt;con ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;log .= &quot;Connection failed !&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function authPassword( $user = &#39;&#39;, $password = &#39;&#39; ) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $user!=&#39;&#39; ) $this-&amp;gt;user&amp;nbsp; = $user;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $password!=&#39;&#39; ) $this-&amp;gt;password&amp;nbsp; = $password;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( !ssh2_auth_password( $this-&amp;gt;con, $this-&amp;gt;user, $this-&amp;gt;password ) ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;log .= &quot;Authorization failed !&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function openShell( $shell_type = &#39;&#39; ) {&lt;br /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( $shell_type != &#39;&#39; ) $this-&amp;gt;shell_type = $shell_type;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;shell = ssh2_shell( $this-&amp;gt;con,&amp;nbsp; $this-&amp;gt;shell_type );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( !$this-&amp;gt;shell ) $this-&amp;gt;log .= &quot; Shell connection failed !&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream_set_blocking( $this-&amp;gt;shell, true );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function writeShell( $command = &#39;&#39; ) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fwrite($this-&amp;gt;shell, $command.&quot;\n&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function cmdExec( ) {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $argc = func_num_args();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $argv = func_get_args();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $cmd = &#39;&#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for( $i=0; $i&amp;lt;$argc ; $i++) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( $i != ($argc-1) ) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $cmd .= $argv[$i].&quot; &amp;amp;&amp;amp; &quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $cmd .= $argv[$i];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $cmd;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $stream = ssh2_exec( $this-&amp;gt;con, $cmd );&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream_set_blocking( $stream, true );&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return stream_get_contents($stream);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp; function getLog() {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $this-&amp;gt;log;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function getResult(){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $contents=&#39;&#39;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (!feof($this-&amp;gt;shell)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; $contents.=fgets($this-&amp;gt;shell);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $contents;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;?&amp;gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #484848; font-family: &amp;quot;verdana&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/9163294258459586148/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2016/11/php-sshserver.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/9163294258459586148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/9163294258459586148'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2016/11/php-sshserver.html' title='php 透過ssh遠端操作其他server'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-8305438113935976782</id><published>2016-11-29T18:35:00.003-08:00</published><updated>2016-11-29T18:35:30.823-08:00</updated><title type='text'>php 連接LDAP</title><content type='html'>&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;架設web server(wamp)&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://www.wampserver.com/en/&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://www.wampserver.com/en/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;開啟php ldap function&lt;ul style=&quot;margin-bottom: 1em;&quot;&gt;
&lt;li&gt;[Your Drive]:\xampp\php\php.ini In this file uncomment the foll. line: extension=php_ldap.dll&lt;/li&gt;
&lt;li&gt;Move the file: libsasl.dll, from [Your Drive]:\xampp\php to [Your Drive]:\xampp\apache\bin&lt;/li&gt;
&lt;li&gt;Restart Apache.&lt;/li&gt;
&lt;li&gt;You can now use functions of the LDAP Module!&lt;/li&gt;
&lt;li&gt;&lt;a class=&quot;external&quot; href=&quot;http://stackoverflow.com/questions/16864306/fatal-error-call-to-undefined-function-ldap-connect&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://stackoverflow.com/questions/16864306/fatal-error-call-to-undefined-function-ldap-connect&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;用php連接ldap&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://mazakazu.pixnet.net/blog/post/83244803-%E4%BD%BF%E7%94%A8-php-%E9%80%A3-ldap-%E5%BF%83%E5%BE%97&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://mazakazu.pixnet.net/blog/post/83244803-%E4%BD%BF%E7%94%A8-php-%E9%80%A3-ldap-%E5%BF%83%E5%BE%97&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://bojack.pixnet.net/blog/post/23832296-%E3%80%90%E7%A8%8B%E5%BC%8F%E3%80%91%E5%88%A9%E7%94%A8-php-%E6%90%9C%E5%B0%8B-ldap---ad-%E8%B3%87%E8%A8%8A&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://bojack.pixnet.net/blog/post/23832296-%E3%80%90%E7%A8%8B%E5%BC%8F%E3%80%91%E5%88%A9%E7%94%A8-php-%E6%90%9C%E5%B0%8B-ldap---ad-%E8%B3%87%E8%A8%8A&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://php.net/manual/en/book.ldap.php&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://php.net/manual/en/book.ldap.php&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://www.coolsun.idv.tw/modules/xhnewbb/viewtopic.php?topic_id=1326&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://www.coolsun.idv.tw/modules/xhnewbb/viewtopic.php?topic_id=1326&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/8305438113935976782/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2016/11/php-ldap.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/8305438113935976782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/8305438113935976782'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2016/11/php-ldap.html' title='php 連接LDAP'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-75146303438025211</id><published>2016-11-29T18:32:00.002-08:00</published><updated>2016-11-29T18:33:44.989-08:00</updated><title type='text'>PHP 使用PDO連線mysql</title><content type='html'>&lt;div style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
php pdo function&lt;/div&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;connect&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;$dsn = &quot;mysql:host=localhost;dbname=$dbname&quot;;
$pdo = new PDO($dsn, &quot;root&quot;, $passwd);
$pdo-&amp;gt;query(&#39;set names utf8;&#39;);
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;sql&lt;ul style=&quot;margin-bottom: 1em;&quot;&gt;
&lt;li&gt;select&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;$rs = $pdo -&amp;gt; prepare($sql); //編譯,最佳化sql但不執行 避免sql injection
$rs -&amp;gt; execute(); //執行sql
//讀取所有資料
while($row=$rs-&amp;gt;fetchAll()){ 
   print_r($row);
}
$num=$rs-&amp;gt;rowCount(); //讀取資料筆數
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;insert, update, delete&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;$rs = $pdo -&amp;gt; prepare(&quot;insert into test(col1,col2) values(?,?)&quot;); //編譯,最佳化sql但不執行 避免sql injection
$rs -&amp;gt; execute(array($val1,$val2)); //執行sql
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;debug&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;if ($rs-&amp;gt;errorCode()!=00000)
       print_r($rs-&amp;gt;errorInfo());&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;prepare&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://blog.yam.com/csylvia/article/72659816&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://blog.yam.com/csylvia/article/72659816&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://tw2.php.net/manual/en/pdo.prepare.php&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://tw2.php.net/manual/en/pdo.prepare.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;mysql,mysqli,pdo&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://blog.roga.tw/2010/06/%E6%B7%BA%E8%AB%87-php-mysql-php-mysqli-pdo-%E7%9A%84%E5%B7%AE%E7%95%B0/&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://blog.roga.tw/2010/06/%E6%B7%BA%E8%AB%87-php-mysql-php-mysqli-pdo-%E7%9A%84%E5%B7%AE%E7%95%B0/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;pdo&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://blog.xuite.net/janet.jaja/1/103663034-PDO+(PHP+Data+Object)+%E7%B0%A1%E6%98%93%E6%95%99%E5%AD%B8&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://blog.xuite.net/janet.jaja/1/103663034-PDO+(PHP+Data+Object)+%E7%B0%A1%E6%98%93%E6%95%99%E5%AD%B8&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://fanli7.net/a/shujuku/Mysql/20130124/296530.html&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://fanli7.net/a/shujuku/Mysql/20130124/296530.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;rowcount&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://php.net/manual/en/pdostatement.rowcount.php&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://php.net/manual/en/pdostatement.rowcount.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;errorInfo&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://php.net/manual/en/pdo.errorinfo.php&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://php.net/manual/en/pdo.errorinfo.php&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;session&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://www.webtech.tw/info.php?tid=33&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://www.webtech.tw/info.php?tid=33&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/75146303438025211/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2016/11/pdomysql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/75146303438025211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/75146303438025211'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2016/11/pdomysql.html' title='PHP 使用PDO連線mysql'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-697131712614642668</id><published>2016-11-29T18:31:00.002-08:00</published><updated>2016-11-29T18:31:26.359-08:00</updated><title type='text'>Apache 從 2.2 換至 2.4 httpd.conf Deny/Allow的調整</title><content type='html'>&lt;div style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
Apache 從 2.2 換至 2.4 httpd.conf 的調整&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;原本使用 Order Deny / Allow 的方式，改用 Require&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;Apache 2.2&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;Order deny,allow
Deny from all
Allow from all
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;Apache 2.4&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;Require all denied

Require all granted

Require host xxx.com

Require ip 192.168.1 192.168.2

Require local
&lt;/pre&gt;
&lt;br /&gt;&lt;pre style=&quot;background-color: #fafafa; border: 1px solid rgb(226, 226, 226); margin: 1em 1em 1em 1.6em; overflow-x: auto; overflow-y: hidden; padding: 8px; width: auto;&quot;&gt;servername x.x.x.x:80 
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px; margin-bottom: 1em;&quot;&gt;
&lt;li&gt;開啟防火牆&lt;ul style=&quot;margin-bottom: 1em;&quot;&gt;
&lt;li&gt;新增允許程式 wamp\bin\apache\apache2.4.9\bin\httpd&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; color: #484848; font-family: Verdana, sans-serif; font-size: 12px;&quot;&gt;
&lt;a class=&quot;external&quot; href=&quot;http://www.dotblogs.com.tw/maplenote/archive/2012/07/20/apache24_httpd_conf.aspx&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://www.dotblogs.com.tw/maplenote/archive/2012/07/20/apache24_httpd_conf.aspx&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;external&quot; href=&quot;http://phpbb-tw.net/phpbb/viewtopic.php?t=54580&quot; style=&quot;background-image: url(&amp;quot;../images/external.png&amp;quot;); background-position: 0% 60%; background-repeat: no-repeat; color: #116699; padding-left: 12px; text-decoration: none;&quot;&gt;http://phpbb-tw.net/phpbb/viewtopic.php?t=54580&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/697131712614642668/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2016/11/apache-22-24-httpdconf-denyallow.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/697131712614642668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/697131712614642668'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2016/11/apache-22-24-httpdconf-denyallow.html' title='Apache 從 2.2 換至 2.4 httpd.conf Deny/Allow的調整'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-7627048770990944240</id><published>2013-01-31T19:00:00.003-08:00</published><updated>2013-01-31T19:00:38.175-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHP Array 函式</title><content type='html'>&lt;br /&gt;
參考網址：http://www.w3school.com.cn/php/php_ref_array.asp&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/7627048770990944240/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2013/01/php-array.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7627048770990944240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7627048770990944240'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2013/01/php-array.html' title='PHP Array 函式'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-4014871303598890991</id><published>2013-01-31T18:56:00.001-08:00</published><updated>2013-01-31T18:56:26.849-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>抓取上一步mysql insert的資料id</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: whitesmoke; border: 1px dotted rgb(119, 136, 85); font-family: &#39;Courier New&#39;, monospace; font-size: 12px; margin-top: 10px; padding: 10px; width: 580px;&quot;&gt;id = mysql_insert_id(connection);&lt;/pre&gt;
&lt;pre style=&quot;background-color: whitesmoke; border: 1px dotted rgb(119, 136, 85); font-family: &#39;Courier New&#39;, monospace; font-size: 12px; margin-top: 10px; padding: 10px; width: 580px;&quot;&gt;connection參數：MySQL的連結，可以省略&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
參考網址：http://www.w3school.com.cn/php/func_mysql_insert_id.asp</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/4014871303598890991/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2013/01/mysql-insertid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/4014871303598890991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/4014871303598890991'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2013/01/mysql-insertid.html' title='抓取上一步mysql insert的資料id'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-6929142377456699777</id><published>2012-11-08T19:41:00.002-08:00</published><updated>2012-11-08T19:41:20.768-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>Notice 和 Warning 警告</title><content type='html'>&lt;span style=&quot;color: #333333; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 26px;&quot;&gt;php的Notice和Warning警告，通常是一些欄位或變數沒有宣告或定義錯誤&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 26px;&quot;&gt;但不影響php檔案的執行&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 26px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #333333; font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 26px;&quot;&gt;若不想改善&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;Notice和Warning所提出的問題，可利用下列函式，把警告訊息遮起來&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;error_reporting(0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: Arial; font-size: 14px; line-height: 26px;&quot;&gt;參考資料&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.csdn.net/fcoolx/article/details/2626240&quot;&gt;http://blog.csdn.net/fcoolx/article/details/2626240&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/6929142377456699777/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2012/11/notice-warning.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/6929142377456699777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/6929142377456699777'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2012/11/notice-warning.html' title='Notice 和 Warning 警告'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-7244723584140825900</id><published>2012-09-21T07:54:00.000-07:00</published><updated>2016-11-29T18:29:57.746-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>PHP 產生word檔</title><content type='html'>只要在php檔一開始加入以下header，接著後面就是一般的HTML語法&lt;br /&gt;
執行此程式，就會把html內容轉成word，並輸出成&lt;code class=&quot;html plain&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: red; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;word_filenam&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: red; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;e.doc&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;給client端下載&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 21px;&quot;&gt;&amp;lt;?php&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;line number2 index1 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;header(&quot;Content-type: text/html;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: grey; float: none; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace &amp;quot;important&amp;quot;; font-size: 1em; left: auto; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;charset&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;html string&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;utf8&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;); //頁面編碼&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;header(&quot;Content-Type:application/msword&quot;);&amp;nbsp;&amp;nbsp; //將此html頁面轉成word&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;header(&quot;Content-Disposition:attachment;&lt;/code&gt;&lt;code class=&quot;html color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: grey; float: none; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace &amp;quot;important&amp;quot;; font-size: 1em; left: auto; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;filename&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;html string&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;.mb_convert_encoding(&quot;&lt;/code&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;word_filenam&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;e&lt;/code&gt;&lt;/span&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;,&quot;gbk&quot;,&quot;utf8&quot;).&quot;.doc&quot;);&amp;nbsp;&amp;nbsp; //設定word檔名&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;header(&quot;Pragma:no-cache&quot;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;header(&quot;Expires:0&quot;);&lt;/code&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;?&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;line number8 index7 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;html&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;meta&lt;/code&gt;&amp;nbsp;&lt;code class=&quot;html color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: grey; float: none; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace &amp;quot;important&amp;quot;; font-size: 1em; left: auto; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;http-equiv&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;html string&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;Content&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;-Type&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;html color1&quot; style=&quot;background: none; border-radius: 0px; border: 0px; bottom: auto; box-sizing: content-box; color: grey; float: none; font-family: &amp;quot;consolas&amp;quot; , &amp;quot;bitstream vera sans mono&amp;quot; , &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace &amp;quot;important&amp;quot;; font-size: 1em; left: auto; line-height: 1.1em; margin: 0px; min-height: auto; outline: 0px; overflow: visible; padding: 0px; position: static; right: auto; top: auto; vertical-align: baseline; width: auto;&quot;&gt;content&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;html string&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: blue !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&quot;text/html; charset=utf8&quot;&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;html keyword&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;body&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;p&amp;gt;hello world&amp;lt;/p&amp;gt;&lt;/div&gt;
&lt;div class=&quot;line number43 index42 alt2&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;body&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;line number44 index43 alt1&quot; style=&quot;background: none white !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: #555555; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 12px; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; white-space: nowrap; width: auto !important;&quot;&gt;
&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;html keyword&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: rgb(0, 102, 153) !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; font-weight: bold !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;html&lt;/code&gt;&lt;code class=&quot;html plain&quot; style=&quot;background: none !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; box-sizing: content-box !important; color: black !important; float: none !important; font-family: Consolas, &amp;quot;Bitstream Vera Sans Mono&amp;quot;, &amp;quot;Courier New&amp;quot;, Courier, monospace !important; font-size: 1em !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; min-height: auto !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important;&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;參考資料&amp;nbsp;http://xuxueliang.blog.51cto.com/5576502/1367855&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;courier new&amp;quot; , &amp;quot;courier&amp;quot; , monospace;&quot;&gt;&lt;span style=&quot;background-color: #fafbfc; font-size: 14px; line-height: 21px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/7244723584140825900/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2012/09/php-word.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7244723584140825900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7244723584140825900'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2012/09/php-word.html' title='PHP 產生word檔'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-1746034154362769976</id><published>2012-09-21T07:33:00.001-07:00</published><updated>2012-09-21T07:41:46.024-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>網頁輸出成pdf</title><content type='html'>1. 安裝wkhtmltodpf (wkhtmltox-0.11.0_rc1-installer.exe)&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/wkhtmltopdf/downloads/list&quot;&gt;http://code.google.com/p/wkhtmltopdf/downloads/list&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 在cmd下輸入&amp;nbsp;wkhtmltopdf.exe路徑[空格] 網址[空格] 新增的pdf檔名位置&lt;br /&gt;
(ex:)f:\wkhtmltopdf\wkhtmltopdf.exe http://tw.yahoo.com/ f:\test2.pdf&lt;br /&gt;
&lt;br /&gt;
3. 在php中&lt;br /&gt;
shell_exec($cmd); //執行cmd指令&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$page = &quot;網址&quot;;&lt;br /&gt;
$save = &quot;pdf位置&quot;;&lt;br /&gt;
$sh = &quot;
wkhtmltopdf.exe路徑&amp;nbsp;&amp;nbsp;&quot;.$page.&quot; &quot;.$save;&lt;br /&gt;
//echo $sh;&lt;br /&gt;
$results = shell_exec($sh);&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/1746034154362769976/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2012/09/pdf.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/1746034154362769976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/1746034154362769976'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2012/09/pdf.html' title='網頁輸出成pdf'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-4261057112210563810</id><published>2011-06-13T18:44:00.000-07:00</published><updated>2011-06-13T18:44:52.147-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php 傳送GET、POST、SESSION變數</title><content type='html'>從一個PHP檔傳送變數到另一個PHP檔的方法有3種&lt;br /&gt;
1. GET, 利用超連結 從A網址超連結到B網址時 A會順便傳送變數到B&lt;br /&gt;
2. POST, 利用表單 在A網址的表單按送出 傳送到B網址&lt;br /&gt;
3. SESSION, 設定一個全域變數, session在任一個php檔案皆可存取&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
///////////////////////////////////////////////GET////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
//a.php&lt;br /&gt;
&lt;br /&gt;
$a = &quot;1&quot;;&lt;br /&gt;
echo &quot;&amp;lt;a href=\&quot;b.php?id=&quot;.$a.&quot;\&quot;&amp;gt;點我超連結到b.php&amp;lt;/a&amp;gt;&quot;; //印出超連結&lt;br /&gt;
/*&lt;br /&gt;
b.php為要超連結的網址&lt;br /&gt;
在網址後面加上?id=$a 為傳送get變數&lt;br /&gt;
id是get變數名稱(可以自己亂取)&lt;br /&gt;
$a就是id這個get變數的值&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
//b.php&lt;br /&gt;
&lt;br /&gt;
$b = $_GET[&quot;id&quot;]; //存取get變數(名稱為id), 並將其值存入$b&lt;br /&gt;
/*&lt;br /&gt;
這時$b的值就是1&lt;br /&gt;
也就等於a.php 裡面的$a&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////POST/////////////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
//a.html&lt;br /&gt;
&amp;lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;b.php&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;input type=&quot;text&quot; name=&quot;id&quot; id=&quot;id&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;input type=&quot;submit&quot; name=&quot;button&quot; id=&quot;button&quot; value=&quot;送出&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
在a.html裡面有一個表單 按送出後 會將表單裡的欄位傳送到b.php&lt;br /&gt;
這表單有2個欄位, 一個是文字欄位(id), 一個是送出按鈕欄位(button)&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
//b.php&lt;br /&gt;
$a = $_POST[&quot;id&quot;]; //將id文字欄位使用者輸入的值 存入$a&lt;br /&gt;
$b = $_POST[&quot;button&quot;];&amp;nbsp; //將button欄位的值存入$b, 所以$b=&quot;送出&quot;&lt;br /&gt;
&lt;br /&gt;
////////////////////////////////////////////SESSION//////////////////////////////////////////////////&lt;br /&gt;
&lt;br /&gt;
//a.php&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?php session_start(); //開啟session的語法 要放在檔案最上方&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $a = &quot;freshman&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_SESSION[&quot;id&quot;] = $a; //設定id這個session變數的值為$a&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;//任一php (此檔須在執行過a.php後執行 才會抓到a.php所設定的$_SESION[&quot;id&quot;])&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?php session_start(); //開啟session的語法 要放在檔案最上方&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $b =&amp;nbsp; $_SESSION[&quot;id&quot;]; //將$_SESION[&quot;id&quot;]存入$b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unset($_SESSION[&quot;id&quot;]); //清空$_SESSION[&quot;id&quot;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: red; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $c =  $_SESSION[&quot;id&quot;]; //將$_SESION[&quot;id&quot;]存入$c&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $b的值為&quot;freshman&quot;,也就是a.php中$a的值&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $c的值為null, 因為在存取前$_SESSION[&quot;id&quot;]已被清空&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: blue; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 12pt; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-bidi-font-size: 11.0pt; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: 新細明體; mso-fareast-language: ZH-TW; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;mso-special-character: line-break;&quot; /&gt; &lt;br style=&quot;mso-special-character: line-break;&quot; /&gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/4261057112210563810/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-getpostsession.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/4261057112210563810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/4261057112210563810'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-getpostsession.html' title='php 傳送GET、POST、SESSION變數'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-133544728989896561</id><published>2011-06-10T17:16:00.000-07:00</published><updated>2011-06-10T17:16:32.820-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php strtotime時間運算</title><content type='html'>$ThisDay = &#39;2008-01-01&#39;;&lt;br /&gt;
$ThisDay = strtotime($ThisDay); // 將日期轉為Unix時間戳記&lt;br /&gt;
$ThisDay = strtotime(&quot;+1 day&quot;,$ThisDay); // 計算$ThisDay的後一天&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
$CheckDay= date(&quot;Y-m-d&quot;,$ThisDay); // 將Unix時間戳記轉回日期&lt;br /&gt;
echo $CheckDay ;//會顯示 2008-01-02&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
參考資料:&lt;br /&gt;
&lt;a href=&quot;http://www.gocar.idv.tw/phpbb3/viewtopic.php?f=9&amp;amp;t=33&quot;&gt;http://www.gocar.idv.tw/phpbb3/viewtopic.php?f=9&amp;amp;t=33&lt;/a&gt;&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/133544728989896561/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-strtotime.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/133544728989896561'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/133544728989896561'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-strtotime.html' title='php strtotime時間運算'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-3748955202576370194</id><published>2011-06-10T17:12:00.000-07:00</published><updated>2011-06-10T17:13:41.288-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php foreach抓取所有POST變數</title><content type='html'>$i=0;&lt;br /&gt;
$Ary = &amp;amp; $_POST;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;foreach($Ary as $AryKey[$i]=&amp;gt;$a[$i]){&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//印出陣列索引號$i,POST欄位名稱,POST的值&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $i.&quot; &quot;.$AryKey[$i] . &quot;=&amp;gt;&quot; . $a[$i] . &quot;&amp;lt;br&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $i++;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;} &lt;br /&gt;
echo &quot;&amp;lt;hr&amp;gt;&quot;; //印出水平分隔線&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
若是用表單傳送資料時&lt;br /&gt;
$AryKey[] 陣列存的是表單裡的欄位名稱&lt;br /&gt;
其值則是對應到$a[] 陣列中&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/3748955202576370194/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-foreachpost.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/3748955202576370194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/3748955202576370194'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-foreachpost.html' title='php foreach抓取所有POST變數'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-7151175856002547356</id><published>2011-06-10T08:15:00.000-07:00</published><updated>2011-06-10T08:15:36.269-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>js 傳送表單</title><content type='html'>document.form1.submit();&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
//forml為表單名稱&lt;br /&gt;
&lt;br /&gt;
//在網頁讀取(一開啟)時就傳送表單&lt;br /&gt;
&amp;lt;body onload=&quot;document.form1.submit();&quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//用函式傳送&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
function send(){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.form1.submit();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//html語法 當一選取清單時 就送出表單&lt;br /&gt;
&amp;lt;form id=&quot;form1&quot; name=&quot;form1&quot; method=&quot;post&quot; action=&quot;show.php&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;select name=&quot;select&quot; id=&quot;select&quot; onChange=&quot;send();&quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=&quot;1&quot;&amp;gt;1&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option value=&quot;2&quot;&amp;gt;2&amp;lt;/option&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/select&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/7151175856002547356/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/js_10.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7151175856002547356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/7151175856002547356'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/js_10.html' title='js 傳送表單'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-6553120323768282620</id><published>2011-06-10T08:07:00.000-07:00</published><updated>2011-06-10T08:07:39.769-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>js 判斷瀏覽器</title><content type='html'>&lt;div class=&quot;container&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;&amp;lt;script type=&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;text/javascript&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;&amp;gt;  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number2 index1 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;isIE = navigator.userAgent.search(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;MSIE&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;) &amp;gt; -1;  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number3 index2 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;isIE7 = navigator.userAgent.search(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;MSIE 7&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;) &amp;gt; -1;  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number4 index3 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;isFirefox = navigator.userAgent.search(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;Firefox&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;) &amp;gt; -1;  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number5 index4 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;isOpera = navigator.userAgent.search(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;Opera&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;) &amp;gt; -1;  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;var&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;isSafari = navigator.userAgent.search(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&quot;Safari&quot;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;) &amp;gt; -1;&lt;/code&gt;&lt;code class=&quot;javascript comments&quot;&gt;//Google瀏覽器是用這核心&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number6 index5 alt1&quot;&gt;&lt;code class=&quot;javascript comments&quot;&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number7 index6 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;(isIE7)&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number8 index7 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;       &amp;nbsp; &lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&#39;isIE7&#39;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;);  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number9 index8 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number10 index9 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;(isIE)&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number11 index10 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;       &amp;nbsp; &lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&#39;isIE&#39;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;);  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number12 index11 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number13 index12 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;(isFirefox)&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number14 index13 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;        &lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&#39;isFirefox&#39;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;);  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number15 index14 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number16 index15 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;(isOpera)&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number17 index16 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;       &amp;nbsp; &lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&#39;isOpera&#39;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;);  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number18 index17 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number19 index18 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;    &lt;/code&gt;&lt;code class=&quot;javascript keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;javascript plain&quot;&gt;(isSafari)&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number20 index19 alt1&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;       &amp;nbsp; &lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;alert(&lt;/code&gt;&lt;code class=&quot;javascript string&quot;&gt;&#39;isSafari&#39;&lt;/code&gt;&lt;code class=&quot;javascript plain&quot;&gt;);  &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number21 index20 alt2&quot;&gt;&lt;code class=&quot;javascript spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;&lt;/code&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;/*&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;參考資料:http://demo.tc/Post/366&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;line number22 index21 alt1&quot;&gt;&lt;code class=&quot;javascript plain&quot;&gt;*/&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/6553120323768282620/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/js.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/6553120323768282620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/6553120323768282620'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/js.html' title='js 判斷瀏覽器'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-1693633154491792658</id><published>2011-06-10T08:03:00.000-07:00</published><updated>2011-06-10T17:04:00.290-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php 執行sql式</title><content type='html'>//抓取mysql資料&lt;br /&gt;
//假設test table有id,password,name三個欄位&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
$sql=&quot;SELECT * FROM test&quot;;&lt;br /&gt;
$result = mysql_query($sql); //執行sql&lt;br /&gt;
$a = mysql_fetch_array($result); //將結果存入陣列a&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
$a[0] = id欄位的值&lt;br /&gt;
$a[1] = password欄位的值&lt;br /&gt;
$a[2] = name欄位的值&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
//若test table有多筆資料 可用while依序印出&lt;br /&gt;
while($a=mysql_fetch_array($result); ){&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &quot;id=&quot;.$a[0].&quot;, password=&quot;.$a[1].&quot;, name=&quot;.$a[2].&quot;&amp;lt;br&amp;gt;&quot;;&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/1693633154491792658/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-sql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/1693633154491792658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/1693633154491792658'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-sql.html' title='php 執行sql式'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-2921889627736759712</id><published>2011-06-10T07:59:00.000-07:00</published><updated>2011-06-10T07:59:34.865-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php header 自動轉址</title><content type='html'>header(&quot;location:home.php?check=$a&quot;); //自動超連結&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
/*&lt;br /&gt;
home.php 為要連結的網址&lt;br /&gt;
?check=$a 傳送$_GET[&quot;check&quot;],其值為$a&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/2921889627736759712/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-header.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/2921889627736759712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/2921889627736759712'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-header.html' title='php header 自動轉址'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-5930907262895781485</id><published>2011-06-10T07:54:00.000-07:00</published><updated>2011-06-10T07:55:28.433-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php連結mysql</title><content type='html'>$linkname = &#39;localhost&#39;;&amp;nbsp; //輸入伺服器位置&lt;br /&gt;
$linkid = &#39;root&#39;;&amp;nbsp; //輸入資料庫帳號&lt;br /&gt;
$linkpassword = &quot;1234&quot;;&amp;nbsp; //輸入資料庫密碼&lt;br /&gt;
$database = &#39;test&#39;;&amp;nbsp; //輸入資料庫名稱&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
$conn = mysql_pconnect ($linkname,$linkid,$linkpassword) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or die(&quot;Could not connect&quot;); //連結mysql&lt;br /&gt;
mysql_select_db($database) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(&quot;Could not select database&quot;); //選擇資料庫&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&lt;br /&gt;
mysql_query(&quot;SET NAMES utf8&quot;); //將編碼設定為utf-8</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/5930907262895781485/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/phpmysql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/5930907262895781485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/5930907262895781485'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/phpmysql.html' title='php連結mysql'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8534926122732220139.post-2970617630110026941</id><published>2011-06-10T07:37:00.000-07:00</published><updated>2011-06-10T07:42:43.415-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><title type='text'>php 匯出txt檔</title><content type='html'>//匯出txt黨&lt;br /&gt;
header(&quot;Content-type: application/text&quot;);&lt;br /&gt;
header(&quot;Content-Disposition: attachment; filename=aa.txt&quot;); //aa.txt為匯出的檔名&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
$mycontent = &quot;02330&quot;;&lt;br /&gt;
echo $mycontent;&lt;br /&gt;
echo &quot;\r\n&quot;; //換行&lt;br /&gt;
echo &quot;123&quot;;&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
在header之後的echo都會印到txt檔中&lt;br /&gt;
參考資料:http://www.blueshop.com.tw/board/FUM20041006152627A9N/BRD20100302184707JUD.html&lt;br /&gt;
*/</content><link rel='replies' type='application/atom+xml' href='http://fresh08man.blogspot.com/feeds/2970617630110026941/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-txt.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/2970617630110026941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8534926122732220139/posts/default/2970617630110026941'/><link rel='alternate' type='text/html' href='http://fresh08man.blogspot.com/2011/06/php-txt.html' title='php 匯出txt檔'/><author><name>靖傑先生</name><uri>http://www.blogger.com/profile/03955059376769011185</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBDJzABaeMEuyJMk_mcjUb0MOA3La4ou2m9QjHcNJ6iHriXNXKy7Zi35J_Ot2Ol0ovL0LaeX8ZSbGnTBkCuQT_PeQ11MugCPT_F1kJJV-lR_cmEPtO-p17zBeGvfR2QQE/s1600/21534_107980935885696_100000213711503_195860_3564793_n.jpg'/></author><thr:total>0</thr:total></entry></feed>