All pastes #709368 Raw Edit

Unnamed

public text v1 · immutable
#709368 ·published 2007-09-24 16:55 UTC
rendered paste body
<html><body>
<form action="process.php" method="post">
<b>Upload Graphs</b><br/>
Pie Chart (Size: 333x328): <input name="pie" type="file" /> <br/>
Graph (Size: 801x527): <input name="graph" type="file" /> <br/><br/>

=============

error_reporting(E_ALL);
print_r($_FILES);

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['pie']['name']); 

if(move_uploaded_file($_FILES['pie']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['pie']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the pie chart, please try again!";
}

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES['graph']['name']);

if(move_uploaded_file($_FILES['graph']['tmp_name'], $target_path)) {
    echo "The file ".  basename( $_FILES['graph']['name']). 
    " has been uploaded";
} else{
    echo "There was an error uploading the graph, please try again!";
}