title: PHP Create Folder, Create Subfolder using #ID and Upload a default file?
body: <p>Alright so I've had a bit of a go in my mind about this but I didn't really want to start without knowing how I was going to do it...</p>
  
  <p>I will be providing basic automatic hosting on my hosting account, where as the user will check the website, pay for a hosting package using PayPal and IPN does what it does. That I already have in place and working. However, how would I type a script which would automatically upon payment - Create a Folder using the NEXT <code>AUTO_INCREMENT #ID</code> number in say table <code>WebDesign_HostingAccounts</code>. So if the next ID to be used was say #0005, the folder would be named '0005' and in that folder then automatically add a Public_HTML subfolder and upload a Welcome.PHP page. </p>
  
  <p>I know it would have something to do with the following script clips: </p>
  
  <pre><code>&lt;?php
  // Desired folder structure
  $structure = './depth1/depth2/depth3/';
  
  // To create the nested structure, the $recursive parameter 
  // to mkdir() must be specified.
  
  if (!mkdir($structure, 0777, true)) {
      die('Failed to create folders...');
  }
  // ...
  ?&gt;
  </code></pre>
  
  <p>But how would I add that in to a MySQL Query to check the next ID and then upload a welcome page? </p>
  
  <p>Any basic scripts would be of much help! Thanks! </p>