📄 1870.html
字号:
<br>
Echo "上传文件的大小超过了 HTML 表单中 MAX_FILE_SIZE 选项指定的值。"; break;<br>
<br>
case 3:<br>
<br>
Echo "文件只有部分被上传";break;<br>
<br>
case 4:<br>
<br>
Echo "没有文件被上传";break;<br>
<br>
}<br>
<br>
?><br>
<br>
<br>
<br>
<br>
<br>
<br>
14:如何配置GD库<br>
<br>
<br>
下面是我的配置过程<br>
1:用dos命令(也可以手动操作,拷贝dlls文件夹里所有dll文件到system32目录下) copy c:phpdlls*.dll c:windowssystem32<br>
2:打开php.ini<br>
设置extension_dir = "c:/php/extensions/";<br>
3:<br>
extension=php_gd2.dll;把extension前面的逗号去掉,如果没有php_gd2.dll,php_gd.dll也一样,保证确实存在这一文件c:/php/extensions/php_gd2.dll<br>
4:运行下面程序进行测试<br>
<br>
PHP代码:<br>
<br>
<?php<br>
<br>
Ob_end_flush();<br>
<br>
//注意,在此之前不能向浏览器输出任何信息,要注意是否设置了 auto_prepend_file.<br>
<br>
header ("Content-type: image/png");<br>
<br>
$im = @imagecreate (200, 100)<br>
<br>
or die ("无法创建图像");<br>
<br>
$background_color = imagecolorallocate ($im, 0,0, 0);<br>
<br>
$text_color = imagecolorallocate ($im, 230, 140, 150);<br>
<br>
imagestring ($im, 3, 30, 50, "A Simple Text String", $text_color);<br>
<br>
imagepng ($im);<br>
<br>
?><br>
<br>
<br>
<br>
<br>
<br>
<br>
点击这里查看结果<br>
<br>
<br>
<br>
15:什么是UBB代码<br>
<br>
<br>
UBB代码是HTML的一个变种,是Ultimate Bulletin Board (国外一个BBS程序,国内也有不少地方使用这个程序)采用的一种特殊的TAG.<br>
即使禁止使用 HTML,你也可以用 UBBCode? 来实现.也许你更希望使用 UBBCode? 而不是 HTML, 即使论坛允许使用 HTML, 因为使用起来代码较少也更安全.<br>
<br>
Q3boy的UBB里面付有例子,可以直接运行测试<br>
<br>
<br>
16:我想修改MySQL的用户,密码<br>
<br>
首先要声明一点,大部分情况下,修改MySQL是需要有mysql里的root权限的,<br>
所以一般用户无法更改密码,除非请求管理员.<br>
<br>
方法一<br>
使用phpmyadmin,这是最简单的了,修改mysql库的user表,<br>
不过别忘了使用PASSWORD函数。<br>
<br>
方法二<br>
使用mysqladmin,这是前面声明的一个特例。<br>
mysqladmin -u root -p password mypasswd<br>
输入这个命令后,需要输入root的原密码,然后root的密码将改为mypasswd。<br>
把命令里的root改为你的用户名,你就可以改你自己的密码了。<br>
当然如果你的mysqladmin连接不上mysql server,或者你没有办法执行mysqladmin,<br>
那么这种方法就是无效的。<br>
而且mysqladmin无法把密码清空。<br>
<br>
下面的方法都在mysql提示符下使用,且必须有mysql的root权限:<br>
方法三<br>
mysql> INSERT INTO mysql.user (Host,User,Password)<br>
VALUES('%','jeffrey',PASSWORD('biscuit'));<br>
mysql> FLUSH PRIVILEGES<br>
确切地说这是在增加一个用户,用户名为jeffrey,密码为biscuit。<br>
在《mysql中文参考手册》里有这个例子,所以我也就写出来了。<br>
注意要使用PASSWORD函数,然后还要使用FLUSH PRIVILEGES。<br>
<br>
方法四<br>
和方法三一样,只是使用了REPLACE语句<br>
mysql> REPLACE INTO mysql.user (Host,User,Password)<br>
VALUES('%','jeffrey',PASSWORD('biscuit'));<br>
mysql> FLUSH PRIVILEGES<br>
<br>
方法五<br>
使用SET PASSWORD语句,<br>
mysql> SET PASSWORD FOR jeffrey@"%" = PASSWORD('biscuit');<br>
你也必须使用PASSWORD()函数,<br>
但是不需要使用FLUSH PRIVILEGES。<br>
<br>
方法六<br>
使用GRANT ... IDENTIFIED BY语句<br>
mysql> GRANT USAGE ON *.* TO jeffrey@"%" IDENTIFIED BY 'biscuit';<br>
这里PASSWORD()函数是不必要的,也不需要使用FLUSH PRIVILEGES。<br>
<br>
注意: PASSWORD() [不是]以在Unix口令加密的同样方法施行口令加密。<br>
<br>
<br>
17:我想知道他是通过哪个网站连接到本页<br>
<br>
<br>
PHP代码:<br>
<br>
<?php<br>
<br>
//必须通过超级连接进入才有输出<br>
<br>
Echo $_SERVER['HTTP_REFERER'];<br>
<br>
?><br>
<br>
<br>
<br>
<br>
<br>
<br>
18:数据放入数据库和取出来显示在页面需要注意什么<br>
<br>
入库时<br>
$str=addslashes($str);<br>
$sql="insert into `tab` (`content`) values('$str')";<br>
出库时<br>
$str=stripslashes($str);<br>
显示时<br>
$str=htmlspecialchars(nl2br($str)) ;<br>
<br>
<br>
<br>
<br>
<br>
19:如何读取当前地址栏信息<br>
<br>
<br>
PHP代码:<br>
<br>
<?php <br>
<br>
$s="http://{$_SERVER['HTTP_HOST']}:{$_SERVER["SERVER_PORT"]}{$_SERVER['SCRIPT_NAME']}"; <br>
<br>
$se=''; <br>
<br>
foreach ($_GET as $key => $value) { <br>
<br>
$se.=$key."=".$value."&"; <br>
<br>
} <br>
<br>
$se=Preg_Replace("/(.*)&$/","$1",$se); <br>
<br>
$se?$se="?".$se:"";<br>
<br>
echo $s."?$se"; <br>
<br>
?> <br>
<br>
<br>
<br>
<br>
<br>
20:我点击后退按钮,为什么之前填写的东西不见<br>
<br>
这是因为你使用了session.<br>
解决办法:<br>
<br>
PHP代码:<br>
<br>
<?php <br>
<br>
session_cache_limiter('private, must-revalidate');<br>
<br>
session_start(); <br>
<br>
...........<br>
<br>
..........<br>
<br>
?><br>
<br>
<br>
<br>
<br>
<br>
<br>
21:怎么在图片里显示IP地址<br>
<br>
PHP代码:<br>
<br>
<?<br>
<br>
Header("Content-type: image/png");<br>
<br>
$img = ImageCreate(180,50);<br>
<br>
$ip = $_SERVER['REMOTE_ADDR'];<br>
<br>
ImageColorTransparent($img,$bgcolor);<br>
<br>
$bgColor = ImageColorAllocate($img, 0x2c,0x6D,0xAF); // 背景颜色<br>
<br>
$shadow = ImageColorAllocate($img, 250,0,0); // 阴影颜色<br>
<br>
$textColor = ImageColorAllocate($img, oxff,oxff,oxff); // 字体颜色<br>
<br>
ImageTTFText($img,10,0,78,30,$shadow,"d:/windows/fonts/Tahoma.ttf",$ip); //显示背景<br>
<br>
ImageTTFText($img,10,0,25,28,$textColor,"d:/windows/fonts/Tahoma.ttf","your ip is".$ip); // 显示IP<br>
<br>
ImagePng($img);<br>
<br>
imagecreatefrompng($img);<br>
<br>
ImageDestroy($img);<br>
<br>
?><br>
<br>
<br>
<br>
<br>
<br>
<br>
22:如何取得用户的真实IP<br>
<br>
PHP代码:<br>
<br>
<? <br>
<br>
function iptype1 () { <br>
if (getenv("HTTP_CLIENT_IP")) { <br>
return getenv("HTTP_CLIENT_IP"); <br>
<br>
} <br>
<br>
else { <br>
return "none"; <br>
<br>
} <br>
<br>
} <br>
<br>
function iptype2 () { <br>
if (getenv("HTTP_X_FORWARDED_FOR")) { <br>
return getenv("HTTP_X_FORWARDED_FOR"); <br>
<br>
} <br>
<br>
else { <br>
return "none"; <br>
<br>
} <br>
<br>
} <br>
<br>
function iptype3 () { <br>
if (getenv("REMOTE_ADDR")) { <br>
return getenv("REMOTE_ADDR"); <br>
<br>
} <br>
<br>
else { <br>
return "none"; <br>
<br>
} <br>
<br>
} <br>
<br>
function ip() { <br>
$ip1 = iptype1(); <br>
<br>
$ip2 = iptype2(); <br>
<br>
$ip3 = iptype3(); <br>
<br>
if (isset($ip1) && $ip1 != "none" && $ip1 != "unknown") { <br>
return $ip1; <br>
<br>
} <br>
<br>
elseif (isset($ip2) && $ip2 != "none" && $ip2 != "unknown") { <br>
return $ip2; <br>
<br>
} <br>
<br>
elseif (isset($ip3) && $ip3 != "none" && $ip3 != "unknown") { <br>
return $ip3; <br>
<br>
} <br>
<br>
else { <br>
return "none"; <br>
<br>
} <br>
<br>
} <br>
<br>
<br>
<br>
Echo ip(); <br>
<br>
?> <br>
<br>
<br>
<br>
<br>
23:如何从数据库读取三天内的所有记录<br>
<br>
首先表格里要有一个DATETIME字段记录时间,<br>
格式为'2003-7-15 16:50:00'<br>
<br>
SELECT * FROM `xltxlm` WHERE TO_DAYS(NOW()) - TO_DAYS(`date`) <= 3;<br>
<br>
<br>
24:如何远程链接Mysql数据库<br>
<br>
<br>
在增加用户的mysql表里有一个host字段,修改为"%",或者指定允许连接的ip地址,这样,你就可以远程调用了。<br>
<br>
$link=mysql_connect("192.168.1.80:3306","root","");<br>
<br>
<br>
25:正则到底怎么用<br>
<br>
点击这里<br>
正则表达式中的特殊字符<br>
<br>
<br>
26:用Apache后,主页出现乱码<br>
<br>
<br>
方法一:<br>
AddDefaultCharset ISO-8859-1 改为 AddDefaultCharset off<br>
<br>
方法二:<br>
AddDefaultCharset GB2312<br>
========================================================<br>
tip:<br>
大家贴代码时GB2312会被解释成??????<br>
<br>
改成这样就不会<br>
[color=#000000]GB[/color]2312
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -