如何生成静态页面的五种方案 晴

jed , 2006-12-11 17:11 , 代码编程 , 评论(0) , 阅读(6222) , Via 本站原创
  方案1:


/// <summary>
/// 传入URL返回网页的html代码
/// </summary>
/// <param name="Url">URL</param>
/// <returns></returns>
public static  string getUrltoHtml(string Url)
{
errorMsg = "";
try
{
System.Net.WebRequest wReq = System.Net.WebRequest.Create(Url);
// Get the response instance.
System.Net.WebResponse wResp =wReq.GetResponse();
// Read an HTTP-specific property
//if (wResp.GetType() ==HttpWebResponse)
//{
//DateTime updated  =((System.Net.HttpWebResponse)wResp).LastModified;
//}
// Get the response stream.
System.IO.Stream respStream  = wResp.GetResponseStream();
// Dim reader As StreamReader = New StreamReader(respStream)
System.IO.StreamReader reader = new System.IO.StreamReader(respStream, System.Text.Encoding.GetEncoding("gb2312"));
return  reader.ReadToEnd();

}
catch(System.Exception ex)
{
errorMsg = ex.Message ;
}
return "";
}



  你可以用这个函数获取网页的客户端的html代码,然后保存到.html文件里就可以了。

日历弹窗的例子 阴

jed , 2006-12-7 17:17 , 代码编程 , 评论(3) , 阅读(9926) , Via 本站原创
在编程序的过程中,通常遇到这样的情况,要求用户输入日期,结果,他们输入的不规范,导致程序结果最后出现错误,今天,我从网上,搜了一下,找了相应的代码。效果不错,与大家分享一下。
先看看演示吧:
演示:http://jed.dzhope.com/yanshi.php
怎么样?不错吧grin
第一步:
在< head>和< /head>之间加上:


<script language="JavaScript" src="Calendar30.js"></script>



第二步:

javascript常用备忘 不指定

jed , 2006-11-17 14:29 , 代码编程 , 评论(0) , 阅读(4681) , Via 本站原创
1、父子窗口
打开一个子窗口:
<a href='#' onClick='JavaScript:window.open("sub_win_name.html")'>open</a>

打开即最大化:
<body onLoad="window.resizeTo(screen.width, screen.height);window.moveTo(0, 0);">


得到父窗口的控件:
window.opener.document.forms[0].txt1.value;

得到父窗口全局javascript变量:
window.opener.var

刷新父页面:
self.opener.location='url of super page'
Tags:

常用js大全 晴

jed , 2006-11-17 11:17 , 代码编程 , 评论(0) , 阅读(5324) , Via 本站原创
1.document.write(""); 输出语句  
2.JS中的注释为//  
3.传统的HTML文档顺序是:document->html->(head,body)  
4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document)  
5.得到表单中元素的名称和值:document.getElementById("表单中元素的ID号").name(或&#118alue)  
6.一个小写转大写的&#106s: document.getElementById("output").&#118alue = document.getElementById("input").&#118alue.toUpperCase();  
7.JS中的值类型:String,Number,Boolean,Null,Object,Function  
8.JS中的字符型转换成数值型:parseInt(),parseFloat()  
9.JS中的数字转换成字符型:(""+变量)  
10.JS中的取字符串长度是:(length)  
11.JS中的字符与字符相连接使用+号.  
Tags:
今天,把网址站转到新的服务器,不过,里面的$HTTP_REFERER不起作用。我改了半天,才发现。
当register_global = On 的时候$HTTP_REFERER打印出前一页的值
但是当register_global = Off 的时候就打印出空值了。
于是就把服务器的php.ini里的register_globals改为on就没有问题了。

后来又想,如果服务器不是自己的,自己没办法改该怎么做呢,就上网搜了一下。发上来吧。

********************************************************************

比如在
cardlist.php?sort=card_new_re&card_author=lidn&bbs_id=&r=1里有一个连接如下:
<a href='edit_card.php?card_id=$card_id&action=del' title='删除该主题'>删</a>

edit_card.php现在是这样写的:

$rs = mysql_query($query);

if($rs){
  echo "<script language=javascript>";
  echo "window.alert('操作成功!');";
  echo "window.location='?????'";
  echo "</script>";
  }

我想知道怎么补充才能让这个程序执行以后回到card.php?sort=card_new_re&card_author=lidn&bbs_id=&r=1

这样的话就用:

$_SERVER['HTTP_REFERER']

$HTTP_SERVER_VARS['HTTP_REFERER']


**********************************************

windows下如何让php支持curl 晴

jed , 2006-11-7 13:50 , 代码编程 , 评论(0) , 阅读(6971) , Via 本站原创
1、拷贝PHP目录中的libeay32.dll 和 ssleay32.dll 两个文件到 system32 目录。
2、修改php.ini:配置好 extension_dir ,去掉 extension = php_curl.dll 前面的分号。
呵呵 就这么简单。

curl
curl是一个利用URL语法在命令行方式下工作的文件传输工具。它支持很多协议:FTP, FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE 以及 LDAP。curl同样支持HTTPS认证,HTTP POST方法, HTTP PUT方法, FTP上传, kerberos认证, HTTP上传, 代理服务器, cookies, 用户名/密码认证, 下载文件断点续传, 上载文件断点续传, http代理服务器管道( proxy tunneling), 甚至它还支持IPv6, socks5代理服务器, 通过http代理服务器上传文件到FTP服务器等等,功能十分强大。Windows操作系统下的网络蚂蚁,网际快车(FlashGet)的功能它都可以做到。准确的说,curl支持文件的上传和下载,所以是一个综合传输工具,但是按照传统,用户习惯称curl为下载工具。
Tags:

php下扩展php_curl.dll的安装 晴

jed , 2006-11-7 13:48 , 代码编程 , 评论(0) , 阅读(5867) , Via 本站原创

下载的是php5.05
已经内置有php_curl.dll,在ext目录下,此DLL用于支持SSL和zlib.
在php.ini中找到有extension=php_curl.dll, 去掉前面的注释.
设置extension_dir=c:\php\ext, 刷新PHP页面时报错, 说找不到模块php_curl.dll.
拷贝php_curl.dll 到windows\system32,还是同样的错.
在网上找了一下,需要将:

libeay32.dll, ssleay32.dll, php5ts.dll, php_curl.dll

都拷贝到system32目录下,重启IIS即可.

Tags:

php curl函数参考 不指定

jed , 2006-11-7 13:45 , 代码编程 , 评论(0) , 阅读(5322) , Via 本站原创
代码



<?php

$ch = curl_init();
$timeout = 10; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, $_GET['q']);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$handles = curl_exec($ch);
curl_close($ch);

