Jump to content

Recommended Posts

Hi guys,

 

Is there a way to store the source code (output) of my program in a MySQL database table ?  By meaning "source code", I mean, on Firefox, you go to View > Page Source, i.e., the output of my program.  Is there a way to access this source code using PHP so that I can dump it into a MySQL table.  Any ideas ?  Thanks so much.

That would depend on how you are using file_get_contents() and what errors there are. What is your code and what does putting the following two lines immediately after your first opening <?php tag give -

ini_set ("display_errors", "1");
error_reporting(E_ALL);

Thanks PFMaBiSmAd.  I tried your suggestion:

 

ini_set ("display_errors", "1");

error_reporting(E_ALL);

 

and no errors were reported.

 

Unfortunately, my code is rather long and, due to the imposed security at my work place, I cannot post my code here or elsewhere.  However, I have tried your suggestions on several files and didn't receive any error.

Sorry, cannot help you without any specific information to go by. There are several php configuration differences that could cause code to work on one server and not on another one and based on the symptoms the problem might not even have anything to do with file_get_contents().

If this is on a local server, and the retrieval is also on the local server. U may opt to use ob_start/ob_end_clean functions.

 

This will buffer the output, until ob_end_clean is called, which returns a string with the buffer contents (output to browser). from there ya can save or do wutever ya like.

 

If this is on a local server, and the retrieval is also on the local server. U may opt to use ob_start/ob_end_clean functions.

 

This will buffer the output, until ob_end_clean is called, which returns a string with the buffer contents (output to browser). from there ya can save or do wutever ya like.

 

 

Thanks so much laffin.  You are the man.  Thanks again!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.