plzzz any one fix this eror...

Started on the old forum in January 2013 · view the original in the archive · old links redirect here

8 replies · 4,941 views · started 13 years ago · 3 min read

4 participants
gsd2149 Junior · 21 posts #1

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

sql

-- Table structure for table `plike`
--

CREATE TABLE IF NOT EXISTS `plike` (
  `id` int(200) NOT NULL AUTO_INCREMENT,
  `pid` int(200) NOT NULL,
  `uid` int(200) NOT NULL,
  `ld` int(1) NOT NULL,
  `time` text COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

profile 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&sid=$siid&id=$post[0]\">Like</a> |
<img src=\"../images/dislike.png\" alt=\"-\"> <a href=\"genproc.php?action=pdislike&sid=$siid&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

   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>";
   }
something else Fellow · 2,296 posts #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.

just_m3. Developer · 199 posts #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!

wap2k Developer · 168 posts #8

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

something else Fellow · 2,296 posts #9

riderz wrote: ive tried fixing this but just dont get it

it should be:

<a href="genproc.php?action=plike&siid=$siid&who=$who\">Like</a>

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close