sciguyryan
09-12-2003, 02:51 PM
on refresh it checks the ip of the user and, depending on weather the ip has changed or not it leaves it alone if it is the same and changes it if is not.
heres the ciode i have been given by mjdimick(please note it's not for me it's for the under 12's website discussed on the general forum a while back...)
<?PHP
$user = $_POST['user'];
$pass = $_POST['pass'];
$stat = $_POST['stat'];
$customtext = $_POST['customtext'];
if ((empty($user)) || (empty($pass)) || (empty($stat))) {
echo "All fields must be filled in.<br><a title='Go Back' href='login.php'>Go Back</a>";
exit;
}
if ($stat == "Custom") {
$stat = "$customtext";
}
else {
$stat = "$stat";
}
if (($user == "yourusernamehere") and ($pass == "yourpasswordhere")) {
echo "Your status has been changed to: (<b>$stat</b>).<br><a title='Go Back' href='login.php'>Go Back</a>";
$openit = fopen("status.txt", "w");
flock ($openit, LOCK_EX); #lock the file
fwrite($openit, "$stat");
flock($openit, LOCK_UN); #release the file
}
else {
echo "Sorry, you have entered a wrong username and/or password.<br><a title='Go Back' href='login.php'>Go Back</a>";
}
?>
if you could modify this we at the development site would be most greatfull.
thanks in advance.
heres the ciode i have been given by mjdimick(please note it's not for me it's for the under 12's website discussed on the general forum a while back...)
<?PHP
$user = $_POST['user'];
$pass = $_POST['pass'];
$stat = $_POST['stat'];
$customtext = $_POST['customtext'];
if ((empty($user)) || (empty($pass)) || (empty($stat))) {
echo "All fields must be filled in.<br><a title='Go Back' href='login.php'>Go Back</a>";
exit;
}
if ($stat == "Custom") {
$stat = "$customtext";
}
else {
$stat = "$stat";
}
if (($user == "yourusernamehere") and ($pass == "yourpasswordhere")) {
echo "Your status has been changed to: (<b>$stat</b>).<br><a title='Go Back' href='login.php'>Go Back</a>";
$openit = fopen("status.txt", "w");
flock ($openit, LOCK_EX); #lock the file
fwrite($openit, "$stat");
flock($openit, LOCK_UN); #release the file
}
else {
echo "Sorry, you have entered a wrong username and/or password.<br><a title='Go Back' href='login.php'>Go Back</a>";
}
?>
if you could modify this we at the development site would be most greatfull.
thanks in advance.