pjk31337 Posted September 29, 2014 Share Posted September 29, 2014 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. ~PJ Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted September 29, 2014 Share Posted September 29, 2014 a) what have you tried? all you did is post what you want. we can only help you with your php code (which is the point of the php coding help forum section) once you have made an attempt and have code to post, along with any errors or symptoms you got from that code that you cannot resolve yourself. b) for a html template code/file there's no need to individually print each separate line of output. you could use one overall print/echo statement with one initial and one final " or just use the herdoc syntax, and if this is all just static html/css/javascript markup with no php variables in it, there's no need to use a print/echo statement at all, just make your html inline by putting a closing ?> tag, followed by your html, then put an opening <?php tag. any inline html is parsed by php and encapsulated for you using a php T_INLINE_HTML token and is output verbatim when executed by php. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.