Cookie problem

Secţiune dedicată începatorilor.

Moderatori: Moderatori, Start Moderator

Razzzvan321
New Member
Mesaje: 1
Membru din: Dum Dec 28, 2008 12:26 am

Cookie problem

Mesajde Razzzvan321 » Dum Dec 28, 2008 12:33 am

Nu pot posta problema :|

In order to try to prevent spammers, we do not allow our users to post URLs or enter personal data into their profile until they have posted at least 5 legitimate posts and have been with us for more than 5 days. We appreciate your understanding in this matter in order to help us eliminate spam from this forum. If you have somehow gotten this message even though you meet both of the criteria, please let us know ASAP.

Thanks!



Avatar utilizator
Xposed
Average Member
Mesaje: 143
Membru din: Mie Ian 11, 2006 9:50 pm
Contact:

Mesajde Xposed » Dum Dec 28, 2008 11:26 am

Ce nu intelegi din acel mesaj? Nu ai voie sa postezi URL-uri pana nu ai postat deja 5 mesaje in forum si ai 5 zile de cand te-ai inregistrat in comunitatea PHP Romania.

adicrst
Average Member
Mesaje: 73
Membru din: Sâm Iun 30, 2007 5:26 pm

Mesajde adicrst » Dum Dec 28, 2008 8:34 pm

pai posteaza atunci care-o problema, nu ne trimite pe noi la alte linkuri. Arata cod, eroare, etc
Imagine

Avatar utilizator
mfwsro
Average Member
Mesaje: 188
Membru din: Mie Dec 03, 2008 1:03 pm
Contact:

Mesajde mfwsro » Dum Ian 04, 2009 12:26 pm

Salut,vreau sa implementez un sistem de cookie pt ca sesiunea unui user sa nu ii poata fi furata sau sa nu poata intra nimeni altcineva pe contul lui cu sesiune cu tot chiar daca ii da linkul personal.Iata codul:

Cod: Selectaţi tot

<?php
include("config.php");
####################
if($mime== WEB){
header("Content-type: $mime");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";}else{
header("Content-type: $mime");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";}
####################
$bcon = connectdb();
if (!$bcon){echo dberror($mime);}
####################
$action = mysql_real_escape_string($_GET["action"]);
$page = mysql_real_escape_string($_GET["page"]);
$who = mysql_real_escape_string($_GET["who"]);
$ses = mysql_real_escape_string($_GET["ses"]);
$acces = $_COOKIE["acces"];
$pmid = mysql_real_escape_string($_GET["pmid"]);
$uid = getuid_ses($ses);
$brws = explode(" ",$HTTP_USER_AGENT);
$ubr = $brws[0];
$uip = getip();
cleardata();
####################
$getuthm = @mysql_fetch_array(mysql_query("SELECT theme FROM noi2_users WHERE id='".$uid."'"));
$uth = $getuthm[0];
if(!$uth==""){$uthm = "$uth";$uthm = utheme($uthm);}else{$uthm = "default.css";}
####################
if(($action != "") && ($action!="terms")){
$uid = getuid_ses($ses);
if((islogged($ses)==false)||($uid==0)){echo notlogged($mime);}}
####################
if(isbanned($uid)){echo userbanned($mime,$uid);}
####################
if(isipbanned($uip,$ubr)){
if(!isshield(getuid_ses($ses))){echo useripbanned($mime,$uip,$ubr);}}
####################
$unick = getnick_ses($ses);
if($acces!=$unick)
{
echo "<p align=\"center\">";
echo "<small>Eroare nu aveti acces.</small>";
echo "</p>";
exit(); }
####################
$res = @mysql_query("UPDATE noi2_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".$uid."'");
####################
Pina aici toate-s bune si frumoase numai ca in loc sa aiba acces unul iar celalalt nu sistemul ii blocheaza pe amandoi adica numai pot intra niciunul...Mentionez ca $unick e numele userului la fel ca si $uid....am incercat si if($acces!=$uip) si if($acces!=$ubr) adica dupa ip si browser si tot degeaba.Va multumesc 
?>

lorand1
Average Member
Mesaje: 108
Membru din: Vin Apr 25, 2008 7:44 pm
Localitate: Baia Mare

Mesajde lorand1 » Dum Ian 04, 2009 10:02 pm

te duci aici la Birkoff pe site si cauti pe acesta paginawww.tutoriale.far-php.ro la numerele 41 si respectiv 51 sunt doua tutoriale despre cum sa initializezi si sa folosesti variabile cookie.
spor


Înapoi la “PHP Incepători”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 43 vizitatori