Jump to content

How to store my source code in a MySQL table ?


tmyonline

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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.