Pagina 1 din 1
Cookie problem
Scris: Dum Dec 28, 2008 12:33 am
de Razzzvan321
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!
Scris: Dum Dec 28, 2008 11:26 am
de Xposed
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.
Scris: Dum Dec 28, 2008 8:34 pm
de adicrst
pai posteaza atunci care-o problema, nu ne trimite pe noi la alte linkuri. Arata cod, eroare, etc
Scris: Dum Ian 04, 2009 12:26 pm
de mfwsro
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
?>
Scris: Dum Ian 04, 2009 10:02 pm
de lorand1
te duci aici la Birkoff pe site si cauti pe acesta pagina
www.tutoriale.far-php.ro la numerele 41 si respectiv 51 sunt doua tutoriale despre cum sa initializezi si sa folosesti variabile cookie.
spor