I have some data stored in an XML file and want to be able to edit that through an HTML form on a PHP page. In the PHP page I'm calling an XSL file to turn the XML file into an HTML form and this works:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h2>My data</h2>
<form action="test.php" method="post">
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">Title</th>
<th style="text-align:left">Date</th>
</tr>
<xsl:for-each select="events/event">
<tr>
<td>Title: <input type="text" id="title" name="title" value="{title}"></input></td>
<td>Date: <input type="text" id="date" name="date" value="{date}"></input></td>
</tr>
</xsl:for-each>
<tr><td></td><td><input type="submit" value="Submit"/></td></tr>
</table>
</form>
</xsl:template>
</xsl:stylesheet>
But I want this form to submit to the PHP page that it was called from. This is an XSL file so PHP code isn't being processed so I can't change the form action to:
"<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>
Is it possible to run this PHP code in an XSL file so that it sends the form contents back to the same PHP page?