Somethings going wrong in these lines:PHP Code:<html>
<h3>Testing Site</h3>
<form method = "POST" action = "<?php echo $_SERVER['PHP_SELF'];?>">
<input type = "hidden" name = "send" value = "1">
<p>UserName<input type = "text" name = "UserName"/></p>
<p>Password<input type = "text" name = "Password"/></p>
<input type="submit" value ="Login" />
</form>
<body background="http://users.pandora.be/creeping_death/Babes/Anna%20Kournikova%2002.jpg">
</body>
<?php
If($_POST['send']=="1"){
$filename = "UnP.txt";
$UserName = $_POST['UserName'];
$Password = $_POST['Password'];
$handle = fopen($filename,"r") or die("Err1");
$contents = @fread($handle,filesize($filename));
fclose($handle);
$Str = strpos($contents,$UserName." ".$Password);
If($Str===False){
$MakeUser = True;
}
If($MakeUser = True){
$handle = fopen($filename,"w") or die("Err2");
$contents = $contents.":$UserName $Password)";
fclose($handle);
echo "Making Username";
}Else{
Echo "Logged in!";
}
}
?>
</html>
Because its saying Making Username, but not entering the information (or erroring)..PHP Code:If($MakeUser = True){
$handle = fopen($filename,"w") or die("Err2");
$contents = $contents.":$UserName $Password)";
fclose($handle);
echo "Making Username";
}Else{
Echo "Logged in!";
}



Reply With Quote