Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6361839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:49:44+00:00 2026-05-24T23:49:44+00:00

I’ve been writing a php/html page encoder/decoder… I know it already exists but it’s

  • 0

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

I encode the pages that I want to protect let’s say hypothetically with base64_encode and when I receive a request of any pages I have a loader that reads the coded page, decrypts it and with eval executes it. The real problems arise when I try to decrypt and execute a mixed php/html page. Obviously eval 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?

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.

chris here the function and the fisrt calling in $param[0] i’ve got the filename called

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]);

the $param[0] file here

<?php
 session_start();
 $_SESSION['title']='Home';
 MyInclude("header.php");
?>

<body>
    sono il body <?php echo APP_PATH; ?>
</body>

<?
echo "boss";
 MyInclude("footer.php");
?>

any idea about it??? or you need some other code??? let me know T_T

Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:49:44+00:00Added an answer on May 24, 2026 at 11:49 pm

    Is it possible to decrypt the page, write it to a file, then include it? That would let the PHP interpreter do what it does best – interpret PHP documents. That will include HTML/PHP combinations without relying on eval.

    The outline of that would be:

    // create the temp file
    $temp_filename = "tmp.php";
    $handle = fopen($filename , 'w');
    if (!$handle)
      die('Error creating temp file');
    
    // write the decrypted data, close the handle
    fwrite($handle, $decrypted_data);
    fclose($handle);
    
    // start output buffering to contain any output the script creates
    ob_start();
    
    try {
     include_once($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;
    

    Function references

    fopen: https://www.php.net/manual/en/function.fopen.php

    fwrite: https://www.php.net/manual/en/function.fwrite.php

    fclose: https://www.php.net/manual/en/function.fclose.php

    ob_start: https://www.php.net/manual/en/function.ob-start.php

    ob_get_contents: https://www.php.net/manual/en/function.ob-get-contents.php

    ob_end_clean: https://www.php.net/manual/en/function.ob-end-clean.php

    unlink: http://www.php.net/manual/en/function.unlink.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.