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 8678867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:49:49+00:00 2026-06-12T20:49:49+00:00

This is a bit hard to explain: I have a simple PHP file that

  • 0

This is a bit hard to explain: I have a simple PHP file that outputs another PHP file with an include:

<?php include("file.php"); ?>

What I wanted to do is to have only part of it shown in the first page. So I used overflow to create a window with scrollbars:

<div style="height: 130px; width: 800px; border: 1px solid #CCCCCC; overflow: auto;">
 <?php include("file.php"); ?>
</div>

Everything works great. But now I want to add another functionality: When you click inside this overflowed area and press Ctrl+A, only the part in the overflowed area should be selected (not the whole page).

I tried using HTML frames, which gave me the function I wanted but the overflowed PHP file doesn’t get parsed. Is there a way to accomplish this and still have the PHP file be parsed?

  • 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-06-12T20:49:51+00:00Added an answer on June 12, 2026 at 8:49 pm

    You have several options

    Don’t include, link through iframe

    I don’t know how you did it, but frames have no influence over what is parsed by the server. IFrames, or frames, just make a regular GET request, the server then decides whether to parse or not the requested file.

    file1.php

    <style>
        .document {
            height: 130px; 
            width: 800px;
            border: 1px solid #CCCCCC;
        }
    </style>
    <iframe src="file2.php" class="document" />
    

    Include into an element that limits the “select all”

    If you only want to include “text” (who knows, it could be…). Consider putting your included file into a textarea.

    file1.php

    <style>
        .document {
            height: 130px; 
            width: 800px;
            border: 1px solid #CCCCCC;
        }
    </style>
    <textarea class="document"><?php include('file2.php'); ?></textarea>
    

    Quirky way: catch “ctrl+a” and apply contenteditable for a moment

    ContentEditable fields limit their “select all”. See demo here

    file1.php

    <style>
        .document {
            height: 130px; 
            width: 800px;
            border: 1px solid #CCCCCC;
        }
    </style>
    <div class="document"><?php include('file2.php'); ?></div>
    $(window).bind('keydown', function(e) {
        if(event.ctrlKey && event.keyCode == 65) {
            var self = $('.document').attr('contenteditable', '');
            window.setTimeout(function() {
                self.removeAttr('contenteditable');
            }, 20);
        }
    });
    

    ​Using contenteditable has 1 advantage over using textranges to select the contents: when clicking outside of your included document, all text on the page is selected (instead of “forcing” the “select only included file” feature).

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

Sidebar

Related Questions

its a little bit hard to understand. in the header.php i have this code:
This will be a bit hard to explain but I am going to have
This is something that I always find a bit hard to explain to others:
This is a bit hard to explain. I have a website with a lot
This is a bit hard to explain but I'll give it a go. Lets
This is a bit hard for me to articulate, but in PHP you can
This is a bit hard to explain in words ... I'm trying to calculate
Ok this is sort of hard to explain but basically i wrote a PHP
So this is kind of hard to explain in text, I have attached an
Kind of hard to explain, so here's some code. So I have this CSS,

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.