.HTML to .PHP Application

Hello,

As mentioned in another thread in the forums people where interested I share a application I have written that converts HTML documents to PHP. Here is the application and details.

Features :star:

  • Allows you to write PHP in Custom Code tags, and convers this from HTML encoding back into plain text.
  • Removes .html from all links on your page, this does require you setup an .htaccess file
  • Easy file explorer to find the pages you want to convert.
  • Can just strip .html from links if you choose Keep .html
  • Bulk file conversion
  • No technical knowledge required to setup and run the application.
  • Progress bar tracks what file it is working on.
  • Error reporting for if it finds issues.

How to use the application :mortar_board:

  1. Export your design from Bootstrap Studio to one folder.
  2. Open the application.
  3. Click Browse.
  4. Search and select the parent folder that contains your CSS, JS, Images, HTML files.
  5. Click OK
  6. Choose if you just want to strip .html from links by selecting Keep .html OR choose convert to .php to convert your PHP code and the file extensions into PHP.
  7. Wait for the program to finish.

Support :wrench:

Please leave a message below if you have any issues, I shall be happy to assist when I have a moment. If you have feature suggestions I am willing to take them on, however please remember this is provided as is for free and developed in my spare time.

Download

The file is provided as a .exe file, It is just a PowerShell script under the hood.

image|100%x58

6 Likes

I have never understood why one would want to write PHP in an app that does not support PHP. Who wants to write a Laravel app with a frontend-only setup?

1 Like

The password to download the file is: B00tstrapStudio!

I’ve had to add this as there’s been over 200 download attempts in the past day, and the notifications are getting annoying.

Very Cool of you to put this together and then share it, Thank You, :smiley:

Why do you not configure your Webserver to run php for html extensions too?

  1. In my opinion that’s not best practice.
  2. If you use the Custom Code element in Bootstrap Studio, then export your design the PHP code is HTML encoded so doesn’t run, which is something this script fixes.

I usually use the Custom Code element to add PHP that adds the copyright year, and I include partials, like the header or footer for the pages so I can just update one file. The conversation script is intended purpose is for small things like this.

1 Like

Why should the PHP code not be executed? Of course it does if the web server executes php in html files. I have been doing this for years…

<div><?php echo date() ?></div>

Still, great work from you. I don’t want to badmouth it…

I was not disagreeing that it would not, nor am I disagreeing that you should not use .html files that have PHP code in them, I know you can configure a server to run PHP within a .html file. However, it is my personal preference not to do this due to the extra configuration required, its not default behaviour. Making files that run PHP code have the .php extension removes any ambiguity for what those files run, and requires no further setup for end users of the application.

If you write PHP code within bootstrap studio that is not in a custom code block, then export your design, text becomes HTML encoded, so your code becomes:

<div>&lt;?php echo date() ?&gt;</div>

Hence why PHP code would not ordinarily run. The application resolves any detected HTML encoding issue if you choose to convert the files to PHP, by smartly picking out the PHP blocks from the HTML.

If you prefer working with .html files with PHP code inside them, you can rename the extensions after the conversion. Its really up to the way you wish to work on your sites.

I hope this is more clear, and I appreciate your interest.