0
由於某種原因,我得到錯誤500在本文件:爲什麼我得到錯誤500?
http://apps.sce.ac.il/testxml/parser.php
這是phpinfo()
: http://apps.sce.ac.il/testxml/phpinfo.php
這是代碼:
<?php
header("Content-type: text/html; charset=utf-8");
$record = array(
'event' => $_POST['event'],
'eventDate' => $_POST['eventDate'],
'desc' => $_POST['desc'],
);
$doc = new DOMDocument();
$doc->load('events.xml');
$doc->formatOutput = true;
$r = $doc->getElementsByTagName("events")->item(0);
$b = $doc->createElement("record");
$event = $doc->createElement("event");
$event->appendChild(
$doc->createTextNode($record["event"])
);
$b->appendChild($event);
$eventDate = $doc->createElement("eventDate");
$eventDate->appendChild(
$doc->createTextNode($record["eventDate"])
);
$b->appendChild($eventDate);
$desc = $doc->createElement("desc");
$desc->appendChild(
$doc->createTextNode($record["desc"])
);
$b->appendChild($desc);
$r->insertBefore($b,$r->firstChild);
$doc->save("events.xml");
header("Location: {$_SERVER['HTTP_REFERER']}");
?>
您是否在php.ini中啓用了錯誤報告? – 2011-01-10 20:20:50
你有權訪問你的`error.log`嗎?然後在那裏檢查錯誤的確切原因。 – 2011-01-10 20:21:03