本文介绍了从php转换为asp.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php

//print_r($_FILES);
$host = "www.makemyapplication.in"; //database location
$user = "makemyapp"; //database username
$pass = "Dke5@8eg"; //database password
//$db_name = "Dke5@8eg"; //database name
$conn_id = ftp_connect($host) or die ("Cannot connect to host");
ftp_login($conn_id, $user, $pass) or die("Cannot login");

$state = $_GET["state"];
$district = $_GET["district"];
$urn = $_GET["urn"];
$claimid = $_GET["claimid"];
$target_path = "investigation/".$state."/".$district."/".$urn."/".$claimid."/";
echo $target_path;
if(is_dir($target_path))
{
	$target_path = $target_path . basename( $_FILES[''uploadedfile''][''name'']);

echo $_FIlES[''uploadedfile''][''error''];
//die;

if(move_uploaded_file($_FILES[''uploadedfile''][''tmp_name''], $target_path)) {
	
$url = "www.makemyapplication.in/Moble/fileupload/uploads/". basename( $_FILES[''uploadedfile''][''name'']);
//mysql_query("insert into custom_card_info (url,filename,imei,date_time) values (''".$url."'',''".basename( //$_FILES[''uploadedfile''][''name''])."'',''".$_GET[''imei'']."'',''".date("Y-m-d : H:i:s", time())."'')"); 

echo  "www.makemyapplication.in/Moble/fileupload/uploads/". basename( $_FILES[''uploadedfile''][''name'']);

}
else
{
	echo "There was an error uploading the file, please try again!";
}
}
else
{
	mkdir($target_path, 0, true);

	$target_path = $target_path . basename( $_FILES[''uploadedfile''][''name'']);

echo $_FIlES[''uploadedfile''][''error''];

if(move_uploaded_file($_FILES[''uploadedfile''][''tmp_name''], $target_path)) {
	
$url = "www.makemyapplication.in/Moble/fileupload/uploads/". basename( $_FILES[''uploadedfile''][''name'']);
//mysql_query("insert into custom_card_info (url,filename,imei,date_time) values (''".$url."'',''".basename( //$_FILES[''uploadedfile''][''name''])."'',''".$_GET[''imei'']."'',''".date("Y-m-d : H:i:s", time())."'')"); 

echo  "www.makemyapplication.in/Moble/fileupload/uploads/". basename( $_FILES[''uploadedfile''][''name'']);

}
else
{
	echo "There was an error uploading the file, please try again!";
}
}
//$target_path = "uploads/";


?>

推荐答案




这篇关于从php转换为asp.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 22:39