PHP Developers Network

encapsulating entire HTML files with PHP print function
Page 1 of 1

Author:  pjk31337 [ Sun Sep 28, 2014 8:35 pm ]
Post subject:  encapsulating entire HTML files with PHP print function

Ok so here's what I'm trying to do and what I'm having to do since I can not figure out how to script this.

I create my GUI for scripting in HTML. When I script I create a full HTML page for my input forms, one full HTML page for the error code and lastly one HTML page for the receipt when the script runs correct. I then create my php scripting (basic template where I can cut and paste my HTML for the GUI output once it has been encapsulated in FULL be the php print function after having the quotation marks escaped and replaced by a backslash follow by a quotation mark).

Currently and over the past Decade. I have done this encapsulation the Hard way. Meaning I build my HTML file in FrontPage. I save the HTML file and then I open it in Microsoft Notepad. First thing I do is use the replace All function from the edit menu to Find every instance of " and replace them all with \" then I manually goto the first line of code and place a Tad then type print " I then hold control and shift to copy the ( tab print ") and begin to paste manually using Ctrl V and then I hit the down arrow on my keyboard quickly followed by the Home button to drop my cursor down a line and input the beginning of my PHP print function encapsulation one frigging line at a time. Once I've reach the very bottom, I go up the back right hand side of the HTML document with my ending quotation followed by semi colon manually with Ctrl V and hitting up arrow followed by end button.

This process of encapsulation the hard way with note pad takes up 90% of my dev time when programming. It makes stuff easy to read in my code and is perfect for outputting. What I would like to do is find a way to create a php script with a file upload form field that would take the input of any and all html files and parse the full document automating the exact process that I run on all of my HTML GUI files so that I can turn the encapsulation work into nothing and focus on the actual scripting.

You wouldn't believe how many hours of Ctrl V and up n down end and home I have pressed. Spent 8 hours last night alone. When form fields have multiple drop down selectors for country code ect. the HTML files to encapsulate manually become Ridiculously long.

I have never seen or heard of anyone doing exactly what I've explained here as I know the print function used like this is not normal. Every HTML file or snippet in any of my scripting is always encapsulated in the print function to output. And I have no intentions on changing my style. I would like to automate my process. And if it is too complex for me to build it in a decent amount of time I am willing to pay good money to get this finished for me ASAP.

Please message me back ASAP as I'm working on a personal project that has over 2,000 HTML files for me to encapsulate a the minimum.


Author:  pjk31337 [ Sun Sep 28, 2014 10:08 pm ]
Post subject:  Re: encapsulating entire HTML files with PHP print function

I know the addslashes PHP function will handle replacing the quotes with backslash quotes.

For opening the HTML file as a txt doc I guess I would use the readfile PHP function to display the HTML to the output.

I'm not sure what to use for adding the print " and "; to the front and end of every single line.

I appreciate the extra eyes on this! Loving the resources on these forums!


Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group