คือมัน error อะไรครับ
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้<?php
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 exsits';
}
if($username == ''){
$errors[] = 'Username is blank';
}
if($email == ''){
$errors[] = 'Email is blank';
}
if($password == ''){
$errors[] = 'Password are blank';
}
if($password !=$c_password){
$errors[] = 'Password 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');
header('Location:login.php');
die;
}
}
?>
<html>
<head><title> User Page</title>
</head>
<body>
<h1>Register</h1>
<form method = "post" action="">
<?php
if (count($errors)>0)
{
echo '<ul>';
foreach($errors as $e)
echo '<li>' . $e . '</li>';
}
?>
<p>Username<input type="text" name="username"></p>
<p>Email<input type="text" name="email"></p>
<p>Password<input type="password" name="password"></p>
<p>Confrim Password<input type="password" name="c_password"></p>
<p><input type="submit" name="login" value="Login"></p>
<h2>Welcome,<?php echo $_SESSION['username']; ?> </h2>
<hr />
<a href="logout.php">Logout</a>
</body>
</html>
Warning: SimpleXMLElement::asXML(users/aaa.xml) [simplexmlelement.asxml]: failed to open stream: No such file or directory in C:\AppServ\www\users\register.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\users\register.php:28) in C:\AppServ\www\users\register.php on line 29
php / xml ? txt ? ช่วยทีครับ
[Spoil] คลิกเพื่อดูข้อความที่ซ่อนไว้
Warning: SimpleXMLElement::asXML(users/aaa.xml) [simplexmlelement.asxml]: failed to open stream: No such file or directory in C:\AppServ\www\users\register.php on line 28
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\users\register.php:28) in C:\AppServ\www\users\register.php on line 29