Secure EVAL?

Discussion in 'PHP' started by thesurface, Sep 15, 2010.

  1. #1
    so i have upload form lets say i have this php code

    
    $file = file_get_contents($_FILES['userfile']['tmp_name']); 
    eval('?>'.$file.'<?');
    
    PHP:
    and i dont want or someone to add into his file for example function fwrite or other dangerous its posslible? and exist there any better way NOT only eval?

    thanks
     
    thesurface, Sep 15, 2010 IP
  2. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #2
    Why would you want to? can you explain so we can offer you a better solution.
     
    danx10, Sep 15, 2010 IP
  3. thesurface

    thesurface Active Member

    Messages:
    260
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    73
    #3
    please can u read mail :)
     
    thesurface, Sep 15, 2010 IP
  4. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #4
    I no longer have access to that mail anymore (as I no longer work for them) so would be better posting here (also; so others can help you)
     
    danx10, Sep 15, 2010 IP