Note that there are some explanatory texts on larger screens.

plurals
  1. POPhp problem eval/html/php
    primarykey
    data
    text
    <p>I've been writing a php/html page encoder/decoder... I know it already exists but it's a university project so go on XDDD</p> <p>I encode the pages that I want to protect let's say hypothetically with <code>base64_encode</code> and when I receive a request of any pages I have a loader that reads the coded page, decrypts it and with <code>eval</code> executes it. The real problems arise when I try to decrypt and execute a mixed php/html page. Obviously <code>eval</code> can't execute html code so my question is do I really become crazy about splitting the page executing the php code and print the html? And also if I include an encoded php or php/html page do I really have to reuse the method up here?</p> <p>I hope someone can really help me because i have a week left before the deadline and I can't change the project at this point.</p> <p>chris here the function and the fisrt calling in $param[0] i've got the filename called</p> <pre><code>function MyInclude($filename) { // create the temp file $temp_filename = "tmp.php"; $handle = fopen($temp_filename , 'w+'); if (!$handle) die('Error creating temp file'); // write the decrypted data, close the handle $tmp=file_get_contents($filename); $data=MCrypt_Decode($tmp,'PFL_EPU_V100_mia'); fwrite($handle,$data ); fclose($handle); // start output buffering to contain any output the script creates ob_start(); try { include($temp_filename); } catch (Exception $e) { die('There was an error in the encrypted file, cannot process'); } // get the output, clear the buffer $output = ob_get_contents(); ob_end_clean(); //destroy the temp file unlink($temp_filename); // now you can output the buffer, if desired: echo $output; } MyInclude($param[0]); </code></pre> <p>the $param[0] file here</p> <pre><code>&lt;?php session_start(); $_SESSION['title']='Home'; MyInclude("header.php"); ?&gt; &lt;body&gt; sono il body &lt;?php echo APP_PATH; ?&gt; &lt;/body&gt; &lt;? echo "boss"; MyInclude("footer.php"); ?&gt; </code></pre> <p>any idea about it??? or you need some other code??? let me know T_T</p> <p>Mike</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload