Problem mit php Datei

PHPlehrling

Mitglied
Hi

Ich brauche mal wieder hilfe und zwar habe ich Probleme mit einem script. Es läuft soweit alles bis auf eins.
Das script soll einen neuen Datensatz in die DB einfügen. Die Forenid wird per linkübergeben. datei.php?forumid=7 z.B.
Nun ist mein Problem, dass er alles normal und richtig einträgt außer der Forenid. Die macht er einfach nicht rein. Das Feld hat int( 12 ). Währe echt nett wenn jemand ne Idee hat, was das sein kann

PHP:
<?php
require("functions.php");
$forumid = $_REQUEST['forumid'];
if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];else $action="view";
$currenttime = time();
$result = mysql_query("SELECT threadid FROM ibb_threads ORDER BY threadid DESC LIMIT 0,1");
while($row = mysql_fetch_array($result)) {
$threadid = $row["threadid"];
$newthreadid = $threadid+1;
}

if($action == "newthread"){

$forumid = $_REQUEST['forumid'];
if(isset($_POST['submit'])) 
{
$forumid = $_REQUEST['forumid'];
$update_threadcount = mysql_query("UPDATE ibb_forums SET threads = threads + 1 AND posts = posts + 1 WHERE id = '$forumid'");

$insert_threads = mysql_query("INSERT INTO ibb_threads (threadid,forumid,topic,starttime,starter)VALUES('$newthreadid','$forumid','$topic','$currenttime','$starter')");
$insert_posts   = mysql_query("INSERT INTO ibb_posts (postid,threadid,poster,topic,message,starttime)VALUES(NULL,'$newthreadid','$starter','$topic','$inhalt','$currenttime')");
}
if($insert_threads)
{
  eval("dooutput(\"".gettemplate("newthread_waiting")."\");");
}
else
{
echo "Fehler";
}
}
if($action == "view")
{
eval ("\$header = \"".gettemplate("header")."\";");
eval ("\$footer = \"".gettemplate("footer")."\";");
eval("dooutput(\"".gettemplate("newthread")."\");");
}

?>
 
Original geschrieben von PHPlehrling
Hi

PHP:
<?php
require("functions.php");
$forumid = $_REQUEST['forumid']; //-->siehe Anmerkung
if(isset($_REQUEST['action'])) $action=$_REQUEST['action'];else $action="view";
$currenttime = time();
$result = mysql_query("SELECT threadid FROM ibb_threads ORDER BY threadid DESC LIMIT 0,1");
while($row = mysql_fetch_array($result)) {
$threadid = $row["threadid"];
$newthreadid = $threadid+1;
}

if($action == "newthread"){

$forumid = $_REQUEST['forumid'];
if(isset($_POST['submit'])) 
{
//$forumid = $_REQUEST['forumid'];
$update_threadcount = mysql_query("UPDATE ibb_forums SET threads = threads + 1 AND posts = posts + 1 WHERE id = '$forumid'");

$insert_threads = mysql_query("INSERT INTO ibb_threads (threadid,forumid,topic,starttime,starter)VALUES('$newthreadid','$forumid','$topic','$currenttime','$starter')");
$insert_posts   = mysql_query("INSERT INTO ibb_posts (postid,threadid,poster,topic,message,starttime)VALUES(NULL,'$newthreadid','$starter','$topic','$inhalt','$currenttime')");
}
if($insert_threads)
{
  eval("dooutput(\"".gettemplate("newthread_waiting")."\");");
}
else
{
echo "Fehler";
}
}
if($action == "view")
{
eval ("\$header = \"".gettemplate("header")."\";");
eval ("\$footer = \"".gettemplate("footer")."\";");
eval("dooutput(\"".gettemplate("newthread")."\");");
}

?>


versuchs mal so, ohne die zeile die ich auskommentiert hab..
es ist mir sowieso ein rätsel wieso du insgesamt 3mal $forumid = $_request['forumid'] setzt, denn das erste mal genügt doch vollkommen (dort wo ich meinen senf hinzugegeben hab :D), da diese anweisung nicht bedingt ist und somit $forumid im ganzen script = $_REQUEST['forumid'] ist....
 
wenn sonst alles klappt...dann liegts wohl daran das die ID nicht übergeben wird..
Mach mal an den entscheidenden stellen ein echo $forumid;
rein..dann siehste ja ob die id da ankommt oder nicht...und kannst die Stelle des Fehlers schneller finden..
 
habe ich auch schon alles überprüft. aber pustekuchen. Ich verstehe es auch nicht. am besten schreibe ich die datei mal neu. das hilft manschmal *G*

EDIT: ne keine chance. er nimmt sie nicht. so ne kacke das gibt es doch nicht
 
Zuletzt bearbeitet:

Neue Beiträge

Zurück