×î½üѧϰURLÌøתµÄʱºòнøÈý¸ö³¬ºÃÓõÄPHP¼ÓÃܽâÃܺ¯Êý,òËÆÊÇdiscuzÀïµÄ…ʹÓÃÕâЩ¼ÓÃܽâÃܵÄÔÒòÊÇÒòΪÓÐʱ×Ô¼ºµÄURLµØÖ·±»ÈË»ñÈ¡ÒÔºóÏëÆƽâÄãÀïÃæ´«ÖµµÄÄÚÈݾͱØÐëÖªµÀÄãµÄkey£¬Ã»ÓÐkey£¬ËûÓ¦¸ÃÒªÆÆÁËÒ»Õó×Ó²ÅÄÜÖªµÀÄãURLÀïÃæµÄÄÚÈÝ°É...
Ïл°ÉÙ˵,ÏȽ«ËüÃÇ´ò°ü³ÉÒ»¸öÎļþ¾Í½Ðfun.php°É
<?php
function passport_encrypt($txt, $key) {
srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000));
$ctr = 0;
$tmp = '''';
for($i = 0;$i < strlen($txt); $i++) {
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
$tmp .= $encrypt_key[$ctr].($txt[$i] ^ $encrypt_key[$ctr++]);
}
return base64_encode(passport_key($tmp, $key));
}
function passport_decrypt($txt, $key) {
$txt = passport_key(base64_decode($txt), $key);
$tmp = '''';
for($i = 0;$i < strlen($txt); $i++) {
$md5 = $txt[$i];
$tmp .= $txt[++$i] ^ $md5;
}
return $tmp;
}
function passport_key($txt, $encrypt_key) {
$encrypt_key = md5($encrypt_key);
$ctr = 0;
$tmp = '''';
for($i = 0; $i < strlen($txt); $i++) {
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;
$tmp .= $txt[$i] ^ $encrypt_key[$ctr++];
}
return $tmp;
}
?>
ÒÔÏÂÊÇһЩʾÀý…¼ÓÉî¶ÔÕâÈý¸ö¼ÓÃܽâÃܺ¯ÊýµÄÀí½â…
//string.php
<?php
include “fun.php”;
$txt = “This is a test”;
$key = “testkey”;
$encrypt = passport_encrypt($txt,$key);
$decrypt = passport_decrypt($encrypt,$key);
echo $txt.”<br><hr>”;
echo $encrypt.”<br><hr>”;
echo $decrypt.”<br><hr>”;
?>
//array.php
<?php
include “fun.php”;
$array = array(
"a" => "1",
"b" => "2",
"c" => "3",
"d" => "4"
);
//serialize²úÉúÒ»¸ö¿É´æ´¢µÄÖµ,·µ»ØÒ»¸ö×Ö·û´®,unserialize»¹Ô
$txt = serialize($array);
$key = “testkey”;
$encrypt = passport_encrypt($txt,$key);
$decrypt = passport_decrypt($encrypt,$key);
$decryptArray = unserialize($decrypt);
echo $txt.”<br><hr>”;
echo $encrypt.”<br><hr>”;
echo $decrypt.”<br><hr>”;
echo $decryptArray.”<br><hr>”;
?>
¹Ø¼üµÄµØ·½À´ÁË…µ±ÄãÒªÌøתµ½ÁíÍâÒ»¸öÍøÖ·,µ«ÓÖÒª±£Ö¤ÄãµÄsessionÎÞÎóµÄʱºò,ÄãÐèÒª¶Ôsession×÷Ò»¸ö´¦Àí.òËÆÒ»¸ö¹«Ë¾ÓÐÒ»¸öÍøÕ¾ÓÖÓÐÒ»¸öÂÛ̳,Á½¸öµØ·½¶¼ÓÐ×¢²áºÍµÇ¼,µ«ÓÖ²»ÏëÈÃÓû§ÔÚÖ÷Ò³µÇ¼ºóÌøתµ½ÂÛ̳µÄʱºòsessionʧЧ,¼´ÊǵǼһ´ÎÅÜÍêÕû¼ä¹«Ë¾…
ÄÇÒªÔõÑùÀ´´¦ÀíÓû§µÄsessionÄØ…
ÍøÒ³¶¼ÊÇÎÞ״̬µÄ,Èç¹ûÒªÔÚеÄÍøÒ³ÖмÌÐøʹÓÃsession,ÔòÐèÒª°Ñsession´ÓÒ»¸öµØ·½ÒƵ½ÁíÒ»¸öµØ·½,¿ÉÄÜÓÐЩÈËÒѾÏëµ½ÁË,ÎÒ¿ÉÒÔͨ¹ýurl´«Ö·µÄ·½Ê½À´µ÷ÓÃËü….¶øPHPÓиö´¦ÀísessionµÄ±äÁ¿,½Ð
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
¿ìËÙÒµÎñͨµÀ
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨
×÷Õß ØýÃû¼¼Êõ
À´Ô´ NET±à³Ì
ä¯ÀÀ
·¢²¼Ê±¼ä 2012-05-24
|
content |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn
ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!
|
gzhong.cn/tech/39453.htm" title="iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø" target="_blank">iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
|
|
SESSION.ÓÚÊÇ….
½«ÐèҪע²áµÄsessionת»»³ÉÒ»¸öÊý×é°É.ÄÇô,Äã¿ÉÒÔÕâÑùд:
//login.php
<?php
session_start();
include “fun.php”;
….
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
¿ìËÙÒµÎñͨµÀ
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨
×÷Õß ØýÃû¼¼Êõ
À´Ô´ NET±à³Ì
ä¯ÀÀ
·¢²¼Ê±¼ä 2012-05-24
|
content |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn
ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!
|
Äã¿ÉÄܶÔÏÂÃæµÄÎÄÕ¸ÐÐËȤ
HTTP/1.1 401 Access Denied
âË®¾§ÖʸÐË®¾§Æ»¹û
|
|
SESSION[“userid”];
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
¿ìËÙÒµÎñͨµÀ
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨
×÷Õß ØýÃû¼¼Êõ
À´Ô´ NET±à³Ì
ä¯ÀÀ
·¢²¼Ê±¼ä 2012-05-24
SESSION[“username”];
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
¿ìËÙÒµÎñͨµÀ
PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨
×÷Õß ØýÃû¼¼Êõ
À´Ô´ NET±à³Ì
ä¯ÀÀ
·¢²¼Ê±¼ä 2012-05-24
|
content |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn
ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!
|
|
|
SESSION[“userpwd”];
…
header("Location: http |
ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn
ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!
|
|