Undefined variable

Discussion in 'PHP' started by talker1, Apr 23, 2011.

  1. #1
    when i run this function i have this error:

    Undefined variable: decode_out

    
    	function decode() {
    		header('Content-type: application/php');
    		header('Content-Disposition: attachment; filename="decode_'.$_FILES['php_script']['name'].'"');
    		$file = file_get_contents ($_FILES['php_script']['tmp_name']);
    		$file = str_replace('eval(base64_decode($Q', '$decode_out = (base64_decode($Q', $file);
    		eval('?>'.$file.'<?');
    		echo '<?'.$decode_out;
    	}
    
    PHP:
     
    talker1, Apr 23, 2011 IP
  2. viruthagiri

    viruthagiri Active Member

    Messages:
    232
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    95
    #2
    Your code totally confusing me. I see many open brackets in the following line but but less closing brackets. Try to fix them first.

     
    viruthagiri, Apr 23, 2011 IP
  3. x319

    x319 Well-Known Member

    Messages:
    90
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    103
    #3
    Please explain what your trying to do. Also, your str_replace function is missing an argument and I do not know why you are trying to cast eval on PHP tags...? $decode_out isn't found because you the $decode_out variable is inside an eval function which is inside a string, therefore it has not been executed.
     
    x319, Apr 23, 2011 IP
  4. rajeev_seo

    rajeev_seo Peon

    Messages:
    211
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    please first define what you do in that code
    its not right and $decode-out variable is not found in the code
     
    rajeev_seo, Apr 24, 2011 IP