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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:28:12+00:00 2026-05-25T16:28:12+00:00

Currently I have a dynamic CSS file, completed by PHP from results in the

  • 0

Currently I have a dynamic CSS file, completed by PHP from results in the database. At the moment I’m converting the dynamic files into static files using output buffering. The conversion to a static file works like a charm but the action is called from a jQuery dialogwindow. After the operation is completed a small piece of HTML is printed to close the dialogform.

In here lies the problem. The HTML code gets printed instead of parsed. I believe it’s because of the output buffrering. When I comment the buffering code everything works again.

Can someone tell me what’s going wrong?

The code in the OB im using is:

ob_start();
$MC_ParseTemplateCall = 1;  # is used in the include to set some values         
require_once($Template); # Template contains the path and filename
$templateCss = ob_get_contents(); #using this to store it with fopen, fwrite & fclose
ob_end_clean();

Additional info:

From a file like save.php (which is executed in a jQuery dialog)

<?php
    // stuff to save template related settings happens above

    # Make a static CSS file
    ParseAndStoreTemplate(DIR_PATH_TO_ROOT."../website/Templates/MyTpl2011/CSS/MyTpl2011.php");
?>
<html>
    <body onLoad="window.parent.CloseDialog();"></body>
</html> 

Function to store the template:

function ParseAndStoreTemplate($Template)
{
    if(is_file($Template))
    {
        ob_start();
        $MC_ParseTemplateCall = 1;              
        require_once($Template);
        $templateCss = ob_get_contents();
        ob_end_clean();

        $fileName   = end(explode("/", $Template));
        $templateName   = reset(explode(".php", $fileName));
        $websitePath    = DIR_PATH_TO_ROOT."../Global/Files/Website/".$GLOBALS["WebsiteId"]."/";
        $templateFolder = "CSS";

        if(!is_dir($websitePath.$templateFolder))
            mkdir($websitePath.$templateFolder);

        file_put_contents(  
            $websitePath.$templateFolder."/".$templateName,
            $templateCss);
    }
    else
        die("<strong>Opgegeven templatebestand bestaat niet</strong>: ".$Template);
}
  • 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-25T16:28:12+00:00Added an answer on May 25, 2026 at 4:28 pm

    Figured it out already. It seemed that the Content-Type header gets changed during output buffering. After telling the browser it should behave like a text/html page the dialog gets closed again like it should. Thanks anyway!

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

Sidebar

Related Questions

I have a css file that links to images. .test{ background: url(http://site.com/dynamic/test.jpg) no-repeat; }
I currently have a SQL query that returns results based on a dynamic number
I currently have a query that returns results based on a dynamic set of
I currently have the dynamic array: char *myData[500][10]; //myData is the name of an
I have a table with almost 800,000 records and I am currently using dynamic
I currently have an MS Access application that connects to a PostgreSQL database via
I currently have an existing database and I am using the LINQtoSQL generator tool
We currently have one dynamic web project (our main web application) already setup on
I currently have: <?php if (isset($_POST[submitwrite])) { $handle = fopen(writetest.txt,w+); if ($handle) { fwrite($handle,
Currently I have some xml documents which are converted via xsl into html. The

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.