Create PHP file using PHP
<p><strong>What I currently have...</strong></p>

<p>I have an ADD RECORD page where I add new partner stores that I work with. After I fill out the fields and click Save, it saves the data to a MYSQL table.</p>

<p><strong>My Goal...</strong></p>

<p>I would like a new PHP file get created in my web directory <em>(root is fine)</em> using the contents of one of the fields on the ADD RECORD page. Additionally, I would like that file that gets created have preset content.</p>

<hr>

<p><strong>Here is an example:</strong> (with screenshots)</p>

<p><strong>1) I'll create a new record. The 4th field called EDIT URL will be the input field I would like to use for the file name creation.</strong> Let's say I give it the name "edit_paint_store"</p>

<p><a href="https://i.stack.imgur.com/OwM4A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OwM4A.png" alt="enter image description here"></a></p>

<p><strong>2) After click SAVE RECORD, a new file will be created in my web dir called "edit_paint_store.php"</strong></p>

<p><a href="https://i.stack.imgur.com/ed354.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ed354.png" alt="enter image description here"></a></p>

<p><strong>3) Not only will it create the file with this name, but it will always include a template code I will use.</strong></p>

<p><a href="https://i.stack.imgur.com/0xgTz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0xgTz.png" alt="enter image description here"></a></p>

<p>Hopefully this explains well enough and will be happy to provide any further details.</p>