¿ìËÙÒµÎñͨµÀ

PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨

×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-05-24

×î½üѧϰ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»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ

    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 âË®¾§ÖʸÐË®¾§Æ»¹û

    Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ

    SESSION[“userid”];
    PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
    ¿ìËÙÒµÎñͨµÀ

    PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨

    ×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-05-24
    content

    ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕHTTP/1.1 401 Access Denied HP¸ß¼¶½Ì³Ì(6):PHP Sessions

  • PhotoshopÈëÃÅ:»æÖÆÁ¢ÌåЧ¹û°ÂÔËÎ廷Ч¹ûͼ
  • LinuxϵÄVsftpdÅäÖÃƪ
  • DIVºÍtableÒ³Ãæ²¼¾ÖµÄÇø±ðºÍÁªÏµ
  • ÈçºÎʵÏÖ¶þάÏòÁ¿ - ±à³ÌÈëÃÅÍø
  • ÍøÂçÓªÏú¹«Ë¾ÔÚÔËÓªÖеIJßÂÔ
  • iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ

    SESSION[“username”];
    PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨ - ÁèÖڿƼ¼
    ¿ìËÙÒµÎñͨµÀ

    PHP¼ÓÃܽâÃÜÄÚ²¿Ëã·¨

    ×÷Õß ØýÃû¼¼Êõ À´Ô´ NET±à³Ì ä¯ÀÀ ·¢²¼Ê±¼ä 2012-05-24
    content

    ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

    ·ÖÏíµ½£º HTTP/1.1 401 Access Denied /31865.htm" title="DIVºÍtableÒ³Ãæ²¼¾ÖµÄÇø±ðºÍÁªÏµ" target="_blank">DIVºÍtableÒ³Ãæ²¼¾ÖµÄÇø±ðºÍÁªÏµ
  • ÈçºÎʵÏÖ¶þάÏòÁ¿ - ±à³ÌÈëÃÅÍø
  • ÍøÂçÓªÏú¹«Ë¾ÔÚÔËÓªÖеIJßÂÔ
  • iBATIS 3ÄÚµÄÐÂÌØÐÔ£º½«iBATISÓÃ×÷Ó¦ÓóÌÐòÄÚµÄÒ»Öֳ־ÿò¼Ü - ±à³ÌÈëÃÅÍø
  • Photoshop»æÖƸ߹âË®¾§ÖʸÐË®¾§Æ»¹û
  • Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ

    SESSION[“userpwd”];

    header("Location: http

    ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

    ·ÖÏíµ½£º ¸ü¶à

    Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

    µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

    µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

    ¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