Guevenmarlq
New Member
I'm currently using this code for a XML Login/Register system. \[code\]<?php$errors = array();if(isset($_POST['login'])){$username = preg_replace('/[^A-Za-z]/', '', $_POST['username']);$email = $_POST['email'];$password = $_POST['password'];$c_password = $_POST['c_password'];if(file_exists('users/' . $username . '.xml')){ $errors[] = 'Username already exists';}if($username == ''){ $errors[] = 'Username is blank';}if($email == ''){ $errors[] = 'Email is blank';}if($password == '' || $c_password == ''){ $errors[] = 'Passwords are blank';}if($password != $c_password){ $errors[] = 'Passwords do not match';}if(count($errors) == 0){ $xml = new SimpleXMLElement('<user></user>'); $xml->addChild('password', md5($password)); $xml->addChild('email', $email); $xml->asXML('users/' . $username . '.xml'); $xml->asXML header('Location: login.php'); die;} } ?>\[/code\]What I'd like to do is make a folder for the user once they have registered to upload images into. Example of this\[quote\] uploads/$username$/uploadedfile.JPG\[/quote\]Doesn't just have to be .JPG files it can be any, but I don't think that matters here.I've tried it with MKDIR but I think I did it wrong.. I looked around Stackoverflow and the net and couldn't find anything.