1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

++Best idea to protect image ,can anyone code this++

Discussion in 'PHP' started by jasimjatjasim2, Sep 10, 2009.

  1. #1
    I wil start with one example
    suppose my website is example.com
    my image name is dp.jpg
    the image dp.jpg is on the folder images_uploaded/images
    so i can access the image through
    http://www.example.com/images_uploaded/images/dp.jpg
    Code (markup):
    so to insert that image i need to enter the following code
    <img src="http://www.example.com/images_uploaded/images/dp.jpg">
    Code (markup):
    If we can create a php file called showimage.php
    and if we use
    <img src="http://www.example.com/showimage.php?(some random string)/images/dp.jpg">
    Code (markup):
    then it should show the image
    http://www.example.com/images_uploaded/images/dp.jpg
    Code (markup):
    if some one copy the image location which is
    http://www.example.com/showimage.php?(some random string)/images/dp.jpg
    Code (markup):
    it should show only some error mesage or some thing but not the image

    so the users will not able to find the real directory name which the image contain

    so can some one develop a php file called showimage.php which works like i explaned above

    Thanks in advance
     
    jasimjatjasim2, Sep 10, 2009 IP
  2. hamidof

    hamidof Peon

    Messages:
    619
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hamidof, Sep 10, 2009 IP
  3. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    when some one goes to that image location then he will see only some text like the below
    Œ›W[“,!]Y£\Å’Å’3øʲîcƲ$X„p–‘æ<wƒ¸ü+F+-–óÝÀ®¬ùÚázqÛ8¬O¶Éo¨,·£Å#2ŸCéï_ï>V}LlÑ~î8..ùK«žB/lûvªºtM>6avÊv¸ÏPON+Z÷H†Â9æ¶#lÀ2>rÊ»ôª6÷“ì…§QóŸÞlPX¯Oè*qmEò²îš*ÛÙ^Ÿ6a$Rǵ¸,6 ÃŽ~¾µ+ÏÚ[Opÿ�"M…Xð¤‚Äã¯@>•³Ž;•‘üÆÞÛ”…êzþF«k¤G¦µ¤a·,Ĩt09ùëÿ�ë­£iÉ!;E4m›¸õA-¾Èç±…™£a¸0>žÆ³µ¥‚ÞwÁ‘bŒªŸVê*®•2ØFm£V‘O·¦pF=úÓ®ÅÊL²AlYU¹Ç¨8?çB‡-Kt3JÊãµÍUd 1è‚0ÎÇp^rŽ¼Ï¡­‹(íæKK(‘?Òàœnm¹ÜO®sÇà*-:Â+»öŸbÜÉ) —ûªÄõö<ÿ�õÅmëÚ(Óîm'Û÷2 d{‚6}w:W~G Võg5j¼ŽÇ-uç±ÜdH¤,Í&é·Ï­_°Ò·ÛC²ÌMb)¡GeVÝÀù‡Luþu½ý…e«ÉÑy…å‘šb: É9àñÔ}+¤±ÓcŽ WO–o;s09SÆ9ցN36¼†ç-\]ãË’é²ÙY0}¢×pÛxÈÆãŒ} s²ê72Ý<ü½ëÐ ¶w+hXHÌÊ‹ch €…r!²‰îgˆ¦ÄˆnY�*Ëê Ư œÜÝäîyÅ©u«öŠŽÕa—s/'5ÃŽ1Ó¶3ÿ�ë«QM7Hó0˜öÆ$lª’Nzvýkž¸¶[]6µ’y-nː:äqØ“úÕ»{'Ô4ÔŽÒt…% INYËœ0õÆ3ù”N éÐKB[ öf[â„¢“••cxdä/¾µ(»hîÚîÝCFD ‘Û>ÃœSîŒé A,Ž‹‰ ÃŒUr|À1žŸç5Ÿ¥Æ$Å H¢¼ç dž£Óð÷®yCVÃŽÅ¡-=ĆFi¢û<{W:“6â„¢pöÂåš5m¡À裟”„ŠÙ[³§Î×-撋-H壖,={}E|Æ/.®¹§¹èS«4ã‘ÙaÙÖ4Fäƒ×#?JÆÔ¶‰Ãœl©’WÔÆü+Z{ˆ£´P¨ÛY6@b6ÁÇNqÍf]9%F”žb²‘Èÿ�?…y4“RÔëjèdòG»x…”͉<Ð6‚{çÛ©­[m^]X.¢(Z2騤$n^ùé×éY¶S£ZOiæ¶ "Aóp\LÓíí>Õ;bxä…XmÛԏR;cÌWm:Ã’Â¥;ÞÖ9*ҍX´ÏT¶»ûN—¦Þ‰#7(‘•€,O8ÁúãéVu;hÃŒiµ|µpJƒ÷²~nÃœ¾•æšŒÖÃ…m-㥸Ž@¹Ã+xä{©n=a‚´°±óWÊ?‹®F?#^¬³dš²ÐòVY'}N/žÿ�´†XãbHsëŽäúã8íQµì¨öÓÊUtçܪcÄ`}GÃ¥\£jÂk…;â„¢&Mß"’¶8ïšµ|MܱaØƪ¥QØzc¯n1Ã…g<Ù-âR˝Òl±«k#E<щ¯®?¿…`éâêIÜÌŠË!Yv�箘§Þ0@]ݤ˜žXᔂzëO{˜ˆd·º•ãÅ’sÔc¯jókâ¥]jN–4¾¦²Ë4²²’0£9Ëgú*hàZc9)+ϡ~&«jSÁ{k"¹Û"á¼Â¸ÁÁô'ó¨t«˜¶…*Ê¡•[©Éê;~5ÏÈù9–çG>¶4/m!·µˆ,ˆfâ„¢|¶Bß0äàzc×<×'s§1YÂ¥—ʐmv?7=8ô­VóÈÕξrî`Ã…8ÝÓü9ükIópÀîB»sŒôÍvàéÏKnÃŒ+%Õ…¤ìcÝ2¨ÛÂû’y 9ãµnÉGkn·-Žy¶xöäOãŠÎ†% )9•IpÂ–çŽNvçÓ‘ëZR¸K ±¤k´|) ×ÔqÃœöõÏÖa©û8}PL“ÜI%«³4Àr‚@J•åêxÇýz‚Ê5³·.ñÇå±em²ËØdW“ŽxëSKkÑ5Îáæ)+!û¤`€2=IïùÕK¤T¹áŠ&iFP;2°P:œ÷Á<JßmL™­3¡²2ÊcFy6¨¶ÇÁÚÓ {öªÒKfˆ·)VVR8ÁnsÔòGn‚¨Å !HØU’@ÿ�.Ù ö>Ëœò©"¢ºY`•YsòÈ¿6Üžô=?:ÆuRø‰q¸ëg–WiËœ1fÃœò@ý;}k¦ÑobÓ¢’ýNYa‘¡r|ÂUO~�Ièx¬5Òµí ûBV0̱ïmÛGû^ÇÔ€ MiI¨G Vf ðG-ÈéÓ¨®hbèÔNÒØR§xê]·ŸSÕgòm"yYZDÉ' ü08®ºÚ³°’ÖbPÃŒ02@ϯ|V‡t«Ëyw­ö˜›vÀÁvÆ’Å“9ÃŽuš…³ßÅ#ˆ‚Ïå‘$¬Ãœ’89ëýkå³±©RÉès=‘ÊÉ-ÕìóÅ YW,ÇËÛÆ’éYp¢=ÔwrÊ|¸>fp¿+2ä®3øcÃœ èt€/`h‰[rëˆ]Ôå°pÀ69\ví’k“‡N»·×þÀÍåH£÷Ã9VR8oC×8*NsÃ¥LÞ”yŠ×Wj.Ùí±Q±-³<1ç'·z½‰aK§Í&ß›x;W¯åUn­b·¾’ØÍ1²Œ»•‰þñìjýŽœÉc(yȍw*ӮG#ÃœWÖR§Ë¢=Å¡I%cWòÕšîâY7¯Ê¹%W=‡Ó¥[·´/§ÄÏ)XÃn?x€ààÝ*8çŠîVµ–W ¿Ó¿µ]Ñ-â-r²¼ÏPÃ¥rª>ðÆ>•²WE/=¬.”ˆpA8fç8ÍYÃ’o%’ìK4O ”`¿*Ÿ\ç­bê‘ý¾úI’TÚ[r…ÎÐúVœö=>;‘* p„p[4-ÉÖ;Ô#)®,n­—hÅ Ec×è=ÿ�•E}¥ÝCu²Ìd2’¬Þfì}F8üªõó>cœ°’ì•d¹ O½C{zÃ’â„¢`rZí¾Vrx<â¹ñ\®›¸ãi»¢µÛ´^U¼eÅ¡<Ç'æã¯Ò¤œLþJÌßgRÃŒ± “Žy?ʤkiáfÚ®ª¸dÛ÷‡ùÿ�=êŒå#·ÊŸ,)fÅ’ädŸÇ>õò÷Obù5Ô–Q$KpfM„ŽòN0x#½ZØynÁ~và8ÉìEeK$¢(´ïÎNqÓ×�äÖž•åìk}Ê.BÊçå~£o±Á§8;'p¯c"Y€Hvãî6ã!jÐD–ÝÞY¢Ú2�åHõý=êΛd®$d”™Fyž+Xd’î]…SÍË*“‘Ç'éZE©JË¡3½®T†ÑUÚâ&wÏʐ½wJÓŒ¹ÎsYö³(•¢BÈp|ÄÎ0zcéŠÑP¡@+Û¡ÌÖ§‡Y%'aø¶r{Ðà)�ð=)qÀëùÑŒç8­Ì 쌀6rG^hc‡ ÔíŒÅ’ÓJ�Ø=úc½P\kŒÄâ“=³ô¤dqŒÓIÙåç#Š�íö¸ãµ&1ßàNráHrçÒËqÆx­k·&Ö(‚æE|Ø9ç‘ÇjηCç/­lÃœ" F‰ÆŽ½+Ÿ¯FKÈÒƒjhÌ™ÿ�Ð|¶]Ã07àœdã?‰¬›é-$ºžDFĨª3–\àdîúÖŽ –Ý™üÃ<y÷ëúϳ·QåÃó+•äóÊ¾6Å gÕB «Š $Ó‘Hddm¯É ë×>ÇŽq×=±WÓæådœ…€�(àc°¦±ãÕ$2%¶DÒ–ÏÌO<äwã5=±š»á]ZU`±öÎÛ#5«„¬Û)×ÚP··E1…qûÂÃ+ß&¹[Ø–æcöhÆ’@ó2nÈIþ•µçÉ«Yɧ$“K+prW®}³Î;`V|ðKcj ü¾YÃœ`«®Fzu�’}xÂ¥ArîõnÞðë{8’Éf]Ï»*±ä‘ø}O5^[x£†FebÍî°Ø*r3ù*²£íînm[÷q2žxÃœx8�t=³íM½†»œ<ͱ˜‰à(çåþŸ…h¯Í«µ‹>xã²iæ ¹v¶å`r¤°$ps·ô®ºêöí4aQ† Æw«Û§_¸§Ëa¤Ks’ZIänËÐgß'>Ø­xõ©*.Õeù¡ Ó¸Áúu>õèÃ(uf§=;êîs»z ½‹ÓbbU[̈–mÇ¿SÅ’{ž+¥ð¾«ý£(¼±È*ýÞcÏ>ÕÆéúíq©t¾|ªJ�¥•€å†}GZMU·…àI–6’+‰"ùG!wqÉÇã]µòšr‡*Ðu°Ðåå†ç¥\hŽn"“™X°w!°¹Žù5±i4Ò€°B®Òìç·çÍq÷:Ôíâ¹–ê$Õ6–UVÀŸ\ýk·†YXy¡YX…vWËbB
    Code (markup):
    i saw this type in some capcha
    so i am sure some one can make it
     
    jasimjatjasim2, Sep 10, 2009 IP
  4. hamidof

    hamidof Peon

    Messages:
    619
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The thing is, the script you are talking about is not sending JPEG headers to the browser so the browser shows the image as a string of text. This is a big defect i that script.

    To make it work on all the browsers and be valid you must send JPEG/GIF/PNG etc. headers and unfortunately the browser WILL display the image...
     
    hamidof, Sep 10, 2009 IP
  5. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #5
    yes i need that
    so the random string once loaded cannot be re used
    if i blocked right click and drag
    no one can save it
    and also
    users cant use the link from view source to save the image
    so it is 99% protected
    the only way is print screen
    but they will not get the full resolution
    so please some one code it
     
    jasimjatjasim2, Sep 10, 2009 IP
  6. hamidof

    hamidof Peon

    Messages:
    619
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This will protect the images_uploaded folder for sure...
     
    hamidof, Sep 10, 2009 IP
  7. amine

    amine Active Member

    Messages:
    47
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    93
    #7
    not protected 99%
    you can reload page(download html code) and will get new link not used
    and download the image
     
    amine, Sep 10, 2009 IP
  8. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #8
    when someone use the image code direct he will only get a page with
    some codes like this
    Œ›W[“,!]Y£\Å’Å’3øʲîcƲ$X„p–‘æ<wƒ¸ü+F+-–óÝÀ®¬ùÚázqÛ8¬O¶Éo¨,·£Å#2ŸCéï_ï>V}LlÑ~î8..ùK«žB/lûvªºtM>6avÊv¸ÏPON+Z÷H†Â9æ¶#lÀ2>rÊ»ôª6÷“ì…§QóŸÞlPX¯Oè*qmEò²îš*ÛÙ^Ÿ6a$Rǵ¸,6 ÃŽ~¾µ+ÏÚ[Opÿ�"M…Xð¤‚Äã¯@>•³Ž;•‘üÆÞÛ”…êzþF«k¤G¦µ¤a·,Ĩt09ùëÿ�ë­£iÉ!;E4m›¸õA-¾Èç±…™£a¸0>žÆ³µ¥‚ÞwÁ‘bŒªŸVê*®•2ØFm£V‘O·¦pF=úÓ®ÅÊL²AlYU¹Ç¨8?çB‡-Kt3JÊãµÍUd 1è‚0ÎÇp^rŽ¼Ï¡­‹(íæKK(‘?Òàœnm¹ÜO®sÇà*-:Â+»öŸbÜÉ) —ûªÄõö<ÿ�õÅmëÚ(Óîm'Û÷2 d{‚6}w:W~G Võg5j¼ŽÇ-uç±ÜdH¤,Í&é·Ï­_°Ò·ÛC²ÌMb)¡GeVÝÀù‡Luþu½ý…e«ÉÑy…å‘šb: É9àñÔ}+¤±ÓcŽ WO–o;s09SÆ9ցN36¼†ç-\]ãË’é²ÙY0}¢×pÛxÈÆãŒ} s²ê72Ý<ü½ëÐ ¶w+hXHÌÊ‹ch €…r!²‰îgˆ¦ÄˆnY�*Ëê Ư œÜÝäîyÅ©u«öŠŽÕa—s/'5ÃŽ1Ó¶3ÿ�ë«QM7Hó0˜öÆ$lª’Nzvýkž¸¶[]6µ’y-nː:äqØ“úÕ»{'Ô4ÔŽÒt…% INYËœ0õÆ3ù”N éÐKB[ öf[â„¢“••cxdä/¾µ(»hîÚîÝCFD ‘Û>ÃœSîŒé A,Ž‹‰ ÃŒUr|À1žŸç5Ÿ¥Æ$Å H¢¼ç dž£Óð÷®yCVÃŽÅ¡-=ĆFi¢û<{W:“6â„¢pöÂåš5m¡À裟”„ŠÙ[³§Î×-撋-H壖,={}E|Æ/.®¹§¹èS«4ã‘ÙaÙÖ4Fäƒ×#?JÆÔ¶‰Ãœl©’WÔÆü+Z{ˆ£´P¨ÛY6@b6ÁÇNqÍf]9%F”žb²‘Èÿ�?…y4“RÔëjèdòG»x…”͉<Ð6‚{çÛ©­[m^]X.¢(Z2騤$n^ùé×éY¶S£ZOiæ¶ "Aóp\LÓíí>Õ;bxä…XmÛԏR;cÌWm:Ã’Â¥;ÞÖ9*ҍX´ÏT¶»ûN—¦Þ‰#7(‘•€,O8ÁúãéVu;hÃŒiµ|µpJƒ÷²~nÃœ¾•æšŒÖÃ…m-㥸Ž@¹Ã+xä{©n=a‚´°±óWÊ?‹®F?#^¬³dš²ÐòVY'}N/žÿ�´†XãbHsëŽäúã8íQµì¨öÓÊUtçܪcÄ`}GÃ¥\£jÂk…;â„¢&Mß"’¶8ïšµ|MܱaØƪ¥QØzc¯n1Ã…g<Ù-âR˝Òl±«k#E<щ¯®?¿…`éâêIÜÌŠË!Yv�箘§Þ0@]ݤ˜žXᔂzëO{˜ˆd·º•ãÅ’sÔc¯jókâ¥]jN–4¾¦²Ë4²²’0£9Ëgú*hàZc9)+ϡ~&«jSÁ{k"¹Û"á¼Â¸ÁÁô'ó¨t«˜¶…*Ê¡•[©Éê;~5ÏÈù9–çG>¶4/m!·µˆ,ˆfâ„¢|¶Bß0äàzc×<×'s§1YÂ¥—ʐmv?7=8ô­VóÈÕξrî`Ã…8ÝÓü9ükIópÀîB»sŒôÍvàéÏKnÃŒ+%Õ…¤ìcÝ2¨ÛÂû’y 9ãµnÉGkn·-Žy¶xöäOãŠÎ†% )9•IpÂ–çŽNvçÓ‘ëZR¸K ±¤k´|) ×ÔqÃœöõÏÖa©û8}PL“ÜI%«³4Àr‚@J•åêxÇýz‚Ê5³·.ñÇå±em²ËØdW“ŽxëSKkÑ5Îáæ)+!û¤`€2=IïùÕK¤T¹áŠ&iFP;2°P:œ÷Á<JßmL™­3¡²2ÊcFy6¨¶ÇÁÚÓ {öªÒKfˆ·)VVR8ÁnsÔòGn‚¨Å !HØU’@ÿ�.Ù ö>Ëœò©"¢ºY`•YsòÈ¿6Üžô=?:ÆuRø‰q¸ëg–WiËœ1fÃœò@ý;}k¦ÑobÓ¢’ýNYa‘¡r|ÂUO~�Ièx¬5Òµí ûBV0̱ïmÛGû^ÇÔ€ MiI¨G Vf ðG-ÈéÓ¨®hbèÔNÒØR§xê]·ŸSÕgòm"yYZDÉ' ü08®ºÚ³°’ÖbPÃŒ02@ϯ|V‡t«Ëyw­ö˜›vÀÁvÆ’Å“9ÃŽuš…³ßÅ#ˆ‚Ïå‘$¬Ãœ’89ëýkå³±©RÉès=‘ÊÉ-ÕìóÅ YW,ÇËÛÆ’éYp¢=ÔwrÊ|¸>fp¿+2ä®3øcÃœ èt€/`h‰[rëˆ]Ôå°pÀ69\ví’k“‡N»·×þÀÍåH£÷Ã9VR8oC×8*NsÃ¥LÞ”yŠ×Wj.Ùí±Q±-³<1ç'·z½‰aK§Í&ß›x;W¯åUn­b·¾’ØÍ1²Œ»•‰þñìjýŽœÉc(yȍw*ӮG#ÃœWÖR§Ë¢=Å¡I%cWòÕšîâY7¯Ê¹%W=‡Ó¥[·´/§ÄÏ)XÃn?x€ààÝ*8çŠîVµ–W ¿Ó¿µ]Ñ-â-r²¼ÏPÃ¥rª>ðÆ>•²WE/=¬.”ˆpA8fç8ÍYÃ’o%’ìK4O ”`¿*Ÿ\ç­bê‘ý¾úI’TÚ[r…ÎÐúVœö=>;‘* p„p[4-ÉÖ;Ô#)®,n­—hÅ Ec×è=ÿ�•E}¥ÝCu²Ìd2’¬Þfì}F8üªõó>cœ°’ì•d¹ O½C{zÃ’â„¢`rZí¾Vrx<â¹ñ\®›¸ãi»¢µÛ´^U¼eÅ¡<Ç'æã¯Ò¤œLþJÌßgRÃŒ± “Žy?ʤkiáfÚ®ª¸dÛ÷‡ùÿ�=êŒå#·ÊŸ,)fÅ’ädŸÇ>õò÷Obù5Ô–Q$KpfM„ŽòN0x#½ZØynÁ~và8ÉìEeK$¢(´ïÎNqÓ×�äÖž•åìk}Ê.BÊçå~£o±Á§8;'p¯c"Y€Hvãî6ã!jÐD–ÝÞY¢Ú2�åHõý=êΛd®$d”™Fyž+Xd’î]…SÍË*“‘Ç'éZE©JË¡3½®T†ÑUÚâ&wÏʐ½wJÓŒ¹ÎsYö³(•¢BÈp|ÄÎ0zcéŠÑP¡@+Û¡ÌÖ§‡Y%'aø¶r{Ðà)�ð=)qÀëùÑŒç8­Ì 쌀6rG^hc‡ ÔíŒÅ’ÓJ�Ø=úc½P\kŒÄâ“=³ô¤dqŒÓIÙåç#Š�íö¸ãµ&1ßàNráHrçÒËqÆx­k·&Ö(‚æE|Ø9ç‘ÇjηCç/­lÃœ" F‰ÆŽ½+Ÿ¯FKÈÒƒjhÌ™ÿ�Ð|¶]Ã07àœdã?‰¬›é-$ºžDFĨª3–\àdîúÖŽ –Ý™üÃ<y÷ëúϳ·QåÃó+•äóÊ¾6Å gÕB «Š $Ó‘Hddm¯É ë×>ÇŽq×=±WÓæådœ…€�(àc°¦±ãÕ$2%¶DÒ–ÏÌO<äwã5=±š»á]ZU`±öÎÛ#5«„¬Û)×ÚP··E1…qûÂÃ+ß&¹[Ø–æcöhÆ’@ó2nÈIþ•µçÉ«Yɧ$“K+prW®}³Î;`V|ðKcj ü¾YÃœ`«®Fzu�’}xÂ¥ArîõnÞðë{8’Éf]Ï»*±ä‘ø}O5^[x£†FebÍî°Ø*r3ù*²£íînm[÷q2žxÃœx8�t=³íM½†»œ<ͱ˜‰à(çåþŸ…h¯Í«µ‹>xã²iæ ¹v¶å`r¤°$ps·ô®ºêöí4aQ† Æw«Û§_¸§Ëa¤Ks’ZIänËÐgß'>Ø­xõ©*.Õeù¡ Ó¸Áúu>õèÃ(uf§=;êîs»z ½‹ÓbbU[̈–mÇ¿SÅ’{ž+¥ð¾«ý£(¼±È*ýÞcÏ>ÕÆéúíq©t¾|ªJ�¥•€å†}GZMU·…àI–6’+‰"ùG!wqÉÇã]µòšr‡*Ðu°Ðåå†ç¥\hŽn"“™X°w!°¹Žù5±i4Ò€°B®Òìç·çÍq÷:Ôíâ¹–ê$Õ6–UVÀŸ\ýk·†YXy¡YX…vWËbB
    PHP:
     
    jasimjatjasim2, Sep 10, 2009 IP
  9. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #9
    use ajax, surely it will hide the code inside the container
     
    bartolay13, Sep 10, 2009 IP
  10. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The "some code like this" you are talking about is actually the image.. just in a binary or textual representation because the appropriate headers haven't been sent. Anyone savvy can just save that as a jpg.
     
    premiumscripts, Sep 10, 2009 IP
  11. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #11
    You can save that as image using browsers :D

    So no protection is there.
     
    ads2help, Sep 11, 2009 IP
  12. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #12
    This is a different approach

    On all your pages start a session and set a variable when the page has loaded like this.
    
    
    <?php 
    
       session_start();
       $_SESSION['last_page_load'] = time();
    
    ?>
    
    PHP:
    Then you create a script with the following code
    
    <?php
    
       session_start();
    
      $seconds = 20;   
    
       if (time() - $_SESSION['last_page_load']< $seconds) {
          $file = substr($_SESSION['REQUEST_URI'],-3);
          header('Content-type: image/'.$file); 
    
        echo file_read_contents($_SESSION['REQUEST_URI']);
        exit;
    
     }
    
    
    ?>
    
    
    PHP:
    Then add a redirect rule for all images to this file like this

    
    
    RewriteRule ^images/(.*)$ http://www.mydomain.com/imagecheck.php
    
    
    Code (markup):
    This means that all images actually will be loaded via the imagecheck.php file.
    All requests to the images that are later than 20 seconds after the last page load will load nothing.

    NOTE:
    I have not tested this script so not sure if it will work but it should with some testing and debugging.
     
    stephan2307, Sep 11, 2009 IP
  13. awesometbn

    awesometbn Peon

    Messages:
    268
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Is this method really necessary to put a random code in the call to an image file? Why not just use an Apache server and edit your .htaccess file to prevent others from hotlinking your images?

    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]
    RewriteRule \.(gif|jpg|swf|flv|png)$ /feed/ [R=302,L]
    
    Code (markup):
    See hxxp://www.askapache.com/htaccess/mod_rewrite-tips-and-tricks.html#prevent-hotlinking for more discussion about using mod_rewrite.
     
    awesometbn, Sep 11, 2009 IP
  14. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #14
    please explain the steps in detail
    thank you for the fast response
     
    jasimjatjasim2, Sep 11, 2009 IP
  15. caprichoso

    caprichoso Well-Known Member

    Messages:
    433
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    110
    #15
    If you want to allow users to see the image in the browser but prevent them from downloading the image, I have some bad news for you. :)
     
    caprichoso, Sep 11, 2009 IP
  16. LOD

    LOD Member

    Messages:
    319
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #16
    why dont u use ur apache server's hotlink setting so that no one can access the picture outside of ur own server. ... and for browsers being able to save the jpg as image, u can easily avoid it by taking a div tag equal to the image size and then use its background image property to load the image.. that way no one will be able to save it as picture anymore or do any dragging or whatever...
    let me know if it helps...
     
    LOD, Sep 12, 2009 IP
  17. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #17
    i need it for applying on a dynamic site not in static
    and also i know hotlinking but
    i using the same images on morethan one site
    so please read my thread main post and then you can understand my idea
    i hope it can be happen
    but i don know much php to code such an idea
     
    jasimjatjasim2, Sep 12, 2009 IP
  18. awesometbn

    awesometbn Peon

    Messages:
    268
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #18
    That's easy. You can still use the hotlinking code I displayed earlier. All you have to do is add as many URLs as you want. Using the same images on more than one site is not a problem.
     
    awesometbn, Sep 12, 2009 IP
  19. jasimjatjasim2

    jasimjatjasim2 Active Member

    Messages:
    180
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #19
    Please suggest some php code for the main post on this thread
    that is for my idea
    i need a working php file for my idea
     
    jasimjatjasim2, Sep 12, 2009 IP
  20. gamelover

    gamelover Guest

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Hi,
    Please check these links and if you interested in pm me?
    dailyfreelink.com/contact.php (You will see a security code whose link is dailyfreelink.com/images/securityImage.php)

    Then when you copy and open image path with browser as dailyfreelink.com/images/securityImage.php
    You will see a message as "You have no privilege to access this item"

    is it ok?
     
    gamelover, Sep 13, 2009 IP