error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    error

    hi there friends i have been busy creating a new function for me site but got an error when a member updates there setting it changes it for everyone but i need it so it does it for one person only

    Code:
    <?php
    define('SCS',true);
    include("../main/main.php");
    include("../main/link.php");
    if(!connect()){
    dberror();
    exit();
    }
    cleardata();
    if(isipbanned(ip(),browser())){
    if(!isshield(uid_ses($ses))){
    ipban(uid_ses($ses));
    exit();}
    }
    if(!islogged($ses)){
    expired(uid_ses($ses));
    exit();
    } 
    if(isbanned(uid_ses($ses))){
    if(!isshield(uid_ses($ses))){
    banned(uid_ses($ses));
    exit();}
    }
    mysql_query("UPDATE members SET host='".host()."', browser='".browser()."', ip='".ip()."' WHERE uid='".uid_ses($ses)."'");
    
    if($update==yes){
    web_head(nick_ses($ses)."@link setting",1,uid_ses($ses));
    addonline(uid_ses($ses),"link setting","$PHP_SELF");
    $title.="
    <b>link Tools</b>";
    
    
    if($shop=='off'){$shop='0';}else{$shop='1';}
    if($quiz=='off'){$quiz='0';}else{$quiz='1';}
    if($friend=='off'){$friend='0';}else{$friend='1';}
    if($friendz=='off'){$friendz='0';}else{$friendz='1';}
    if($clubo=='off'){$clubo='0';}else{$clubo='1';}
    if($chatr=='off'){$chatr='0';}else{$chatr='1';}
    if($request1=='off'){$request1='0';}else{$request1='1';}
    if($request2=='off'){$request2='0';}else{$request2='1';}
    
    $main.="<p style=\"text-align: center\">";
    $linkso=mysql_query("UPDATE linkso SET value='".$quiz."' WHERE name='quiz'");
    $linkso=mysql_query("UPDATE linkso SET value='".$shop."' WHERE name='shop'");
    $linkso=mysql_query("UPDATE linkso SET value='".$clubo."' WHERE name='clubo'");
    $linkso=mysql_query("UPDATE linkso SET value='".$friend."' WHERE name='friend'");
    $linkso=mysql_query("UPDATE linkso SET value='".$friendz."' WHERE name='friendz'");
    $linkso=mysql_query("UPDATE linkso SET value='".$chatr."' WHERE name='chatr'");
    $linkso=mysql_query("UPDATE linkso SET value='".$request1."' WHERE name='request1'");
    $linkso=mysql_query("UPDATE linkso SET value='".$request2."' WHERE name='request2'");
    if($linkso){
    $main.="<img src=\"../$phpthumbs?src=../images/ok.gif\" alt=\"\"/>link Settings updated successfully";
    }else{
    $main.="<img src=\"../$phpthumbs?src=../images/error.png\" alt=\"\"/><br/>Daterbase Error!";
    }
    $main.="</p>";
    $L3="<a href=\"../main.php?ses=$ses\">
    <img src=\"../$phpthumbs?src=../images/home.gif\" alt=\"\"/>Main Menu</a>";
    xhtml($ses,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    webfoot();
    exit();
    }
    
    web_head(nick_ses($ses)."@link setting",1,uid_ses($ses));
    addonline(uid_ses($ses),"link","$PHP_SELF");
    $title.="
    <b>link Settings</b>";
    
    if($shop=='off'){$shop='0';}else{$shop='1';}
    if($quiz=='off'){$quiz='0';}else{$quiz='1';}
    if($friend=='off'){$friend='0';}else{$friend='1';}
    if($friendz=='off'){$friendz='0';}else{$friendz='1';}
    if($clubo=='off'){$clubo='0';}else{$clubo='1';}
    if($chatr=='off'){$chatr='0';}else{$chatr='1';}
    if($request1=='off'){$request1='0';}else{$request1='1';}
    if($request2=='off'){$request2='0';}else{$request2='1';}
    
    $main.="<form action=\"./linkset.php?ses=$ses&amp;update=yes\" method=\"post\"><p align=\"center\">";
    if(!canfriend()){$friend=" selected=\" selected\"";}
    $main.="Turn Find A Friend Link On/Off: <select name=\"friend\" value=\"$friend\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$friend>Off</option>";
    $main.="</select><br/>";
    if(!canfriendz()){$friendz=" selected=\" selected\"";}
    $main.="Turn Buddy Request On/Off: <select name=\"friendz\" value=\"$friendz\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$friendz>Off</option>";
    $main.="</select><br/>";
    if(!canclubo()){$clubo=" selected=\" selected\"";}
    $main.="Turn clubs Link On/Off: <select name=\"clubo\" value=\"$clubo\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$clubo>Off</option>";
    $main.="</select><br/>";
    if(!canchatr()){$chatr=" selected=\" selected\"";}
    $main.="Turn chatroom Link On/Off: <select name=\"chatr\" value=\"$chatr\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$chatr>Off</option>";
    $main.="</select><br/>";
    if(!canrequest1()){$request1=" selected=\" selected\"";}
    $main.="Turn Request a site Link On/Off: <select name=\"request1\" value=\"$request1\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$request1>Off</option>";
    $main.="</select><br/>";
    if(!canrequest2()){$request2=" selected=\" selected\"";}
    $main.="Turn request Server space Link On/Off: <select name=\"request2\" value=\"$request2\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$request2>Off</option>";
    $main.="</select><br/>";
    if(!canquiz()){$quiz=" selected=\" selected\"";}
    $main.="Turn Quiz Link On/Off: <select name=\"quiz\" value=\"$quiz\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$quiz>Off</option>";
    $main.="</select><br/>";
    if(!canshop()){$shop=" selected=\" selected\"";}
    $main.="Turn shop Link On/Off: <select name=\"shop\" value=\"$shop\">";
    $main.="<option value=\"on\">On</option>";
    $main.="<option value=\"off\"$shop>Off</option>";
    $main.="</select><br/>";
    $main.="<input type=\"Submit\" Value=\"Update\">";
    $main.="</form></p>";
    
    $L1="<a href=\"settings.php?ses=$ses\">Settings</a>";
    $L2="<a href=\"../main.php?ses=$ses\">
    <img src=\"../$phpthumbs?src=../images/home.gif\" alt=\"\"/>Main Menu</a>";
    xhtml($ses,$title,1,$L1,$L2,$L3,$L4,$L5,0,0,0,$main);
    webfoot();
    exit();
    ?>
    this is so members can turn links off on the main page so it makes the page a bit shorter can some one help me fix the problem please i have created a database for it it all works jsut dont work for one person

    #2
    what's the "yes", is it defined or?
    $update==yes

    also, you might want to check
    $linkso=mysql_query("UPDATE linkso SET value='".$quiz."' WHERE name='quiz'");
    shouldn't there be
    $linkso=mysql_query("UPDATE linkso SET value='".$quiz."' WHERE name='quiz' AND user = 'someuser';");
    ?
    i don't know, i don't use that script, whatever it is..

    Comment


      #3
      yes the above is correct you need to update the query with a specific use, what does this do exactly.
      Want something coded email me at sales@webnwaphost.com for a prices.




      Comment


        #4
        its for users to hide the links on main menu the sql's all wrong

        Comment


          #5
          Originally posted by wap2010v2 View Post
          mysql_query("UPDATE members SET host='".host()."', browser='".browser()."', ip='".ip()."' WHERE uid='".uid_ses($ses)."'");
          dude WHERE uid='".uid_ses($ses)."'"
          i think here uid is ' = all so just try changing " ' " to " user id column name " it might work the.

          Please click one of the Quick Reply icons in the posts above to activate Quick Reply.
          Originally posted by funtowap View Post
          WHERE uid='".uid_ses($ses)."'"
          this part of query is kinda risky ;) its giving user permission for all user account update

          Comment

          Working...
          X