用CSS控制图片自适应大小
[
2008/04/13 20:39 | by Else ]
2008/04/13 20:39 | by Else ]
图片自动适应大小是一个非常常用的功能,在进行制作的时候为了防止图片撑开容器而对图片的尺寸进行必要的控制。
代码:
[codes=CSS].img {
max-width:600px;
width:600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
overflow:hidden;
}[/codes]
代码:
[codes=CSS].img {
max-width:600px;
width:600px;
width:expression(document.body.clientWidth>600?"600px":"auto");
overflow:hidden;
}[/codes]
在html部分还不是很灵活,不知道php对dom本身的操作
[codes=php]foreach ($usergroupshare as $key=>$value)
{
${$key.$value}="checked=\"checked\"";
}[/codes]
[codes=php]$usergroupshare[name]='Vip会员';
$usergroupshare[shoufei]='1';
$usergroupshare[userinfo]='1';
$usergroupshare[jifei]='1';
$usergroupshare[gongqiu]='1';
$usergroupshare[page]='1';
$usergroupshare[com]='1';
$usergroupshare[ershou]='1';
$usergroupshare[products]='1';
$usergroupshare[art]='1';
$usergroupshare[message]='1';
$usergroupshare[nopass]='1';
$usergroupshare[nocode]='1';
$usergroupshare[noip]='1';
$usergroupshare[uptop]='0';
$usergroupshare[admin]='0';
$usergroupshare[xht]='0';
$usergroupshare[stitle]='1';
$usergroupshare[scontent]='1';
$usergroupshare[upfile]='1';[/codes]
html代码
[codes=php]foreach ($usergroupshare as $key=>$value)
{
${$key.$value}="checked=\"checked\"";
}[/codes]
[codes=php]$usergroupshare[name]='Vip会员';
$usergroupshare[shoufei]='1';
$usergroupshare[userinfo]='1';
$usergroupshare[jifei]='1';
$usergroupshare[gongqiu]='1';
$usergroupshare[page]='1';
$usergroupshare[com]='1';
$usergroupshare[ershou]='1';
$usergroupshare[products]='1';
$usergroupshare[art]='1';
$usergroupshare[message]='1';
$usergroupshare[nopass]='1';
$usergroupshare[nocode]='1';
$usergroupshare[noip]='1';
$usergroupshare[uptop]='0';
$usergroupshare[admin]='0';
$usergroupshare[xht]='0';
$usergroupshare[stitle]='1';
$usergroupshare[scontent]='1';
$usergroupshare[upfile]='1';[/codes]
html代码
<td align="left" bgcolor="#EFF9FE">查看用户信息</td>
<td bgcolor="#EFF9FE"><input type="radio" name="usergroupshare[userinfo]" id="radio5" value="1" {userinfo1}/>
允许
<input type="radio" name="usergroupshare[userinfo]" id="radio6" value="0" {userinfo0}/>
禁止</td>
<td bgcolor="#EFF9FE"><input type="radio" name="usergroupshare[userinfo]" id="radio5" value="1" {userinfo1}/>
允许
<input type="radio" name="usergroupshare[userinfo]" id="radio6" value="0" {userinfo0}/>
禁止</td>
顯示隱藏的一個簡單方法
[
2008/04/10 17:17 | by Else ]
2008/04/10 17:17 | by Else ]
代码:
复制代码 | 运行代码 | 另存代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
<!--
function MM_showHideLayers(obk,style) { //v9.0
document.getElementById(obk).style.display=style;
}
//-->
</script>
</head>
<body onload="MM_showHideLayers('li_b','none')">
<div id="test" onmouseover="MM_showHideLayers('li_b','block');MM_showHideLayers('li_a','none');" onmouseout="MM_showHideLayers('li_b','none');MM_showHideLayers('li_a','block');">
<ul >
<li><span id="li_a">en</span><span id="li_b"><a href="http://www.cuku.net">中文</a></span></li>
</ul>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
<!--
function MM_showHideLayers(obk,style) { //v9.0
document.getElementById(obk).style.display=style;
}
//-->
</script>
</head>
<body onload="MM_showHideLayers('li_b','none')">
<div id="test" onmouseover="MM_showHideLayers('li_b','block');MM_showHideLayers('li_a','none');" onmouseout="MM_showHideLayers('li_b','none');MM_showHideLayers('li_a','block');">
<ul >
<li><span id="li_a">en</span><span id="li_b"><a href="http://www.cuku.net">中文</a></span></li>
</ul>
</div>
</body>
</html>
asp command語句裡的兩個sql
[
2008/04/09 10:09 | by Else ]
2008/04/09 10:09 | by Else ]
[codes=vb]
'刪除回復貼
If (Request.querystring("del")="ok") Then
'刪除權限,用來觸發ajax的error
if session("bbsadmin")=1 then
dim delrs
Set MM_delCmd = Server.CreateObject ("ADODB.Command")
MM_delCmd.ActiveConnection = MM_conn_STRING
SelectSQL = "Select * from bbs WHERE id ="&Request.form("id")
MM_delCmd.CommandText =SelectSQL
MM_delCmd.Prepared = true
set delrs = MM_delCmd.Execute
if delrs.Fields.Item("cc").Value<>"" then
DeleteFile(server.MapPath("../obj/"&delrs.Fields.Item("cc").Value))
end if
MM_delCmd.CommandText = "DELETE FROM bbs WHERE id ="&Request.form("id")&""
MM_delCmd.Prepared = true
MM_delCmd.Execute
MM_delCmd.ActiveConnection.Close
response.Write("刪除成功")
response.End()
end if
End If
[/codes]這個是刪除的,我試了一個insert into 和一個update set 這個就不行了!
'刪除回復貼
If (Request.querystring("del")="ok") Then
'刪除權限,用來觸發ajax的error
if session("bbsadmin")=1 then
dim delrs
Set MM_delCmd = Server.CreateObject ("ADODB.Command")
MM_delCmd.ActiveConnection = MM_conn_STRING
SelectSQL = "Select * from bbs WHERE id ="&Request.form("id")
MM_delCmd.CommandText =SelectSQL
MM_delCmd.Prepared = true
set delrs = MM_delCmd.Execute
if delrs.Fields.Item("cc").Value<>"" then
DeleteFile(server.MapPath("../obj/"&delrs.Fields.Item("cc").Value))
end if
MM_delCmd.CommandText = "DELETE FROM bbs WHERE id ="&Request.form("id")&""
MM_delCmd.Prepared = true
MM_delCmd.Execute
MM_delCmd.ActiveConnection.Close
response.Write("刪除成功")
response.End()
end if
End If
[/codes]這個是刪除的,我試了一個insert into 和一個update set 這個就不行了!
uploadsize="2048"
uploadtype="jpg/gif/png/bmp"
Set Uprequest=new UpLoadClass
Uprequest.SavePath=uploadpath
Uprequest.MaxSize=uploadsize*1024
Uprequest.FileType=uploadtype
AutoSave=true
Uprequest.open
內詳
uploadtype="jpg/gif/png/bmp"
Set Uprequest=new UpLoadClass
Uprequest.SavePath=uploadpath
Uprequest.MaxSize=uploadsize*1024
Uprequest.FileType=uploadtype
AutoSave=true
Uprequest.open
內詳
asp常用的兩個email組件用法
[
2008/04/07 16:51 | by Else ]
2008/04/07 16:51 | by Else ]
JMail.SMTPMail
<%
'文件測試中文亂碼問題
'測試時間:2007.12.03 - 第二次測試
'response.codepage="950"
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ContentType="text/html"
'JMail.Encoding = "base64" ' 有試過注釋此行,問題依舊
jmail.Charset="BIG5"
'jmail.ContentType = "text/html;charset=BIG5"
jmail.ISOEncodeHeaders = false
JMail.Sender = "testi#sina.com" ' 發送人郵箱
JMail.SenderName = "這個中中文" ' 發送人姓名
JMail.AddRecipient("test#qq.com") ' 收件人郵箱
JMail.Body = "這個是內容,在測試一次,這個是註冊信息,不是垃圾 email,我們做個測試,測試的內容" ' 郵件正文
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
arrFile = Split(fileItem1,"$$")
'For i = 0 To Ubound(arrFile)-1
'JMail.AddAttachment(arrFile(i)) ' 多附件添加,單一附件也試過,問題依舊
'Next
JMail.Subject = "你的註冊信息,請注意接收,接收的email 增加了encoding,刪除了codepage 去了 iso的標準" ' 郵件標題
JMail.Execute
JMail.Close
Set JMail = Nothing
%>
'文件測試中文亂碼問題
'測試時間:2007.12.03 - 第二次測試
'response.codepage="950"
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ContentType="text/html"
'JMail.Encoding = "base64" ' 有試過注釋此行,問題依舊
jmail.Charset="BIG5"
'jmail.ContentType = "text/html;charset=BIG5"
jmail.ISOEncodeHeaders = false
JMail.Sender = "testi#sina.com" ' 發送人郵箱
JMail.SenderName = "這個中中文" ' 發送人姓名
JMail.AddRecipient("test#qq.com") ' 收件人郵箱
JMail.Body = "這個是內容,在測試一次,這個是註冊信息,不是垃圾 email,我們做個測試,測試的內容" ' 郵件正文
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
arrFile = Split(fileItem1,"$$")
'For i = 0 To Ubound(arrFile)-1
'JMail.AddAttachment(arrFile(i)) ' 多附件添加,單一附件也試過,問題依舊
'Next
JMail.Subject = "你的註冊信息,請注意接收,接收的email 增加了encoding,刪除了codepage 去了 iso的標準" ' 郵件標題
JMail.Execute
JMail.Close
Set JMail = Nothing
%>
msn端口問題的解決方法
[
2008/04/02 09:25 | by Else ]
2008/04/02 09:25 | by Else ]
這時候,要找一你的網關是什麼還有網關的mac
如果你的是上不去的時候,輸入 arp -a 這個時候,會有兩個ip的mac是一樣的,
這時候就是被aip給騙了
方法
我的
如果你的是上不去的時候,輸入 arp -a 這個時候,會有兩個ip的mac是一樣的,
這時候就是被aip給騙了
方法
引用
arp -s 網關ip 網關的mac
我的
引用
arp -s 192.168.3.99 00-e0-1e-89-59-82
<%
'request.ServerVariables("APPL_PHYSICAL_PATH") 這個是站點路徑
'FSO组件名称
dim FSObject
FSObject="Scripting.FileSystemObject"
'=========================================================
'◆是否支持组件
'=========================================================
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
'request.ServerVariables("APPL_PHYSICAL_PATH") 這個是站點路徑
'FSO组件名称
dim FSObject
FSObject="Scripting.FileSystemObject"
'=========================================================
'◆是否支持组件
'=========================================================
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err = 0
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If 0 = Err Then IsObjInstalled = True
Set xTestObj = Nothing
Err = 0
End Function
jquery的无刷新删除,支持栽入!目前没有取dom的值,待研究
[
2008/03/27 11:02 | by Else ]
2008/03/27 11:02 | by Else ]
在删除之后会停在这个页,如果一个页显示5条,那到,不会变成4条
<%
strPath=request.serverVariables("script_name")
currentAspFileFullName=lcase(mid(strPath,instrRev(strPath,"/")+1))
if request.ServerVariables("QUERY_STRING")<>"" then
currentAspFileFullName=currentAspFileFullName&"?"&request.ServerVariables("QUERY_STRING")
end if
%>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
function deldb(ids)
{
if(confirm("您确定要删除吗?"))
{
$.ajax({
beforeSend:function(){$("#msg").html("正在发送");},
type: "post",
url:"ordersql.asp?del=order",
data:"id="+ids,
success: function(comm){
alert(comm);
$("#msg").html(comm);
$("#tr"+ids).hide();
$.get("<%=currentAspFileFullName%>",
function(data){
$("#myorder").html(data); ;
}
);
},
error:function(err){
$("#msg").html("出現錯誤:刪除失败");
alert("出現錯誤:刪除失败");
$("#tr"+ids).hide();
}
});
}
else
{
return
}
}
</script>
strPath=request.serverVariables("script_name")
currentAspFileFullName=lcase(mid(strPath,instrRev(strPath,"/")+1))
if request.ServerVariables("QUERY_STRING")<>"" then
currentAspFileFullName=currentAspFileFullName&"?"&request.ServerVariables("QUERY_STRING")
end if
%>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript">
function deldb(ids)
{
if(confirm("您确定要删除吗?"))
{
$.ajax({
beforeSend:function(){$("#msg").html("正在发送");},
type: "post",
url:"ordersql.asp?del=order",
data:"id="+ids,
success: function(comm){
alert(comm);
$("#msg").html(comm);
$("#tr"+ids).hide();
$.get("<%=currentAspFileFullName%>",
function(data){
$("#myorder").html(data); ;
}
);
},
error:function(err){
$("#msg").html("出現錯誤:刪除失败");
alert("出現錯誤:刪除失败");
$("#tr"+ids).hide();
}
});
}
else
{
return
}
}
</script>
一个email的函数
[
2008/03/26 16:35 | by Else ]
2008/03/26 16:35 | by Else ]
function isEmail(str){
res = /^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$/;
var re = new RegExp(res);
return !(str.match(re) == null);
}
res = /^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$/;
var re = new RegExp(res);
return !(str.match(re) == null);
}
先放着,到时候用jquery去改!














