2015年11月7日 星期六

中華電信P880數據機設定硬撥固定ip帳號

Step1. 
連上數據機後,開啟瀏覽器輸入 http://192.168.1.1  ,之後會跳出輸入帳號,密碼的視窗,可輸入使用者模式(帳號:user、密碼:user)或工程模式:

帳號 cht 密碼 chtnvdsl (北區)、chtcvdsl (中區)、chtsvdsl (南區)


2017更新:
P880主機更新韌體後,密碼已經不分區域,
新密碼 chtvdsl、chtadsl、chtgpon
Step2.
以工程模式為例:
進入  Advanced Setup  /  Wan 
點擊 PPPoE 後方的edit 進入編輯

Step3.
Username的欄位原本若是撥xxxxxxxx@wifi.hinet.net將它改為xxxxxxxx@ip.hinet.net
密碼欄位也要重新輸入原先中華電信提供的密碼
(原本@wifi.hinet.net是家用 Wi-Fi 專用的連線帳號,對應的密碼是系統自動產生的亂數密碼,和原始的連線密碼不同, 改為ip.hinet.net時,密碼要重新輸入。)

Step4.
按下「儲存」就可以了

2015年6月18日 星期四

php改變上傳後圖檔的長寬尺寸

<?php


if(is_uploaded_file($upload1))

//upload1為上傳圖檔input 欄位內的name""
          {
          if($_FILES['upload1']!="none")  {      
                //resize 390*250  518×351  2
$uploadedfile = $_FILES['upload1']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
list($width,$height)=getimagesize($uploadedfile);
$newwidth=390 ;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height); 

                $fnsub=explode(".",$_FILES['upload1']['name']);

                if($fnsub[1]!="") {
                $fn1="bbs_".date("Ymdhis").".".$fnsub[1];
                copy($_FILES['upload1']['tmp_name'],$DOCUMENT_ROOT."/upimg/$fn1");
             
                imagejpeg($tmp,$DOCUMENT_ROOT."/upimg/$fn1",100);
                imagedestroy($src);
imagedestroy($tmp);
             }                  

          } 


?>

2014年8月17日 星期日

使IE不再跳出「Internet Explorer已限制這個網頁執行指令碼或ActiveX控制項」這個警告列,IE上的Mark of the Web (MOTW)

當在本機、隨身碟或CD光碟上以IE執行網頁html檔案時,
如果html檔案有使用javascript語法,那麼IE就會跳出
「Internet Explorer已限制這個網頁執行指令碼或ActiveX控制項」
這樣的警告列,必須按下「允許被封鎖的內容」按鈕,才能順利執行。
如果想把網頁燒在光碟上讓使用者瀏覽,就會遇到這樣的問題。

這時可以在html碼內加入下面這段語法,來避免這樣的情形發生

<!DOCTYPE html>
<!-- saved from url=(0014)about:internet -->
<html>
<head>

微軟網站對於Mark of the web的說明

使用時注意:
根據stackoverflow網站harrygg網友的回覆
"make sure the HTML file is saved in windows/dos format with "\r\n" as line breaks after the statement. Otherwise I couldn't make it work."

筆者使用apple電腦做網頁的coding,加上MOTW語法的html檔案拿到pc上去用,就沒有作用,還是會出現警告,後來在pc上新增文字檔把語法都copy貼上,另外重新存html檔案,就可以了,大概就是上方harrygg網友所說的格式問題。