1
hallo there,
i'm having a function which used to work with XOOPS 2.0.18 but since i updated to the last version, each time i try to add a new category in my site, i press the submit button in the form and the data get into the db 3 times! Anybody has an idea why this might be happening?? the function which stores the data is the following and is used in the admin section of the module not in the front end!
Quote:
function addCat()
{
global $xoopsDB, $_POST, $myts, $eh;
$pid = intval($_POST["cid"]);
$title = $myts->makeTboxData4Save($_POST["ctitle"]);
if (empty($title)) {
redirect_header("categories.php",2,_MD_ERRORTITLE);
exit();
}
if ( ($_POST["imgurl"]) || ($_POST["cimgurl"]!="") ) {
$imgurl = $myts->makeTboxData4Save($_POST["cimgurl"]);
}
$sql = sprintf("INSERT INTO %s (pid, title, imgurl) VALUES (%u, '%s', '%s')", $xoopsDB->prefix("addresses_cat"), $pid, $title, $imgurl);
$xoopsDB->query($sql) or $eh->show("0013");
redirect_header("categories.php",1,_MD_NEWCATADDED);
}
this happens to another file for inserting and manipulating other data as well!havent checked the rest of the admin files to see if it happens to all of them! its weird though!