makexml.php:
Code: Select all
<?php
$str = $_POST['name'];
$xml = "<?xml version='1.0' encoding='UTF-8'?>
<menu>
<item value=".$str.">
</menu>";
$fp = fopen('/myxml.xml', 'w');
fwrite($fp, $xml);
fclose($fp);
?>
Code: Select all
<html>
<head>
</head>
<body>
<form action="/makexml.php" method="post">
<label for="item">Text: </label><input type="text" name="name" id="name" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
No file is being created.Warning: fopen(/myxml.xml) [function.fopen]: failed to open stream: Read-only file system in /makexml.php on line 9
Warning: fwrite(): supplied argument is not a valid stream resource in /html/makexml.php on line 10
Warning: fclose(): supplied argument is not a valid stream resource in /html/makexml.php on line 11
I am really new to PHP, so I am sure that my error must be pretty simple. Help!