Why do i get error 500?
for some reason i get error 500 in this file:
http://apps.sce.ac.il/testxml/parser.php
this is the phpinfo()
:
http://apps.sce.ac.il/testxml/phpinfo.php
this is the code:
<?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']}");
?>
you probably have turned off error reporting, which lets your webserver only transmit the error code.
try putting this at the top of your php file script:
error_reporting(E_ALL);
ini_set("display_errors",1);
then you should see your exact error.
you can also check your webserver logs.
精彩评论