php教程 curl模仿ftp<?
if (isset($_post[
if (!empty($_files[
$ch = curl_init();
$localfile = $_files[
$fp = fopen($localfile
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_exec ($ch);
$error_no = curl_errno($ch);
curl_close ($ch);
if ($error_no ==
$error =
} else {
$error =
}
} else {
$error =
}
}
?>
好了下面封閉成類了
<?php
class curl_ftp
{
private $ftpname; //ftp用戶名
private $ftppaw; //ftp密碼
private $urlftp; //ftp地址
private $filename; //文件名
public __construct($name
{
$this
$this
$this
// $this
}
public function getftp()
{
if (isset($_post[
{
if (!empty($_files[
{
$ch = curl_init();
$this
$fp = fopen($this
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_setopt($ch
curl_exec ($ch);
$error_no = curl_errno($ch);
curl_close ($ch);
if ($error_no ==
{
$error =
}
else
{
$error =
}
}
else
{
$error =
}
}
}
}
From:http://tw.wingwit.com/Article/program/PHP/201405/30966.html