Skip to content

Instantly share code, notes, and snippets.

@kcrwfrd
Created March 8, 2011 04:12
Show Gist options
  • Save kcrwfrd/859832 to your computer and use it in GitHub Desktop.
Save kcrwfrd/859832 to your computer and use it in GitHub Desktop.
$xml = simplexml_load_file($_SERVER['DOCUMENT_ROOT'] . $url . "hotw-admin/xml/hotw.xml");
$element = $xml->xpath("//hotw[@id='" . $_GET['id'] . "']");
$element = $element[0];
$element['id'] = $_POST['id'];
$element->homesite = $_POST['homesite'];
$element->residence = $_POST['residence'];
$element->sqft = $_POST['sqft'];
$element->bed = $_POST['bed'];
$element->bath = $_POST['bath'];
$dom = dom_import_simplexml($element->desc);
$cdata = $dom->ownerDocument->createCDataSection($_POST['desc']);
$dom = $dom->appendChild($cdata);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment