mocha/php/mocha-ccx/xmltest.php
2023-11-11 20:28:45 -05:00

34 lines
621 B
PHP

<!DOCTYPE html>
<html>
<head>
<title>XML test</title>
</head>
<body>
<form method="POST" enctype="multipart/form-data">
<label for="file1">File: </label><input id="file1" name="file1" type="file" />
<input type="submit" value="Upload" />
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] === "POST")
{
$file1 = $_FILES["file1"];
if ($file1["error"] === UPLOAD_ERR_OK)
{
if ($file1["size"] > 100000)
{
die();
}
$yaml = \yaml_parse(file_get_contents($file1["tmp_name"]));
print_r($yaml);
}
else{
print_r($file1);
}
}
?>
</body>
</html>