/*
至于发邮件就更加简单,可以使用mail()函数mail("收件人地址","主题","正文","From:发件人 Reply-to:发件人的地址");
不过mail()需要服务器的支持,在WINDOWS下还需要配置SMTP服务器,一般来说外面的LINUX空间都行。
好像上传文件和发邮件比ASP简单很多,只要调用函数就可以了。ASP还需要用到服务器的不同组件比如FSO、JMAIL什么的。
下面来看文件上传实例
传文件表单必须加上enctype="multipart/form-data"和
代码如下 | 复制代码 |
$f=&$HTTP_POST_FILES['file']; $dest_dir='uploads';//设定上传目录 $dest=$dest_dir.'/'.date("ymd")."_".$f['name'];//我这里设置文件名为日期加上文件名避免重复 $r=move_uploaded_file($f['tmp_name'],$dest); chmod($dest, 0755);//设定上传的文件的属性 |
上传的文件名为date("ymd")."_".$f['name'] ,可以在以后插入到数据库教程的时候用到,PHP实际上是把你上传的文件从临时目录移动到指定目录。
move_uploaded_file($f['tmp_name'],$dest);这是关键

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
