if(move_uploaded_file($_FILES['CSV_fileupload']['tmp_name'], $filetarget_path))
{
include 'web_csv.php?fname='.basename( $_FILES['CSV_fileupload']['name']).'';
echo "The file ". basename( $_FILES['CSV_fileupload']['name']).
" has been uploaded";
}
我想在web_csv.php中执行上传的文件
需要像这样通过 web_csv.php?fname =' basename($ _FILES [' CSV_fileupload'] [' name'])';
答案 0 :(得分:0)
我认为您的web_csv.php
期望GET
参数"fname"
试试这个:
if(move_uploaded_file($_FILES['CSV_fileupload']['tmp_name'], $filetarget_path))
{
echo "The file ".basename($_FILES['CSV_fileupload']['name'])." has been uploaded";
$_GET['fname'] = basename( $filetarget_path ); // or just $filetarget_path ?
include 'web_csv.php';
}
答案 1 :(得分:0)
move_uploaded_file
move_uploaded_file
函数返回true
重定向到您的csv_processor.php
或其他任何名称。\n
进行展开即可将每行转换为数组,并将,
转换为每行的数组作为数组。只需在谷歌中使用魔术关键字how to read csv file with php
获取详细信息。