易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP上传

/***************************by garcon1986**************************/
form.html
<html>
<head>
<title>Upload File</title>
</head>
<body>
<form enctype="multipart/form-data" method="POST" action="uploader.php">
<label></label>
<input type="file" name="uploadfile" />
<input type="submit" name="submit" value="submit" />
</form>
</body>
</html>
uploader.php
<?php
if($_FILES["uploadfile"]["size"] < 100000000){
if($_FILES["uploadfile"]["error"]>0){
echo "error";
}
else{
echo "success";
if(file_exists("c:/wamp/www/upload/".$_FILES["uploadfile"]["name"])){
echo "File".$_FILES["uploadfile"]["name"]."already exists";
}
else{
move_uploaded_file($_FILES["uploadfile"]["tmp_name"],"c:/wamp/www/upload/".$_FILES["uploadfile"]["name"]);
echo "Move to c:/wamp/www/upload/".$_FILES["uploadfile"]["name"];
}
}
}
else{
echo "Invalide file";
}
?>


相关文档:

php tips

5.关于表单刷新
问:为什么我在点击浏览器的后退按钮后,所有字段的信息都被清空了?
答:这是由于你在你的表单提交页面中使用了 session_start 函数。该函数会强制当前页面不被缓存。解决办法为,在你的 Session_start 函数后加入 header("Cache-control: private"); 注意在本行之前你的PHP程序不能有任何输出。
补充: ......

Nginx+PHP+MySQL双机互备、全自动切换方案[转]

在生产应用中,某台“Nginx+PHP+MySQL”接口数据服务器,扮演的角色十分重要,如果服务器硬件或Nginx、MySQL发生故障,而短时间内无法恢复,后果将非常严重。为了避免单点故障,我设计了此套方案,编写了failover.sh脚本,实现了双机互备、全自动切换,故障转移时间只需几十秒。
  一、双机互备、全自动切换方 ......

深思 PHP 数组遍历的差异(array_diff 的实现)

还是
部门无聊的考题,不过这次考的是 PHP
的能力。题目如下:
给你两个分别有 5000 个元素的数组,计算他们的差集
-- 说白了也就是用 PHP 和你认为最好的算法实现 array_diff 的算法。
初次接到这个题目,我发现这非常的简单,
于是按照以往的经验“随便”写了一个:
function array_diff($array_1, $ ......

PHP分页程序源码

<!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=gb2312" />
<title>PHP分页</tit ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号