er der Fejl i denne Kode vil gerne Vide
<?session_start();
if (session_is_registered("brugernavn") AND ("kodeord")) {
include "../../config.php";
$hent = mysql_query("SELECT * FROM community WHERE brugernavn = '$_SESSION[brugernavn]'") or die(mysql_error());
$vis = mysql_fetch_array($hent);
?>
<?
if($vis[status] == "Normal")
{
echo("<font color=red>Ingen adgang!</font>");
}
?>
<?
if($vis[status] == "Ejer")
{
echo("");
?>
<html>
<head>
<link rel="stylesheet" HREF="../../style1.css" type="text/css">
</head>
</html>
<?
include("../../config.php");
//
// Start: Upload image
//
$ok=0;
if($_FILES["image"]["name"]) {
$size = $_FILES["image"]["size"] / 1024;
if($size > 0 && $size < 1023) {
$fra = $_FILES["image"]["tmp_name"];
$fra2 = $_FILES["image"]["name"];
$tilp = $_FILES["image"]["type"];
$tiltype = strstr($_FILES["image"]["type"],"/");
$tiltype = substr($tiltype,1);
if ($tiltype == "bmp" || $tiltype == "gif" || $tiltype == "pjpeg" || $tiltype == "x-png") {
$tiltype = str_replace("x-png","png",$tiltype);
$tiltype = str_replace("pjpeg","jpg",$tiltype);
$til = "uploadede_billeder/".$fra2;
if(function_exists("move_uploaded_file")) {
move_uploaded_file($fra, $til);
$img = "$til";
$ok=1;
} else {
copy($fra, $til);
$img = "$til";
$ok=1;
}
}else {$error='<font color=red>Forkert fil-format</font>';}
}else {$error='<font color=red>Fil over 1 MB</font>';}
}else {$error='<font color=red>Ingen fil fundet</font>';}
//
// End: Upload image
//
if ($ok) {
$id = $row["id"];
$overskrift = $row["overskrift"];
$image = $row["image"];
$forfatter = $row["forfatter"];
$dato = date('Y-d-m');
$artikel = $row["artikel"];
mysql_query("INSERT INTO upload_artikel_avis (over,image) VALUES ('$img', $over')");
echo(mysql_error());
mysql_close();
echo "Artiklen er tilføjet";
}
else {
echo "Kunne ikke tilføjes, pga.:<br>".$error;
}
?>
<?
}
?>
<?
if($vis[status] == "Redaktør")
{
echo("");
?>
<html>
<head>
<link rel="stylesheet" HREF="../../style1.css" type="text/css">
</head>
<body oncontextmenu="return false">
</html>
<?
include("../../config.php");
//
// Start: Upload image
//
$ok=0;
if($_FILES["image"]["name"]) {
$size = $_FILES["image"]["size"] / 1024;
if($size > 0 && $size < 1023) {
$fra = $_FILES["image"]["tmp_name"];
$fra2 = $_FILES["image"]["name"];
$tilp = $_FILES["image"]["type"];
$tiltype = strstr($_FILES["image"]["type"],"/");
$tiltype = substr($tiltype,1);
if ($tiltype == "bmp" || $tiltype == "gif" || $tiltype == "pjpeg" || $tiltype == "x-png") {
$tiltype = str_replace("x-png","png",$tiltype);
$tiltype = str_replace("pjpeg","jpg",$tiltype);
$til = "uploadede_billeder/".$fra2;
if(function_exists("move_uploaded_file")) {
move_uploaded_file($fra, $til);
$img = "$til";
$ok=1;
} else {
copy($fra, $til);
$img = "$til";
$ok=1;
}
}else {$error='<font color=red>Forkert fil-format</font>';}
}else {$error='<font color=red>Fil over 1 MB</font>';}
}else {$error='<font color=red>Ingen fil fundet</font>';}
//
// End: Upload image
//
if ($ok) {
$id = $row["id"];
$overskrift = $row["overskrift"];
$image = $row["image"];
$forfatter = $row["forfatter"];
$dato = date('d/m/Y');
$artikel = $row["artikel"];
mysql_query("INSERT INTO upload_artikel_avis (over, image) VALUES ('$_POST[over]', '$img')");
mysql_close();
echo "Billedet er nu uploadet";
}
else {
echo "Kunne ikke tilføjes, pga.:<br>".$error;
}
?>
<?
}
?>
<?
if($vis[status] == "vip")
{
echo("");
?>
<html>
<head>
<link rel="stylesheet" HREF="../../style1.css" type="text/css">
</head>
<body oncontextmenu="return false">
</html>
<?
include("../../../config.php");
//
// Start: Upload image
//
$ok=0;
if($_FILES["image"]["name"]) {
$size = $_FILES["image"]["size"] / 1024;
if($size > 0 && $size < 1023) {
$fra = $_FILES["image"]["tmp_name"];
$fra2 = $_FILES["image"]["name"];
$tilp = $_FILES["image"]["type"];
$tiltype = strstr($_FILES["image"]["type"],"/");
$tiltype = substr($tiltype,1);
if ($tiltype == "bmp" || $tiltype == "gif" || $tiltype == "pjpeg" || $tiltype == "x-png") {
$tiltype = str_replace("x-png","png",$tiltype);
$tiltype = str_replace("pjpeg","jpg",$tiltype);
$til = "../../../billeder/".$fra2;
if(function_exists("move_uploaded_file")) {
move_uploaded_file($fra, $til);
$img = "$til";
$ok=1;
} else {
copy($fra, $til);
$img = "$til";
$ok=1;
}
}else {$error='<font color=red>Forkert fil-format</font>';}
}else {$error='<font color=red>Fil over 1 MB</font>';}
}else {$error='<font color=red>Ingen fil fundet</font>';}
//
// End: Upload image
//
if ($ok) {
$id = $row["id"];
$overskrift = $row["overskrift"];
$image = $row["image"];
$forfatter = $row["forfatter"];
$dato = date('d/m/Y');
$artikel = $row["artikel"];
mysql_query("INSERT INTO upload_artikel_avis (over, image) VALUES ('$_POST[over]', '$img')");
mysql_close();
echo "Billedet er nu uploadet";
}
else {
echo "Kunne ikke tilføjes, pga.:<br>".$error;
}
?>
<?
}
?>
<?
if($vis[status] == "Reporter")
{
echo("");
?>
<html>
<head>
<link rel="stylesheet" HREF="../../style1.css" type="text/css">
</head>
<body oncontextmenu="return false">
</html>
<?
include("../../config.php");
//
// Start: Upload image
//
$ok=0;
if($_FILES["image"]["name"]) {
$size = $_FILES["image"]["size"] / 1024;
if($size > 0 && $size < 1023) {
$fra = $_FILES["image"]["tmp_name"];
$fra2 = $_FILES["image"]["name"];
$tilp = $_FILES["image"]["type"];
$tiltype = strstr($_FILES["image"]["type"],"/");
$tiltype = substr($tiltype,1);
if ($tiltype == "bmp" || $tiltype == "gif" || $tiltype == "pjpeg" || $tiltype == "x-png") {
$tiltype = str_replace("x-png","png",$tiltype);
$tiltype = str_replace("pjpeg","jpg",$tiltype);
$til = "uploadede_billeder/".$fra2;
if(function_exists("move_uploaded_file")) {
move_uploaded_file($fra, $til);
$img = "$til";
$ok=1;
} else {
copy($fra, $til);
$img = "$til";
$ok=1;
}
}else {$error='<font color=red>Forkert fil-format</font>';}
}else {$error='<font color=red>Fil over 1 MB</font>';}
}else {$error='<font color=red>Ingen fil fundet</font>';}
//
// End: Upload image
//
if ($ok) {
$id = $row["id"];
$overskrift = $row["overskrift"];
$image = $row["image"];
$forfatter = $row["forfatter"];
$dato = date('d/m/Y');
$artikel = $row["artikel"];
mysql_query("INSERT INTO upload_artikel_avis (over, image) VALUES ('$_POST[over]', '$img')");
mysql_close();
echo "Billedet er nu uploadet";
}
else {
echo "Kunne ikke tilføjes, pga.:<br>".$error;
}
?>
<?
}
?>
<?
if($vis[status] == "Prøve reporter")
{
echo("");
?>
<html>
<head>
<link rel="stylesheet" HREF="../../style1.css" type="text/css">
</head>
<body oncontextmenu="return false">
</html>
<?
include("../../config.php");
//
// Start: Upload image
//
$ok=0;
if($_FILES["image"]["name"]) {
$size = $_FILES["image"]["size"] / 1024;
if($size > 0 && $size < 1023) {
$fra = $_FILES["image"]["tmp_name"];
$fra2 = $_FILES["image"]["name"];
$tilp = $_FILES["image"]["type"];
$tiltype = strstr($_FILES["image"]["type"],"/");
$tiltype = substr($tiltype,1);
if ($tiltype == "bmp" || $tiltype == "gif" || $tiltype == "pjpeg" || $tiltype == "x-png") {
$tiltype = str_replace("x-png","png",$tiltype);
$tiltype = str_replace("pjpeg","jpg",$tiltype);
$til = "uploadede_billeder/".$fra2;
if(function_exists("move_uploaded_file")) {
move_uploaded_file($fra, $til);
$img = "$til";
$ok=1;
} else {
copy($fra, $til);
$img = "$til";
$ok=1;
}
}else {$error='<font color=red>Forkert fil-format</font>';}
}else {$error='<font color=red>Fil over 1 MB</font>';}
}else {$error='<font color=red>Ingen fil fundet</font>';}
//
// End: Upload image
//
if ($ok) {
$id = $row["id"];
$overskrift = $row["overskrift"];
$image = $row["image"];
$forfatter = $row["forfatter"];
$dato = date('d/m/Y');
$artikel = $row["artikel"];
mysql_query("INSERT INTO upload_artikel_avis (over, image) VALUES ('$_POST[over]', '$img')");
mysql_close();
echo "Billedet er nu uploadet";
}
else {
echo "Kunne ikke tilføjes, pga.:<br>".$error;
}
?>
<?
}
?>
<?
}else{
print "<font color=red>Du er ikke logget ind!</font>";
}
?>