Hey,
I have created a simple settings page for the FluxRP Emulator ect and I have added an option for when a player click on the relevant button, then it will either disable or enable friend requests ect, but it is not working as when i add the php code, then the cms just breaks and when i remove the code, then the button doesn't work at all.
Any help appreciated and thanks in advance
I have created a simple settings page for the FluxRP Emulator ect and I have added an option for when a player click on the relevant button, then it will either disable or enable friend requests ect, but it is not working as when i add the php code, then the cms just breaks and when i remove the code, then the button doesn't work at all.
Code:
<div class="content-box">
<div class="title">Friend Requests</div>
<div class="box-content d-flex justify-content-center align-items-center">
<?php
if (isset($_POST['profileForm'])) {
$efr = filter($_POST['friendRequestsAllowed']);
if ($efr == 1) {
echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Disabled</b></div>'
mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'");
}
else if ($efr == 0) {
echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Enabled</b></div>'
mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'");
}
}
?>
<div class="mr-3">
<form method="post" id="profileForm" class="form-block">
<input type="hidden" name="_token" value="4e26eaf44aedd954ff26441a92b2b42bbe4d1ada">
<input type="hidden" name="block_friend_requests" value="" value="true">
<?php
if (isset($_POST['profileForm'])) {
$efr = filter($_POST['friendRequestsAllowed']);
if ($efr == 1) {
echo '<button type="submit" name="friendRequestsAllowed" class="button green">Disable</button>'
mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'");
}
else if ($efr == 0) {
echo '<button type="submit" name="friendRequestsAllowed" class="button green">Enabled</button>'
mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'");
}
}
?>
</form>
Any help appreciated and thanks in advance