PDA

View Full Version : whats here wrong??


Exo
04-07-2003, 05:58 PM
Hi,

i have a problem with my self made hack, i become all the time a parse error, which } is wrong there?



if (($X==1) && $X) {
if (($X == '') && ($X == '') && ($X == '') && ($X == '') && ($X == '')) {
$DB_site->query("DELETE FROM X WHERE threadid='$threadid'");
} else {
$data=$DB_site->query_first("SELECT X,X,X,X,X from X WHERE threadid=$threadid");
if (($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '')) {
$DB_site->query("UPDATE X SET X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("INSERT INTO X (threadid,X,X,X,X,X) VALUES('$threadid','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."')");
} else {
$DB_site->query("UPDATE IGNORE X SET threadid='$threadid',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."'");
}
}
}

eval("standardredirect(\"".gettemplate("X")."\",\"showthread.php?s=$session[sessionhash]&postid=$postid#post$postid\");");
}




thanks for help! ;)

MUG
04-07-2003, 06:12 PM
The last one is incorrect. Get rid of it, and move the eval() statement up.
if (($X==1) && $X) {
if (($X == '') && ($X == '') && ($X == '') && ($X == '') && ($X == '')) {
$DB_site->query("DELETE FROM X WHERE threadid='$threadid'");
} else {
$data=$DB_site->query_first("SELECT X,X,X,X,X from X WHERE threadid=$threadid");
if (($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '')) {
$DB_site->query("UPDATE X SET X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("INSERT INTO X (threadid,X,X,X,X,X) VALUES('$threadid','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."')");
} else { // WTF? What's up with this extra else statement?
$DB_site->query("UPDATE IGNORE X SET threadid='$threadid',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."'");
}
}

eval("standardredirect(\"".gettemplate("X")."\",\"showthread.php?s=$session[sessionhash]&postid=$postid#post$postid\");");
}

Edit: There's also two else statements for the same if()?

Exo
04-07-2003, 06:27 PM
thanks for help :)


the last one is for if there is nothing or no change, that it does nothing.

Xenon
04-07-2003, 06:54 PM
} else {
$DB_site->query("INSERT INTO X (threadid,X,X,X,X,X) VALUES('$threadid','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."')");
} else {

two elses!!
that's the buggy part

Exo
04-07-2003, 07:04 PM
hm or can i make




if (($X==1) && $X) {
if (($X == '') && ($X == '') && ($X == '') && ($X == '') && ($X == '')) {
$DB_site->query("DELETE FROM X WHERE threadid='$threadid'");
} else {
$data=$DB_site->query_first("SELECT X,X,X,X,X from X WHERE threadid=$threadid");
if (($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '') && ($data['X'] != '')) {
$DB_site->query("UPDATE X SET X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."',X='".addslashes($X)."' WHERE threadid='$threadid'");
} else {
$DB_site->query("INSERT INTO X (threadid,X,X,X,X,X) VALUES('$threadid','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."','".addslashes($X)."')");
} else { // WTF? What's up with this extra else statement?
exit;
}
}

eval("standardredirect(\"".gettemplate("X")."\",\"showthread.php?s=$session[sessionhash]&postid=$postid#post$postid\");");
}




when i try this i became also a parse error. :(

Xenon
04-07-2003, 07:06 PM
you have to take out the second else at all..

Exo
04-07-2003, 07:58 PM
how can i say with a if, that when nothing is change that it do nothing