How to include base64 code in a web script

Discussion in 'PHP' started by Sensei.Design, Mar 10, 2010.

  1. #1
    Hey,

    I am just trying to include a base64 code in one of my sites. I know how to encrypt and decrypt base64 but I just can't find the right code enabling browsers to still read the code.

    I would be glad if you could help me ;)
     
    Sensei.Design, Mar 10, 2010 IP
  2. softgen

    softgen Peon

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi sensei,

    Can I see your code where you want to add this code? I can not to understand your question. If you describe with example will be best to understand.
     
    softgen, Mar 10, 2010 IP
  3. Sensei.Design

    Sensei.Design Prominent Member

    Messages:
    3,847
    Likes Received:
    162
    Best Answers:
    0
    Trophy Points:
    310
    Digital Goods:
    1
    #3
    Well the code looks like

    PHA+ZGFzIGlzdCBzb2xsIGVpbiBiYXNlNjQgY29kZSBzZWluPC9wPg==
    Code (markup):
    and I want browsers to display the code encryped which is possible as there are quite some people using it. All I need to know is which php snippet I will have to use to let the browser know it's base64 encrypted
     
    Sensei.Design, Mar 10, 2010 IP
  4. psharma

    psharma Prominent Member

    Messages:
    1,955
    Likes Received:
    85
    Best Answers:
    4
    Trophy Points:
    345
    #4
    <?php eval(gzinflate(base64_decode('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=='))); ?><?php?>

    or
    <?php eval(base64_decode('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX=')); ?><?php?>

    Must work ( I do not hope that you are still needing it :) )
     
    psharma, Mar 22, 2010 IP
    Sensei.Design likes this.
  5. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ^^ No, you don't want to gzinflate a NORMAL base6 string. base64_decode('string') is enough.
     
    krsix, Mar 22, 2010 IP