All pastes #707792 Raw Edit

Something

public text v1 · immutable
#707792 ·published 2007-09-23 09:24 UTC
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
error_reporting( E_ALL ); ini_set( 'display_errors', 'on' );
$uploadLocation = "c:/";

   
    if (isset($_POST['submitBtn'])){



$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!";
}
            
    }


$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">&nbsp;</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">&nbsp;</div>
      <div id="result">
        <table width="100%">

        </table>
     </div>

    <div>
</body>