I'm new to programming so any guidance would be great, what I'm trying to achieve is as follows:
For instace
I want to capture the content of a text area name "articlebody" and have it saved on the file under the tag
Can someone point me to the right tutorials? Or upload a snippet? Thanks for your time.
Going off the top of my head:
form:
<form action="" method="POST">
1. filename: <input type="text" name="filename" /><br />
2. field 1: <input type="text" name="field1" /><br />
3. field 2: <input type="text" name="field2" /><br />
</form>
script:
$filename = $_POST['filename'];
$field1 = $_POST['field1'];
$field2 = $_POST['field2'];
$field1 = htmlspecialchars($field1);
$field2 = htmlspecialchars($field2);
$xml = <<<EOL
<rootnode>
<field>$field1</field>
<field>$field2</field>
</rootnode>
EOL;
header('Content-type: text/xml');
header('Content-length: ' . strlen($xml));
header("Content-disposition: attachment;filename=$filename");
echo $xml;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.