rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>1st Test Uploader</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style2 {
font-size: 14px;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>
<body>
<?php
$uploadLocation = "c:\\";
?>
<?php
if (isset($_POST['submitBtn'])){
?>
<?php
$target_path = $uploadLocation . basename( $_FILES['upfile']['name']);
if(move_uploaded_file($_FILES['upfile']['tmp_name'], $target_path)) {
echo "The file: ". basename( $_FILES['upfile']['name']).
" has been uploaded!";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
<?php
}
?>
<?php
$file = "test.xml";
function contents($parser, $description){
echo $description;
}
function startTag($parser, $description){
echo "<b>";
}
function endTag($parser, $description){
echo "</b><br />";
}
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startTag", "endTag");
xml_set_character_data_handler($xml_parser, "contents");
$fp = fopen($file, "r");
$data = fread($fp, 80000);
if(!(xml_parse($xml_parser, $description, feof($fp)))){
die("Error on line " . xml_get_current_line_number($xml_parser));
}
xml_parser_free($xml_parser);
fclose($fp);
?>
<div id="main">
<div id="caption">UPLOAD FILE</div>
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="fileForm" id="fileForm" enctype="multipart/form-data">
File to upload:<center>
<table>
<tr>
<td><label>
<input name="description" type="text" id="description" size="30" maxlength="30" />
</label>
<span class="style2">Description</span><br />
<input name="upfile" type="file" size="36"></td></tr>
<tr><td align="center"><br/><input class="text" type="submit" name="submitBtn" value="Upload"></td></tr>
</table>
</center>
</form>
<div id="caption">RESULT</div>
<div id="icon2"> </div>
<div id="result">
<table width="100%">
</table>
</div>
<div>
</body>