plzzz any one fix this eror...

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

    plzzz any one fix this eror...

    me create profile like feature but id logout plzzz help me my all code here

    sql

    PHP Code:
    -- Table structure for table `plike`
    --

    CREATE TABLE IF NOT EXISTS `plike` (
      `
    idint(200NOT NULL AUTO_INCREMENT,
      `
    pidint(200NOT NULL,
      `
    uidint(200NOT NULL,
      `
    ldint(1NOT NULL,
      `
    timetext COLLATE utf8_unicode_ci NOT NULL,
      
    PRIMARY KEY (`id`)
    ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=

    profile code


    PHP Code:
    $like=mysql_fetch_array(mysql_query("select count(*) from plike where ld='1' and pid='$post[0]'"));
    $dlike=mysql_fetch_array(mysql_query("select count(*) from plike437 where ld='0' and pid='$post[0]'"));
    echo 
    "<img src=\"../images/like.png\" alt=\"+\"> <a href=\"genproc.php?action=plike&amp;sid=$siid&amp;id=$post[0]\">Like</a> |
    <img src=\"../images/dislike.png\" alt=\"-\"> <a href=\"genproc.php?action=pdislike&amp;sid=
    $siid&amp;id=$post[0]\">Dislike</a><br/><img src=\"../images/like.png\" alt=\"+\"> <b>$like[0]</b> People like | <img src=\"../images/dislike.png\" alt=\"-\"> <b>$dlike[0]</b> People Dislike"

    genproc


    PHP Code:
       else if($action=="plike"){head_tag("Liking a Profile",$theme);addonline($ud,$time,"Liking a Profile");
       
    $id=$_GET['id'];checkvalue($id);
       
    $tp=mysql_fetch_array(mysql_query("select id from users where id='$id'"));
       
    $tname=gettname($tp[1]);$n=getnick($tp[0]);
       
    $al=mysql_fetch_array(mysql_query("select count(*) from plike where uid='$ud' and pid='$id'"));
       if(
    $al[0]==0){$dt=date("G:i  D  jS  M   y");
       
    $res=mysql_query("insert into like values('','$id','$ud','1','$dt')");
       
    $msg='The User Has Liked Your Post[br/]'.$tp[2].'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
      if(
    $tp[0]!=$ud)
      
    mysql_query("insert into inbox437 values('','1','$msg','$ud','$tp[0]','0','1','$time','0','0','$dt')");
      
    $sub=mysql_query("select uid from subs437 where tid='$tp[1]' and uid!='$ud' and uid!='$tp[0]'");
      
    $msg='The User Has Liked The Post[br/]'.$tp[2].'[br/]Posted By '.$n.'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
      while(
    $i=mysql_fetch_array($sub)){
      
    mysql_query("insert into inbox437 values('','1','$msg','$ud','$i[0]','0','1','$time','0','0','$dt')");}
      if(
    $res)
       echo 
    "<center><img src=\"../images/ok.gif\">You Liked The Profile<br/></center>";
       else
       echo 
    "<center><img src=\"../images/error.gif\">System Error Occured<br/></center>";
       }
       else
       echo 
    "<center><img src=\"../images/error.gif\">You Have Already Liked/Disliked This Profile<br/></center>";
       }
       else if(
    $action=="pdislike"){head_tag("Disliking a Profile",$theme);addonline($ud,$time,"Disliking a Profile");
       
    $id=$_GET['id'];checkvalue($id);
       
    $tp=mysql_fetch_array(mysql_query("select uid from users where id='$id'"));
       
    $tname=gettname($tp[1]);$n=getnick($tp[0]);
       
    $al=mysql_fetch_array(mysql_query("select count(*) from like437 where uid='$ud' and pid='$id'"));
       if(
    $al[0]==0){$dt=date("G:i  D  jS  M   y");
       
    $res=mysql_query("insert into plike values('','$id','$ud','0','$dt')");
       
    $msg='The User Has Disiked Your Post[br/]'.$tp[2].'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
       if(
    $tp[0]!=$ud)
      
    mysql_query("insert into inbox437 values('','1','$msg','$ud','$tp[0]','0','1','$time','0','0','$dt')");
       
    $sub=mysql_query("select uid from subs437 where tid='$tp[1]' and uid!='$ud' and uid!='$tp[0]'");
      
    $msg='The User Has Disiked The Post[br/]'.$tp[2].'[br/]Posted By '.$n.'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
      while(
    $i=mysql_fetch_array($sub)){
      
    mysql_query("insert into inbox437 values('','1','$msg','$ud','$i[0]','0','1','$time','0','0','$dt')");}
       if(
    $res)
       echo 
    "<center><img src=\"../images/ok.gif\">You Disliked The Profile<br/></center>";
       else
       echo 
    "<center><img src=\"../images/error.gif\">System Error Occured<br/></center>";
       }
       else
       echo 
    "<center><img src=\"../images/error.gif\">You Have Already Liked/Disliked This Profile<br/></center>";
       } 
    Last edited by arnage; 15.01.13, 15:54.

    #2
    $siid ? should be $sid?

    Comment


      #3
      Originally posted by something else View Post
      $siid ? should be $sid?
      where bro...

      Comment


        #4
        on your profile code

        Comment


          #5
          Originally posted by something else View Post
          on your profile code
          no working again plzzz help me...

          Comment


            #6
            if the user is getting logged out then there is a problem with the session id, and that is the only part of the session id in your code.

            Comment


              #7
              maybe $siid is not defined like $siid=$_GET['siid']; or something ,there also can be a register globals problem !
              This is ten percent luck, twenty percent skill
              Fifteen percent concentrated power of will
              Five percent pleasure, fifty percent pain

              And a hundred percent reason to remember the name!

              Comment


                #8
                I have seen this site script and it actually is $siid.

                Comment


                  #9
                  Originally posted by riderz
                  ive tried fixing this but just dont get it
                  it should be:
                  PHP Code:
                  <a href="genproc.php?action=plike&amp;siid=$siid&amp;who=$who\">Like</a> 

                  Comment

                  Working...
                  X