B
BlackLove2005
Hallo und guten Abend,
so hab nun mein Forum fast fertig geschreiben nur es hat sich wo der Teufel eingeschlichen und ich weiß nicht wo :suspekt: :suspekt:
Alos das hier ist mein Code:
Aber komisch er trägt nichts in die DB ein. Könnt Ihr mal schauen?
Gruß BlackLove2005
so hab nun mein Forum fast fertig geschreiben nur es hat sich wo der Teufel eingeschlichen und ich weiß nicht wo :suspekt: :suspekt:
Alos das hier ist mein Code:
PHP:
<?PHP
$f = trim(stripslashes($_POST['f']));
$t = trim(stripslashes($_POST['t']));
$variablen = array('name','topic','subtopic','icq','email','website','icon','content');
foreach($variablen as $var)
$$var = str_replace( array('&','\''), array('&','\\''), htmlentities(trim(stripslashes($_POST[$var]))));
if($icon < 0 || $icon > 35) $icon = 0;
if($website != '' && substr($website, 0, 7) != 'http://') $website = 'http://'.$website;
$error = array();
if($name == '') $error[] = 'Kein Name angegeben';
if($topic == '') $error[] = 'Kein Thema angegeben';
if($content == '') $error[] = 'Keine Nachricht angegeben';
include_once('inc/db.con.inc.php');
if(isset($_COOKIE['uniq_id']) && !empty($_COOKIE['uniq_id']))
include 'inc/auth.inc.php';
if(array_shift($db->fetch_row($db->query('select count(id) from 006_user where name = "'.$name.'"'))) > 0 && !(AUTH == OK) && $user_name != $name)
$error[] = 'Dieser Name ist registriert';
if(count($error) > 0) {
include 'forumn.php';
exit;
}
if(!isset($t) || empty($t)) {
list($t) = $db->fetch_row($db->query('select max(tid) + 1 as t from 006_data where fid = "'.$f.'"'));
if(empty($t)) $t = 1;
}
//echo "Test";
//if(defined('AUTH')) echo "ok"; else echo "no";
//ob_start();
include_once 'inc/header.inc.php';
ob_end_clean();
if(defined('AUTH'))
$query = 'insert into 006_data(tid, fid, uid, topic, subtopic, icon, date, content, ip) values ("'.$t.'", "'.$f.'", "'.$user_id.'", "'.$topic.'", "'.$subtopic.'", "'.$icon.'", unix_timestamp(now()), "'.$content.'", "'.getenv('REMOTE_ADDR').'")';
else
$query = 'insert into 006_data (tid, fid, topic, subtopic, icon, name, email, icq, website, date, content, ip) values ("'.$t.'", "'.$f.'", "'.$topic.'", "'.$subtopic.'", "'.$icon.'", "'.$name.'", "'.$email.'", "'.$icq.'", "'.$website.'", unix_timestamp(now()), "'.$content.'", "'.getenv('REMOTE_ADDR').'")';
echo $query;
if($db->query($query)) {
ob_end_clean();
$id = $db->insert_id();
header('location: forum.php?f='.$f.'&t='.$t.'&i='.$id.'#i'.$id);
exit;
} else {
ob_end_flush();
$pid = $f;
$feld = array();
echo '<a href="./">'.$title.'</a> » <a href="forum.php">Foren</a>';
do {
list($id, $pid, $forum, $is_forum) = $db->fetch_row($db->query('select id, pid, name, is_forum from 006_foren where id = "'.$pid.'"'));
if($id == $f) $forum_name = $forum;
$feld[] = ' » '.($is_forum ? '<a href="forum.php?f='.$id.'">'.$forum.'</a>' : $forum);
} while($pid != 0);
echo implode('', array_reverse($feld));
$rechts2 = new nav;
$rechts2->item('Übersicht','./forum.php');
$rechts2->item('Forum','./forum.php?f='.$f);
echo '<div class="rechts" style="float:right"><img alt="" src="./img/rechts_top.gif">'.$rechts2->nav.'<img alt="" src="./img/rechts_bot.gif"></div>';
headline($_POST['t'] ? 'Antworten' : 'Neues Thema');
echo '<div style="height:200px;padding:40px"><img src="./img/smiley/4.gif" style="vertical-align:middle"> <b>Fehler beim Einfügen des Beitrags!</b><br><a href="javascript:history.back(1)">Zurück</a></div>';
// foot();
}
?>
Aber komisch er trägt nichts in die DB ein. Könnt Ihr mal schauen?
Gruß BlackLove2005