Php mkdir
Posted: Mon Dec 21, 2009 4:55 pm
Hi
This is an excerpt from my php file. I am trying to create directories using the users first name as a test. The directory is created but it is called $nfirstname. Does anyone know how I can change the mkdir line to ensure that the variable content is used to name the directory rather than this.
This is an excerpt from my php file. I am trying to create directories using the users first name as a test. The directory is created but it is called $nfirstname. Does anyone know how I can change the mkdir line to ensure that the variable content is used to name the directory rather than this.
Code: Select all
<?php
if (isset ($_POST['submit']))
{
$ntitle = $_POST['title'];
$nfirstname = $_POST['first_name'];
$nlastname = $_POST['last_name'];
mkdir($_SERVER['DOCUMENT_ROOT'].'\project\website\admin\trainer\$nfirstname\inbox');
mkdir($_SERVER['DOCUMENT_ROOT'].'\project\website\admin\trainer\$nfirstname\outbox');
//posted elements displayed back to screen
$nhouse_number = $_POST['house_number'];
$nstreet = $_POST ['street'];