%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/nailstv/www/es.nails.tv/fbus/
Upload File :
Create Path :
Current File : /home/nailstv/www/es.nails.tv/fbus/tetszik.php

<html>
<head>
</head>
<body BGCOLOR="#f4d6d6">
<center>
<?php
  include "config.php";  
    $kid=urldecode($_GET['p1']);
    $kid=base64_decode($kid);
    $u=urldecode($_GET['p3']);
    $u=base64_decode($u);
    $aktho=date("n");
    if ($aktho==1) $elozoho=12; else $elozoho=$aktho-1;

  $sql0="select datum from fb_kepek WHERE id='".$kid."'";
  $res0=mysql_query($sql0);
  $row0=mysql_fetch_array($res0);
  $ho=date("n",$row0['datum']);  
  
  $sql="select * from fb_szavazo where fb_id='".$u."'";
  $res=mysql_query($sql);
        
  if ((mysql_num_rows($res)<>0) and (isset($kid))) 
  { 
    $row=mysql_fetch_array($res);
    $szavaz_t=$row[$ho.'ho'];
    $szavazat=explode("|",$szavaz_t);
    $nap=strtotime("now"); //date('j');
    $i=1; $hiba=0;
    while (isset($szavazat[$i]))
    {
      if ($szavazat[$i]==$kid) $hiba=1;
      $i++;
    }    
    
    if ($hiba==0)
    {
      $szavaz_t.="|".$kid; 
      $sql="UPDATE fb_szavazo SET `".$ho."ho` = '".$szavaz_t."' WHERE `fb_id`='".$u."'";
      if (!$res=mysql_query($sql)) $hiba=1;
      $sql="select pont from fb_kepek where id='".$kid."'";
      if (!$res=mysql_query($sql)) $hiba=1;
      $row=mysql_fetch_array($res);
      $pont=$row['pont']+1;
      $sql="UPDATE fb_kepek SET pont= '".$pont."' WHERE id='".$kid."'";      
      if (!$res=mysql_query($sql)) $hiba=1;      
    }
    if ($hiba==0) echo "Köszönjük szavazatodat";
        else echo "hiba";
  }
  else echo "Érvénytelen szavazat!";
  mysql_close();
  
?>
</center>
</body>
</html>

Zerion Mini Shell 1.0