<?php
include "user.php";
include "../admin/head.php";
include "../inc.php";
if (empty($page)) $page = "";
if ($page == "update")
{
$result = mysql_query("SELECT * FROM phpmeet WHERE user = '$username'");
while ($i = mysql_fetch_array($result))
{
if ($rpassword <> $i[password])
{
echo "Het paswoord dat u hebt ingegeven is niet correct";
}
else
{
?>
<body>
<form name="myfrm" > <input type="hidden" name="keuze"> </form>
<script language="javascript">
{
if (confirm("Bent u zeker dat u deze acount wil verwijderen?") )
{ myfrm.keuze = 0;}
else
{ myfrm.keuze=1;}
</script>
<?php
if ($keuze == 1)
{
mysql_query("DELETE FROM phpmeet WHERE user = '$username'");
echo "De acount <b> $username</b> werd verwijderd";
}
else
{
echo " De acount <b> $username</b> werd NIET verwijderd! ";
}
}
}
}
else
{
echo "Geef het paswoord van de acount<b> $username </b> in en druk op Verwijder om deze acount te verwijderen ";
?>
<html>
<body>
<form action=delete.php?username=<?php echo $username; ?>&page=update method="post" >
Paswoord: <input type=password name=rpassword><br>
<br>
<input type=hidden value=$user>
<input type="submit" name="submit" value="verwijder">
</form></body></html>
<?php
}
?>
this is my code but it doesn't work correct.
What is the function of it?
A user can delete his acount whit it. First there is a control on the password and than there is a confirmation window so that the user can stop the deleting.
What is the probleme
The confirmation give the probleme. I have trade a few things and now I got this bad solution that doesn't work:
?>
<body>
<form name="myfrm" > <input type="hidden" name="keuze"> </form>
<script language="javascript">
{
if (confirm("Bent u zeker dat u deze acount wil verwijderen?") )
{ myfrm.keuze = 0;}
else
{ myfrm.keuze=1;}
</script>
<?php
if ($keuze == 1)
{
mysql_query("DELETE FROM phpmeet WHERE user = '$username'");
echo "De acount <b> $username</b> werd verwijderd";
}
else
{
echo " De acount <b> $username</b> werd NIET verwijderd! ";
Is there a person who can explain me the probleme and give a correct solution. And please I am a newbee so explain it so i can understand it. Many thx.
Frustrated CoLaKe