you could always do it easy way. password protect the admin directory using cpanel
you could always do it easy way. password protect the admin directory using cpanel
Last edited by Colin-Roberts; 09-08-2006 at 01:43 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Nooo i am trying to make a form where you type in a username and password and it adds it to log.txt so it makes a user.
Try and fix my code ;D
I know! 1 Sec
Last edited by Fujitsu; 09-08-2006 at 01:48 PM.
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
PHP Code:<html>
<head>
<title>PixelResources User 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'>
<b>Add an admin</b><br><br>
<FORM name="shout" action="adduser.php" method="POST">
Username;<br>
<INPUT TYPE="TEXT" name="name" size="20"><br><br>
Password;<br>
<INPUT TYPE="TEXT" name="password" size="20"><br><br>
<br><br>
<INPUT TYPE="Submit" name="submit" value="Create Admin" size="20">
</FORM>
<br>
</font>
<?php
// Copyright 2006 - 2007 PixelResources
?>
</body>
</html>PHP Code:<?php
$name = $_POST['name'];
$password = $_POST['password'];
if(empty($name) OR empty($password))
{
echo "
<script language='javascript'>
alert('Please fill in both the Username and the Password fields...');
</script>
";
}
else
{
echo "
<script language='javascript'>
alert('The user was successfully created...');
</script>
$write = fopen("/users/log.txt", "w");
fwrite($write, "$name $password");
fclose($write);
}
[B](this part below makes no sense)[/B]
";
$name = ($name);
$message = ($message);
$tag = ("<font size=\"1\" face=\"Verdana\">
$name||$message||<br>");
$read = fopen("/users/log.txt", "r");
$contents = fread($read, filesize('/users/log.txt'));
fclose($read);
print "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";
// Copyright 2006 - 2007 PixelResources
?>
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
OK make adduser.php
PHP Code:<?php
$name = $_POST['name'];
$website = $_POST['website'];
$message = $_POST['message'];
if(empty($name) OR empty($message))
{
echo "
<script language='javascript'>
alert('Please fill in both the Username and the Password fields...');
</script>
";
}
else
{
echo "
<script language='javascript'>
alert('The user was successfully created...');
</script>
";
$name = ($name);
$message = ($message);
$tag = ("<font size=\"1\" face=\"Verdana\">
$name||$message||<br>");
$read = fopen("users/log.txt", "r");
$contents = fread($read, filesize('users/log.txt'));
fclose($read);
$write = fopen("users/log.txt", "w");
fwrite($write, "$tag $contents");
fclose($write);
}
print "<meta http-equiv=\"refresh\" content=\"0;adminindex.php\">";
// Copyright 2006 - 2007 PixelResources
?>
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
YEy thankyou Fujitsu it works ;D
lol stupid fujitsu make dots look bad again
what's next page ryan?
Last edited by Colin-Roberts; 09-08-2006 at 02:05 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Lolsor.
A4AOwen (Forum Moderator) - Please do not post pointlessly.
Last edited by A4AOwen; 09-08-2006 at 05:51 PM.
PHP Code:[LEFT]<?[/LEFT]
[LEFT]$name = $_GET['name'];[/LEFT]
[LEFT]echo "Hi, your name is $name";[/LEFT]
[LEFT]?>[/LEFT]
[LEFT][/LEFT]
Yep i need a word filter next, help me please Fujitsu...
Edit: also anyone who wants to have a look in the admin panel PM me your MSN.
Last edited by Drugs; 09-08-2006 at 02:06 PM.
credit to mentorPHP Code:function filter($msg)
{
$bad_words = explode(',', "tomato,lettuce,carrot,potato,broccoli,cucumber,pea" );
foreach ($bad_words as $naughty)
{
$msg = eregi_replace($naughty, "****", $msg);
}
return $msg;
}
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Want to hide these adverts? Register an account for free!