vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   whats here wrong?? (https://vborg.vbsupport.ru/showthread.php?t=51313)

Exo 04-07-2003 05:58 PM

whats here wrong??
 
Hi,

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

Code:

 

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.
PHP Code:

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

PHP Code:

} 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


PHP Code:


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


All times are GMT. The time now is 09:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01486 seconds
  • Memory Usage 1,762KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete