Avatar billede mr-tuborg Nybegynder
14. september 2006 - 00:11 Der er 1 kommentar

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>";
}
?>
Avatar billede mr-tuborg Nybegynder
14. september 2006 - 00:11 #1
den Gider ikke at Uploade Billeder op på mit domæne
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester