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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:27:48+00:00 2026-06-10T20:27:48+00:00

I have a PHP page with HTML content in it. Now I run some

  • 0

I have a PHP page with HTML content in it. Now I run some PHP codes between HTMLs and I get some results. The fact is, when I try to get a respond from this page by AJAX it’ll show me the whole page content and plus the result I was looking for. What can I do to prevent the page from writing extra content. I know whenever something get printed on page it’ll go as respond to the AJAX call but I want a way to somehow fix this.

My page file (name: page.php):

<?php echo $Content->GetData('HEADER'); ?>
    <div id="Content">
      <div id="Page">
        <?php if($Content->GetData('PAGE','IS_TRUE')) : ?>
        <?php if(NULL !== $Content->GetData('PAGE','TITLE')) : ?>
        <?php echo $Content->GetPlugins("Page:" . $Content->GetData('PAGE','ID') . ",BeforeTitle"); ?>
        <div id="Title" dir="rtl">
          <a href="<?php echo $Content->GetInfo('ABS_ROOT') . "page/" . $Content->GetData('PAGE','NAME'); ?>"><?php echo $Content->GetData('PAGE','TITLE'); ?></a>
        </div>
        <?php echo $Content->GetPlugins("Page:" . $Content->GetData('PAGE','ID') . ",AfterTitle"); ?>
        <?php endif; ?>
        <div id="Content" dir="rtl">
          <div style="float: right; width: 966px; padding: 6px">
            <?php echo $Content->GetPlugins("Page:" . $Content->GetData('PAGE','ID') . ",BeforeContent"); ?>
            <?php echo $Content->GetData('PAGE','CONTENT'); ?>
            <?php echo $Content->GetPlugins("Page:" . $Content->GetData('PAGE','ID') . ",AfterContent"); ?>
          </div>
        </div>
        <?php else : ?>
        <div id="Content" dir="rtl">
          <div style="float: right; width: 966px; padding: 6px">
             There is no page like this in our archives.
          </div>
        </div>
        <?php endif; ?>
      </div>
    </div>
<?php echo $Content->GetData('FOOTER'); ?>

If I write an address in my browser like this localhost/cload/blog?action=rate it’ll go through my redirection list and show the page.php with blog plugin loaded. The problem is I want to call my blog plugin by AJAX through this address but it will first render the page data.

Sorry if this is messy.

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

    I’d suggest modifying page.php to be some functions, primarily a data processing function, and then an output function. Then, when you load the page, put a check in for whether it’s an AJAX request, and if so, echo the data you want as JSON, otherwise render the page using the output function.

    Alternatively, you could create a second, separate page, but that could be more difficult to maintain than a single file.

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

Sidebar

Related Questions

lets say i have two pages links.html & contents.php ... first page contains only
I have a PHP page that returns a piece of HTML to set the
I have an PHP/HTML main page, in which I include different other PHP files
I have a html button linked to php page. The php page calls a
I have created a html page in php and upon submission i validates that
I have am HTML form in a PHP page. The form has various inputs.
I have a simple html form. On php page. A simple list is placed
I'm pretty new to PHP and have a String which contains an HTML page.
I'm having a strange problem. I have a HTML page with PHP code which
I have 2 files, main.html and search.php . Within the main.html page, there is

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.