travisdolphin
New Member
\[code\]<?php$errors = array();if (isset($_POST['login'])) { $fname = $_POST['fname']; $mname = $_POST['mname']; $lname = $_POST['lname']; $title = $_POST['title']; $affil = $_POST['affil']; $address = $_POST['address']; $city = $_POST['City']; $state = $_POST['State']; $country = $_POST['Country']; $zip = $_POST['ZipCode']; $phone = $_POST['PhoneNo']; $fax = $_POST['FaxNo']; $email = $_POST['email']; $web = $_POST['WebSite']; $username = preg_replace('/[^A-Za-z]/', '', $_POST['username']); $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) { $dom = new DOMDocument(); $dom->encoding = 'utf-8'; // set the document encoding $dom->xmlVersion = '1.0'; // set xml version $dom->formatOutput = true; $dom->xmlStandalone = true; // Creates the root element of the xml file $node = $dom->createElement('user'); // Create a child node $child_node_1 = $dom->createElement('fname', $fname); $child_node_2 = $dom->createElement('mname', $mname); $child_node_3 = $dom->createElement('lname', $lname); $child_node_4 = $dom->createElement('title', $title); $child_node_5 = $dom->createElement('affil', $affil); $child_node_6 = $dom->createElement('address', $address); $child_node_7 = $dom->createElement('City', $city); $child_node_8 = $dom->createElement('State', $state); $child_node_9 = $dom->createElement('Country', $country); $child_node_10 = $dom->createElement('ZipCode', $zip); $child_node_11 = $dom->createElement('PhoneNo', $phone); $child_node_12 = $dom->createElement('FaxNo', $fax); $child_node_13 = $dom->createElement('email', $email); // Create // child // element $child_node_14 = $dom->createElement('WebSite', $web); $child_node_15 = $dom->createElement('username', $username); $child_node_16 = $dom->createElement('password', $password); $node->appendChild($child_node_1); // append // child // element // to // the // node $node->appendChild($child_node_2); $node->appendChild($child_node_3); $node->appendChild($child_node_4); $node->appendChild($child_node_5); $node->appendChild($child_node_6); $node->appendChild($child_node_7); $node->appendChild($child_node_8); $node->appendChild($child_node_9); $node->appendChild($child_node_10); $node->appendChild($child_node_11); $node->appendChild($child_node_12); $node->appendChild($child_node_13); $node->appendChild($child_node_14); $node->appendChild($child_node_15); $node->appendChild($child_node_16); $dom->appendChild($node); // append // the // root // node $dom->save('users/' . $username . '.xml'); header('Location: login.php'); die(); }}?>\[/code\]hello every body this is srikanththis is my php code for xml file creation it's working in linux based server xml file creating but it doesn't work in windows based server what is my mistake in this code please let me know my programing mistake can you help me anyone please....