SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation base64_encode/base64_decode problem

    Hi,

    Could you please tell me where is the error in the fallowing code:

    PHP Code:
    $name "Angry Coder";

    $name base64_encode ("echo $name;");

    echo 
    $name;

    echo 
    "<br><br><br>";

    eval (
    base64_decode ("ZWNobyBBbmdyeSBDb2Rlcjs=")); 
    Thanks
    Why It Doesn't Work?!

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    $name base64_encode ("echo $name;"); 
    should be:

    PHP Code:
    $name base64_encode ($name); 
    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. But i don't think that was the problem!

    The fallowing code works fine:

    PHP Code:
    $name "AngryCoder";

    $name base64_encode ("echo $name;");

    echo 
    $name;

    echo 
    "<br><br><br>";

    eval (
    base64_decode ("ZWNobyBBbmdyeUNvZGVyOw==")); 
    I just removed the blank space from the variable $name!

    I need to put spaces in my string!

    Why It Doesn't Work?!

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Location
    Israel
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    try this

    instead of
    PHP Code:
    $name base64_encode ("echo $name;"); 
    change the " to a ' (single insted of double).
    havent tried it but since when doing something like this:
    PHP Code:
    $name="Shanor"
    and then
    PHP Code:
    echo "hello $name"
    what u get is
    hello Shanor
    what u actually wanna get as i understand it from u'r explanation is not the value of $name but the dollar sign and the name word so that u'll be able to execute it in the future...
    doint the following:
    PHP Code:
    $name="Shanor"
    echo 
    'hello $name'
    will result in:
    hello $name
    therefore u should have the following code line:
    PHP Code:
    $name base64_encode ('echo $name;'); 
    hope i made myself clear.
    Shanor
    You can't see your self in the mirror with your eyes closed!

  5. #5
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    coder...pardon my ignorance, but what exactly is it you're trying to achieve with this code ?
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  6. #6
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    shanor,
    Thanks for your help, but please read the fallowing to know what i want to do :


    redux,
    I am coding a script -that's not free- and i don't want people who buy it remove the copyright lines!!!
    ... I know they can remove it. But it will be much difficult if i do it this way
    Why It Doesn't Work?!

  7. #7
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, so you want to encode the "echo my copyright notice" bit and then have the decoded bit executed...right...but what stops people from just removing the eval() ? ok, inexperience users might not make a direct connection between an eval and a copyright notice appearing, but through trial and error they will.
    also, if i personally saw this, i would damn sure want to know first thing what the decoded thing is before i let eval run lose on my server...ok, maybe paranoid, but that's me, eh ?
    so...like the idea, but i think it's not worth it really...imho, of course
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  8. #8
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    on a related note: maybe it's worth looking at zend encoder. ok, maybe a bit pricey, but i don't know what kind of price you're asking for your script...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  9. #9
    SitePoint Enthusiast
    Join Date
    Jan 2002
    Location
    Israel
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thats what i tought u were about to do.

    i guessed that, i saw it once in one of the code exchange sites...
    but trully, just as redux said, the first thing i did was to decode it and analize the code (in that code not just the copyrigth was encrypted but the entire 200 rows were encrypted).
    plz do tell me if what i wrote priviously worked?
    Shanor.
    You can't see your self in the mirror with your eyes closed!

  10. #10
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no programmers will not be able to decode it! believe me!
    Some people can not even edit the config file!!!

    +

    The code of my script is complicated enough!

    +

    I gonna put some IMPORTANT variables in the encrypted code, so if (he) remove the copyright notice the script will be destroyed

    shanor,
    no, it didn't works.
    Why It Doesn't Work?!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •