myAdBanner

2022年7月6日 星期三

php 轉換成 html

1. 先建立新的.htaccess檔案放在php檔案的目錄。

2. 建立一個Rewrite Engine (URL重寫工具)。

在檔案第一行寫上

RewriteEngine on 
 
3. 設定所在目錄 / 譬如 /test/
 
RewriteBase /test/
 
4. php 轉換成 html
 
RewriteCond %{THE_REQUEST} (.*)\.php  
RewriteRule ^(.*)\.php $1.html [R=301,L]  

RewriteCond %{THE_REQUEST} (.*)\.html  
RewriteRule ^(.*)\.html $1.php [L] 
 
------------------
完整檔案內容
------------------
RewriteEngine On
RewriteBase /test/

RewriteCond %{THE_REQUEST} (.*)\.php
RewriteRule ^(.*)\.php $1.html [R=301,L]

RewriteCond %{THE_REQUEST} (.*)\.html
RewriteRule ^(.*)\.html $1.php [L]  

2022年6月12日 星期日

windows 系統排程執行PHP程式

 步驟如下:

1. 下載 wget.exe 程式

https://eternallybored.org/misc/wget/

2. 將 wget.exe 複製到 C:\windows 資料夾內

3.  撰寫 bat 檔

autorun.bat 內容如下:

--------------------

C:\xampp\php>c:\windows\wget.exe -q http://localhost/autorunl.php

-------------------

參數說明:

-q 不會輸出執行結果

4.排程執行 autorun.bat


2022年5月31日 星期二

解決 html5 input type date 日期欄位 限制 年 只能輸入4碼

日期欄位用手打時,如沒限制 年 要輸入6碼才會跳 月 限制後就可以打4碼後自動跳月了

<input type="date" name="Birthday" value="" placeholder="生日" id="input-Birthday" class="form-control" min="1900-01-01" max="9999-12-31"/>

2022年5月30日 星期一