BBS水木清华站∶精华区

发信人: DBPZ (小石头※从头再来), 信区: Linux        
标  题: Re: 问个php的笨问题 
发信站: BBS 水木清华站 (Fri Feb 11 15:28:40 2000) 
 
【 在 yeung (流星雨) 的大作中提到: 】 
 举例说明: 
 1.重新定向 
 cgi输出 location:http://your.url.here/yourfile_location 
 
HEADER("Location: http://url/file.ext"); 
 
 或者在页面顶端输出一些javascrpit: document.locaction = &*(^@#&*(^@&*$^@ 
 
这个不太好,好多浏览器用不了而且不够标准 
 
 2.输出文件 
 cgi输出,比如asp里面(php偶不会) 
 输出一个bmp文件 
 Response.ContentType ="image/x-xbitmap"; 
 Response.Write ("#define counter_width 8\r\n");  //图形宽 
 Response.Write ("#define counter_height 10\r\n");//图形高 
 Response.Write ("static unsigned char counter_bits[]={\r\n"); 
 Response.Write ("0x3c,0x66,0x60,0x60,0x30,0x18,0x0c,0x06,0x06,0x7e"); 
 Response.Write ("};\r\n"); 
 
这个更简单了 
 
HEADER("Content-type:image/??????"); 
 
然后用GD库随便画,画完了可以生成GIF 
 
 
-- 
  DBPZ想和你作朋友呢... 
    ^     ^ 
    .  H  . 
       V 
     \___/ 
   CERNET中成长最快的9#网站 http://166.111.136.3  个人HOME http://cu.dhs.org   
 
※ 来源:·BBS 水木清华站 smth.org·[FROM: 202.112.45.46] 

BBS水木清华站∶精华区