Hvorfor pludselig
Den har længe kørt uden problemer men nu er der fejl hvorfor og hvad kan jeg gøre?FEJLEN:
Warning: fopen(): Filename cannot be empty in /customers/2/d/b/domain.dk/httpd.www/hardlife/hw_db_scripts.php on line 29 Warning: fread() expects parameter 1 to be resource, boolean given in /customers/2/d/b/domain.dk/httpd.www/hardlife/hw_db_scripts.php on line 29 Warning: Cannot modify header information - headers already sent by (output started at /customers/2/d/b/domain.dk/httpd.www/hardlife/hw_db_scripts.php:29) in /customers/2/d/b/domain.dk/httpd.www/hardlife/hw_db_scripts.php on line 43
SCRIPTET:
<?
include('config.php');
@session_start();
//If the user tries to login, it checks if the login information is correct
if($_POST['username']) {
if($_POST['username'] == $login['username'] && $_POST['password'] == $login['password']) {
$_SESSION['news_module'] = 1;
header("Location: " . $_REQUEST['return']);
exit;
} else {
echo'Login fejl!<br/><a href="' . $_REQUEST['return'] . '">Gå tilbage og prøv igen!</a>';
exit;
}
}
//Checks if the user is logged in
if(!$_SESSION['news_module']) {
header("Location: " . $_REQUEST['return']);
exit;
} else {
//A connection to MySQL is created
mysql_connect($mysql['host'],$mysql['user'],$mysql['password']) or die (mysql_error());
mysql_select_db($mysql['db']) or die (mysql_error());
$data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
if($_REQUEST['action'] == 'add') {
mysql_query("INSERT INTO `hw_db_module` SET `s_n`='" . $_POST['s_n'] . "', `mac`='" . $_POST['mac'] . "', `indkob`='" . $_POST['indkob'] . "', `kunde`='" . $_POST['kunde'] . "', `bin_data`='" . $data . "', `filename`='" . $form_data_name . "', `filesize`='" . $form_data_size . "', `filetype`='" . $form_data_type . "', `cpu`='" . $_POST['cpu'] . "', `ram_storelse`='" . $_POST['ram_storelse'] . "', `ram_type`='" . $_POST['ram_type'] . "', `bundkort`='" . $_POST['bundkort'] . "', `kabinet`='" . $_POST['kabinet'] . "', `lager_storelse`='" . $_POST['lager_storelse'] . "', `lager_type`='" . $_POST['lager_type'] . "', `optisk_drev`='" . $_POST['optisk_drev'] . "', `gfx`='" . $_POST['gfx'] . "', `psu`='" . $_POST['psu'] . "', `os`='" . $_POST['os'] . "', `installeret_af`='" . $_POST['installeret_af'] . "', `ms_valid_licens`='" . $_POST['ms_valid_licwns'] . "', `kommentarer`='" . $_POST['kommentarer'] . "', `baerbar`='" . $_POST['baerbar'] . "', `solg_som_ny`='" . $_POST['solg_som_ny'] . "', `saelger`='" . $_POST['saelger'] . "', `time`='" . time() . "', `historik`='" . $_POST['historik'] . "'") or die (mysql_error());
}
if($_REQUEST['action'] == 'edit') {
mysql_query("UPDATE `hw_db_module` SET `s_n`='" . $_POST['s_n'] . "', `mac`='" . $_POST['mac'] . "', `indkob`='" . $_POST['indkob'] . "', `kunde`='" . $_POST['kunde'] . "', `cpu`='" . $_POST['cpu'] . "', `ram_storelse`='" . $_POST['ram_storelse'] . "', `ram_type`='" . $_POST['ram_type'] . "', `bundkort`='" . $_POST['bundkort'] . "', `kabinet`='" . $_POST['kabinet'] . "', `lager_storelse`='" . $_POST['lager_storelse'] . "', `lager_type`='" . $_POST['lager_type'] . "', `optisk_drev`='" . $_POST['optisk_drev'] . "', `gfx`='" . $_POST['gfx'] . "', `psu`='" . $_POST['psu'] . "', `os`='" . $_POST['os'] . "', `installeret_af`='" . $_POST['installeret_af'] . "', `ms_valid_licens`='" . $_POST['ms_valid_licwns'] . "', `kommentarer`='" . $_POST['kommentarer'] . "', `baerbar`='" . $_POST['baerbar'] . "', `solg_som_ny`='" . $_POST['solg_som_ny'] . "', `saelger`='" . $_POST['saelger'] . "', `time`='" . time() . "', `historik`='" . $_POST['historik'] . "' WHERE `id`=" . $_REQUEST['id']) or die (mysql_error());
}
if($_REQUEST['delete']) {
mysql_query("DELETE FROM `hw_db_module` WHERE `id`=" . $_REQUEST['delete']) or die (mysql_error());
}
header("Location: " . $_REQUEST['return']);
exit;
}
?>