Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   Delete account problem (http://www.bvlist.com/showthread.php?t=732)

AboudMokh 31st July 2008 18:35

Delete account problem
 
1 Attachment(s)
I have delacctadmin mode (delete any account by its name) but when I type the account name and press delete nothing happens , the page just refresh

I tried this mod in another tracker (test tracker) and it worked well.


delacctadmin code in attachments

djlee 31st July 2008 21:08

Verify that it works on that other tracker???
Does the other tracker use this exact same php file with nothing edited???
It the other tracker on same server???
Do both trackers use the same source???

i Cant see any reason for this working on one tracker and not on another.. id even say this php file would work on 90% of the sources ever developed.

the only thing i can really do without messing with it myself on your tracker is suggest you use a simple debug trick .. in the part where it is supposed to delete the user put in
Code:

die("error");
near the top.

If you see this message then you kno the page is executing to the die command .. so move the die command down a few lines and refresh it in your web browser after saving ofcourse.. if you see the error text again then you once again know its executing all the way to the die command and everything before the die command is fine. However if at any point you dont see the error text and just a white screen you know something is messed up before the die() command. by moving it about you should be able to figure out wats causing the problem.

Also change all your
Code:

or sqlerr();
on the end of the querys to
Code:

or sqlerr(__FILE__,__LINE__);
and if its one of the queries thats messing up the script that should show you exactly where in the query its borking

AboudMokh 31st July 2008 22:09

Quote:

Originally Posted by djlee (Post 3027)
Verify that it works on that other tracker???

Yes it is working well on other tracker

Quote:

Originally Posted by djlee (Post 3027)
Does the other tracker use this exact same php file with nothing edited???

Yes It is exactly the same

Quote:

Originally Posted by djlee (Post 3027)
It the other tracker on same server???

No

Quote:

Originally Posted by djlee (Post 3027)
Do both trackers use the same source???

Yes


I did what you told me and nothing happened it still refresh the page

That is the code with changes

PHP Code:

<?
require "include/bittorrent.php";
dbconn();

if (
get_user_class() < UC_ADMINISTRATOR)
stderr("Sorry""Permission denied.");

if (
$HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
$username trim($_POST["username"]);

if (!
$username)
  
stderr("Error""Please fill out the form correctly.");

$res mysql_query(

"SELECT * FROM users WHERE username=" sqlesc($username)   ) or sqlerr(__FILE__,__LINE__);

if (
$username == 'ADMINISTRATOR')
  
stderr("Error""You can't Delete ADMINISTRATOR.");
if (
mysql_num_rows($res) != 1)
  
stderr("Error""Bad user name or password. Please verify that all entered information is correct.");
$arr mysql_fetch_assoc($res);
die(
"error");
$id $arr['id'];
$res mysql_query("DELETE FROM users WHERE id=$id") or sqlerr(__FILE__,__LINE__);
if (
mysql_affected_rows() != 1)
  
stderr("Error""Unable to delete the account.");
stderr("Success""The account <b>$username</b> was deleted.");
}
stdhead("Delete account");
?>
<h1>Delete account</h1>
<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=delacctadmin.php>
<tr><td class=rowhead>User name</td><td><input size=40 name=username></td></tr>

<tr><td colspan=2><input type=submit class=btn value='Delete'></td></tr>
</form>
</table>
<?
stdfoot
();
?>


johnake 3rd August 2008 13:47

Try this one:
PHP Code:

<?
require "include/bittorrent.php";
dbconn();

if (
get_user_class() < UC_ADMINISTRATOR)
stderr("Sorry""Permission denied.");

if (
$HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
 
$username trim($_POST["username"]);

if (!
$username)
   
stderr("Error""Please fill out the form correctly.");

 
$res mysql_query(

 
"SELECT * FROM users WHERE username=" sqlesc($username)   ) or sqlerr();
 if (
mysql_num_rows($res) != 1)
   
stderr("Error""Bad user name or password. Please verify that all entered information is correct.");
 
$arr mysql_fetch_assoc($res);

 
$id $arr['id'];
 
$res mysql_query("DELETE FROM users WHERE id=$id") or sqlerr();
 if (
mysql_affected_rows() != 1)
   
stderr("Error""Unable to delete the account.");
 
stderr("Success""The account <b>$username</b> was deleted.");
}
stdhead("Delete account");
?>
<h1>Delete account</h1>
<table border=1 cellspacing=0 cellpadding=5>
<form method=post action=delacctadmin.php>
<tr><td class=rowhead>User name</td><td><input size=40 name=username></td></tr>

<tr><td colspan=2><input type=submit class=btn value='Delete'></td></tr>
</form>
</table>
<?
stdfoot
();
?>


AboudMokh 4th August 2008 03:15

Just the same it refresh the page

johnake 4th August 2008 18:51

What version of Yuna Scatari do you have?

AboudMokh 5th August 2008 06:30

'tbversion','tbdev.net-12-09-05'


All times are GMT +2. The time now is 13:07.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.