Drugs
09-08-2006, 06:59 PM
Ok for the first bit i need help, on the thing i use normally you have to add users manually to a txt file like this;
User1||password||
User2||password||
User3||password||
And so on, now i am trying to make an automated process and here is what i have;
newuser.php
<html>
<head>
<title>PixelResources Announement Creator</title>
</head>
<body>
<?php
if($_COOKIE['in'] == "1"){}
else{
die("You are not authrised to view this page.");
}
?>
<font size=1> <font face='verdana'>
<FORM name="shout" action="makeuser.php" method="POST">
Username;<br>
<INPUT TYPE="TEXT" name="username" size="20"><br><br>
Password;<br>
<INPUT TYPE="TEXT" name="password" size="20"><br><br>
<INPUT TYPE="Submit" name="submit" value="Create User" size="20">
</FORM>
<br>
</font>
<?php
// Copyright 2006 - 2007 PixelResources
?>
</body>
</html>
and makeuser.php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if(empty($username) OR empty($password))
{
echo "You forgot to fill in one or more of the form fields..";
}
else
{
echo "
<script language='javascript'>
alert('User successfully added...');
</script>
";
$username = ($username);
$password = ($password);
$tag = ("$username||$password||<br>");
$read = fopen("users/users.html", "r");
$contents = fread($read, filesize('users/users.html'));
fclose($read);
$write = fopen("users/users.html", "w");
fwrite($write, "$tag $contents");
fclose($write);
}
print "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";
// Copyright 2006 - 2007 PixelResources
?>
Basically when i do that, it comes out like this in the txt file;
User1||password|| User2||password|| User3||password||
And it doesn't work, i need to to go onto a new line each time i add a user, can someone edit the makeuser.php code so it will do that, thanks!
User1||password||
User2||password||
User3||password||
And so on, now i am trying to make an automated process and here is what i have;
newuser.php
<html>
<head>
<title>PixelResources Announement Creator</title>
</head>
<body>
<?php
if($_COOKIE['in'] == "1"){}
else{
die("You are not authrised to view this page.");
}
?>
<font size=1> <font face='verdana'>
<FORM name="shout" action="makeuser.php" method="POST">
Username;<br>
<INPUT TYPE="TEXT" name="username" size="20"><br><br>
Password;<br>
<INPUT TYPE="TEXT" name="password" size="20"><br><br>
<INPUT TYPE="Submit" name="submit" value="Create User" size="20">
</FORM>
<br>
</font>
<?php
// Copyright 2006 - 2007 PixelResources
?>
</body>
</html>
and makeuser.php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
if(empty($username) OR empty($password))
{
echo "You forgot to fill in one or more of the form fields..";
}
else
{
echo "
<script language='javascript'>
alert('User successfully added...');
</script>
";
$username = ($username);
$password = ($password);
$tag = ("$username||$password||<br>");
$read = fopen("users/users.html", "r");
$contents = fread($read, filesize('users/users.html'));
fclose($read);
$write = fopen("users/users.html", "w");
fwrite($write, "$tag $contents");
fclose($write);
}
print "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";
// Copyright 2006 - 2007 PixelResources
?>
Basically when i do that, it comes out like this in the txt file;
User1||password|| User2||password|| User3||password||
And it doesn't work, i need to to go onto a new line each time i add a user, can someone edit the makeuser.php code so it will do that, thanks!