首页 > PHP教程

php 文件上传简单实例应用

<html>
<head><title>php 文件上传简单实例应用</title></head>
<body>

<!-- 表单的enctype属性必须指定为multipart/form-data -->
<form enctype="multipart/form-data" action="3.php" method="post">
    上传此文件: <input name="myfile" type="file" />
    <input type="submit" value="提交上传" />
</form>

阅读全文

php feof函数

语法
feof(file)参数 描述
file 必需。规定要检查的打开文件。

说明
file 参数是一个文件指针。这个文件指针必须有效,并且必须指向一个由 fopen() 或 fsockopen() 成功打开(但还没有被 fclose() 关闭)的文件。

阅读全文

php+mysql+js实现树形菜单代码

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>类别目录树</title>
<script type="text/网页特效">
function showmenu(menuid)
{
if(menuid.style.display=="none"){
menuid.style.display="";
}
else{
menuid.style.display="none";
}
}
</script>
<style>
body{margin:0px;}
table tr td{font-size:12px}
</style>
</head>
<body>

阅读全文

php文件上传代码

<form name="form1" enctype="multipart/form-data" method="post" action="">
  <label for="filefield"></label>
  <input type="file" name="filefield" id="filefield">
  <input type="submit" name="button" id="button" value="上传文件">
</form>
<?php
/*
 * $name;     上传文件名
 * $size:    上传文件大小
 * $path;     文件原路径
 * $newpath:  设置新路径
 * $not:      禁止上传的文件类型数组
 * $notsize:  限制文件大小的值
 * $move:     上传文件源
 *
 */

阅读全文

php ajax注册验证用户名是否存在代码

conn.php文件

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<script >
var xmlhttp
function showhint(str)
{
if (str.length==0)
  {
  document.getelementbyid("txthint").innerhtml=""
  return
  }
xmlhttp=getxmlhttpobject()
if (xmlhttp==null)
  {
  alert ("browser does not support http request")
  return
  }
xmlhttp.onreadystatechange=statechanged

阅读全文

通过ICQ网关发送手机短信的PHP源程序

//###########################################################
//
// for questions and comments
// roland (alias -=: vlieg :=-)
// icq #78354631
// mail: vlieg@atoomnet.net
//
// nb: this script won't work on free hosting pages, because of the secure mode!
// nb: you must have registered your icq# at http://web.icq.com/sms/login/ in order for this script to work
//###########################################################

阅读全文

php ExcelReader 读取Excel类

$allow_url_override = 1; // set to 0 to not allow changed via post or get
if(!$allow_url_override || !isset($file_to_include))
{
 $file_to_include = "phprm.com.xls";
}
if(!$allow_url_override || !isset($max_rows))
{
 $max_rows = 0; //use 0 for no max
}
if(!$allow_url_override || !isset($max_cols))
{
 $max_cols = 5; //use 0 for no max
}
if(!$allow_url_override || !isset($debug))
{
 $debug = 0;  //1 for on 0 for off
}
if(!$allow_url_override || !isset($force_nobr))
{
 $force_nobr = 1;  //force the info in cells not to wrap unless stated explicitly (newline)
}

阅读全文