problemer med errors i admin del - administration af blog
Hejsa..Nogen der lige kan finde fejlene i den her kode?
Mozilla giver disse fejl:
Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft OLE DB Provider for ODBC Drivers Description: [Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xbf8 Thread 0xb78 DBC 0x807f3c Jet'. in H:\Web Sites\Nelly\projects\admin\adminblog.php on line 11
Warning: (null)(): Invoke() failed: Exception occurred. Source: ADODB.Connection Description: Operation is not allowed when the object is closed. in H:\Web Sites\Nelly\projects\admin\adminblog.php on line 12
Fatal error: Maximum execution time of 30 seconds exceeded in H:\Web Sites\Nelly\projects\admin\adminblog.php on line 14
Håber der er en der vil hjælpe!
MVH
Michelle Nielsen!
<?php
session_start();
if ($_SESSION['loggetind'] != "loggetind") {
header("Location: loginform.php");
}
$db_connection = new COM("ADODB.Connection");
$db_connstr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" . getcwd() . "//_rw_access/blog.mdb";
$db_connection->open( $db_connstr );
$rs = $db_connection->execute( "select * from blog ORDER BY dato");
while ( ! $rs->EOF )
?>
<input type="date"><?php echo $rs->Fields["dato"]->value; ?></textarea>
<input type="textarea"><?php echo $rs->Fields["emne"]->value; ?></textarea>
<input type="textarea"><?php echo $rs->Fields["skrevet"]->value; ?> </textarea>
</textarea>
<input type="textarea"><?php echo $rs->Fields["Blog indlæg"]->value; ?> </textarea>
<?php
ob_start();
$db_connection->open( $db_connstr );
function htmlEncodeText($myHTML) {
$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES);
$translation_table[chr( 38)] = '&';
return preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,4};)/", "&" , strtr( $myHTML, $translation_table));
}
$strSQL = "INSERT INTO blog (dato, emne, skrevet, blog indlæg) VALUES('" . htmlEncodeText($_POST["navn"]) . "', '" . htmlEncodeText($_POST["blog indlæg"]) . "', '" . htmlEncodeText($_POST["emne"]) . "', '" . htmlEncodeText($_POST["skrevet"]) . "', '" . date("Y-m-d") . " " . $_SERVER['REQUEST_TIME'] ."')";
echo $strSQL;
$db_connection->execute( $strSQL );
echo "Din besked er blevet tilføjet";
$db_connection->close;
header("Location: ".$_POST['sti']."");
ob_flush();
?>