please see the code below :
<?php
$str1 = 'My Name Is : ';
$str2 = 'Dvid!';
echo $str1.$str2;
?>
just a simple php code.
i want to encode (for example base64) this php file and use encoded php file instead of normal.
so the base64 encode of the codes upper is like below :
PD9waHANCiRzdHIxID0gJ015IE5hbWUgSXMgOiAnOw0KJHN0cjIgPSAnRHZpZCEnOw0KZWNobyAkc3RyMS4kc3RyMjsNCj8+DQo=
now how can i use that encoded php file?
i think eval() function is the answer!
so i changed the php file like this for use :
<?php
$str = 'PD9waHANCiRzdHIxID0gJ015IE5hbWUgSXMgOiAnOw0KJHN0cjIgPSAnRHZpZCEnOw0KZWNobyAkc3RyMS4kc3RyMjsNCj8+DQo=';
eval("base64_decode(\$str);");
?>
my problem is i really do n’t know why the output is blank (white screen)?
how can i fix this problem?
EDIT 1 :
i test using include instead after answers like below and i got an error :
<?php
include 'data://text/plain;base64,PD9waHANCiRzdHIxID0gJ015IE5hbWUgSXMgOiAnOw0KJHN0cjIgPSAnRHZpZCEnOw0KZWNobyAkc3RyMS4kc3RyMjsNCj8';
?>
and error :
important note :
i am looking for a way without any changing on server configurations, because we do n’t have access on remote host after publish…
EDIT 2 :
i removed
<?php
?>
part from base64 encode -> still have blank screen.
thanks for attention
Two problems here:
You’re evaluating the code:
which does nothing.
<?phpand?>tags in there, whichevalcan’t handle.So, one interesting solution is to use
includeinstead, with a PHPdata://URI:Note that you’ll need
allow_url_includeenabled for this to work.