echo $handles;

?>



注,curl函数参考
curl_init
Tags:

用CSS给图片加个阴影 不指定

jed , 2006-11-6 14:20 , 代码编程 , 评论(0) , 阅读(3543) , Via 本站原创
具体的实现原理大家可以参考这篇文章
原文:http://www.alistapart.com/articles/cssdropshadows
中文翻译:http://www.onestab.net/a/ala/cssdropshadows.html
如果不想了解那么透彻的话,或者看了不太明白的,可以把下面的类加入到你的CSS中
只是发日志的时候有点麻烦,需要把你要加阴影的图片插入到< div class="img-shadow">< div>< /div>< /div>中,只插入到< div class="img-shadow">< /div>中就只有白边没有阴影了。
另外,因为IE不支持透明的PNG图片,所以你要把阴影图片和背景设为同一色才能看到好的效果。(可以看下面的演示图片)

页面跳转代码集合 晴

jed , 2006-11-3 10:49 , 代码编程 , 评论(0) , 阅读(4507) , Via 本站原创
常用php页面跳转代码

常用php页面跳转代码

<meta http-equiv=refresh content='1;url=index.php'>


<script>
url="submit.php?var=<?=$value?>";
window.location.href="/url";
</script>


<script>
window.open('url,'','_self');
</script>


<?
$page="index.php?bianliang=".$bianliang;
echo "<SCRIPT>window.location = \"".$page."\"; </SCRIPT>";
?>



<meta http-equiv=refresh content="1;url=index.php?aaa=<? echo $aaa ?>">



ASP页面:
<%response.redirect "页面路径"%>

有好几种方法:
(1)在页面中跳转:加入以下句子,2秒后跳到test.html
 
<meta HTTP-EQUIV=REFRESH CONTENT='2; URL=test.html'>  

(2)2秒后转到ly2.php
 
<script>setTimeout("location.href="/home/ly2.php'",2000)</script>

(3)在php中用header()函数跳转:
 
header("Location :http://www.xxx.com");

(4)用一个按钮,点击后跳转:(5种按钮)
 


<input type=button value=Return onClick

="javascript:location.href('URL');">
  <input type=button value=Return onClick=

"javascript:window.location.href('URL');">
  <input type=button value=Return onClick

="javascript:window.location.replace('URL');">
  <input type=button value=Return onClick

="javascript:window.location.assign('URL');">
  <input type="button" value="Return" onClick

="window.location='URL'" /><!--这种最好-->



分页: 18/26 第一页 上页 13 14 15 16 17 18 19 20 21 22 下页 最后页 [ 显示模式: 摘要 | 列表 ]