Jump to content

Need help with delete user script


iSpeedDevil!

Recommended Posts

Hello there, i just recently bought this half-done php text-based mafia game script for about 90$, i thought i were experienced enough to could script the rest done myself, but i was wrong xD... so thats why im asking for help here.

 

The "error"/problem here is that everytime i press that submit button, it just goes back to the delete_user.php page, and nothing will happen!

 

<?php
include "header2.php";
include "_menu.php";
if ($melding) {
	echo "<div class=\"window\">";
	echo "<div class=\"mainTitle\">Delete hun</div>";
	echo "<div class=\"mainText\">";
	echo "$melding";
	echo "</div></div>";
} else {	
?>
<div class="window">
<div class="mainTitle">Delete user? <?php echo "$d_user"; ?></div>
<div class="mainText">

	<?
	if ($moderator > 2) {
		if (!$type) {
			?>
			Are you sure you wanna delete <?php echo "$d_user"; ?>? <br/>
			<form action=delete_user.php method=post>
				<input type=radio name=confirm value=yes> Yes <input type=radio name=confirm value=no> No
				<input type=hidden name=type value=delete><input type=hidden name=user value=<?php echo "$d_user"; ?>><br/><br/>
				<input type=submit value=Yes!>
			</form>


			<?php
		} elseif ($type == "delete") {
			$confirm = $_POST['confirm'];
			if ($confirm == "no") {
				echo "<META http-equiv=refresh content=\"0;url=adminusers.php\">";
			} elseif ($confirm == "yes") {
				$sql = "DELETE FROM users WHERE username=\"$d_user\"";
				if (mysql_query($sql)) {
					echo "The user $d_user is Successfully Deleted!";
				}				
			}
		}				
	} else {
		echo "You are not allowed to see this area!";
	}
	?>

</div>
</div>
<?
}
include "footer.php";
?>

 

can anyone push me off in the right direction? ^^

 

Thank You!

 

~iSpeedDevil!

Link to comment
https://forums.phpfreaks.com/topic/124352-need-help-with-delete-user-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.