Jump to content

SET $COOKIE ?


karker

Recommended Posts

how can i  set cookie like a*dm*n@**t*r*c**.*c**  ??

 

$cookkiee = $islem_1['mail'] ;
$sayisi = strlen($cookkiee)-1 ;
$cok =  $islem_1['mail'] ;
for($i=0;$i<=$sayisi;$i++) {
$sifr = rand(0,2);
if($sifr ==0) { $cok[$i]= '*';  }
$dizik =  $cok[$i];  
setrawcookie("kayip",$dizik,time()+(60*30),"/");
$_COOKIE['kayip'] = $dizik;

echo $dizi  // etc . a*dm*n@**t*r*c**.*c**
} 

echo $_COOKIE['kayip']; // etc. just one char being like  random  a

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/235718-set-cookie/
Share on other sites

 

 

 

$cookkiee = $islem_1['mail'] ;  // mail in here [email protected]
$sayisi = strlen($cookkiee)-1 ;
$cok =  $islem_1['mail'] ;
for($i=0;$i<=$sayisi;$i++) {
$sifr = rand(0,2);
if($sifr ==0) { $cok[$i]= '*';  }
$dizik =  $cok[$i];  
setrawcookie("kayip",$dizik,time()+(60*30),"/");
$_COOKIE['kayip'] = $dizik;

echo $dizi  
} 

echo $_COOKIE['kayip'];

Cookie setting  like "m" or a char""

didnt be cookie  like "as*asd*@as*as*.co*"


why for  ? can everybody help me?

Link to comment
https://forums.phpfreaks.com/topic/235718-set-cookie/#findComment-1211611
Share on other sites

I see what's going on here. I suggest using whitespace to help you organize your code. Also, rewrite it to make it easier to understand.

 

<?php

$mail = '[email protected]';
$mail_obs = '';

foreach (str_split($mail) as $chr ) {
if( mt_rand(0,2) === 0 )
	$chr = '*';
$mail_obs .= $chr;

}

echo $mail_obs;

?>

 

Hope that helps.

Link to comment
https://forums.phpfreaks.com/topic/235718-set-cookie/#findComment-1211641
Share on other sites

str_split( $string ) will split a string into an array, and will be dynamic.

 

If you wanted to be ultra-efficient, you would use:

 

$mail = '[email protected]';

for($i=0;$i<strlen($mail);$i++) {
if( mt_rand(0,2) === 0 )
	$mail[$i] = '*';
}

echo $mail;

 

But the difference is MINIMAL. You are also permanently changing the $mail variable.

Link to comment
https://forums.phpfreaks.com/topic/235718-set-cookie/#findComment-1211663
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.