PDA

View Full Version : POWERPanel Help



Highjacker-x
17-06-2007, 10:38 PM
I Try to delete an account and I get this message

Warning: Cannot modify header information - headers already sent by (output started at /home/bobbafm/public_html/staff/in.php:33) in /home/bobbafm/public_html/staff/admin/delacc.php on line 60

Anyone help?

ty

QuickScriptz
18-06-2007, 12:43 AM
That would be a coding error -_-

Someone obviously tried to modify the header to redirect but had already used some kind of header function already....

PM Invent or wait for reply.

Sam
18-06-2007, 12:59 AM
Please paste the current code and i will modify it for you ;P

Xarea
18-06-2007, 07:22 AM
I also get this. A way to get around it is to delete the user from the table?

Flisker
18-06-2007, 02:10 PM
Did you add a stylesheet or a code in the script or config file? If so delete it and find another way.

Invent
18-06-2007, 06:34 PM
This is fixed in 0.2, I can't remember the error.

I'll try to find it out soon.

Ini
18-06-2007, 06:41 PM
Isn't that becuase you need to put something like oB_start(); or session_start(); at the top of the page?

QuickScriptz
18-06-2007, 07:10 PM
Isn't that becuase you need to put something like oB_start(); or session_start(); at the top of the page?

Not quite..... that would be because you had both session_start(); and then on top of that tried to use the header(); to redirect the user all in the same file - it just doesn't work ;)

Highjacker-x
18-06-2007, 08:30 PM
Does this mean I need to wait for 0.2 to come out? :(

Mashi
18-06-2007, 09:24 PM
Unless You Can Code PHP Then Yess :)

QuickScriptz
19-06-2007, 12:20 AM
Does this mean I need to wait for 0.2 to come out? :(


Unless You Can Code PHP Then Yess :)

But you see if you used my panel you wouldn't get those errors in the first place and even if you did I would fix them without making you wait for another entire version :)

Sam
19-06-2007, 03:28 AM
But you see if you used my panel you wouldn't get those errors in the first place and even if you did I would fix them without making you wait for another entire version :)

Lol. Trying to steal Simon's customers ;P

Tut tut.

Invent
19-06-2007, 03:00 PM
But you see if you used my panel you wouldn't get those errors in the first place and even if you did I would fix them without making you wait for another entire version

When did I say I wasn't going to post the fix?..

Please don't make moronic assumptions, I have always helped the people who use my scripts, ask anyone :\

Blob
19-06-2007, 03:22 PM
When did I say I wasn't going to post the fix?..

Please don't make moronic assumptions, I have always helped the people who use my scripts, ask anyone :\

Its true and I aint even used his script.

Highjacker-x
19-06-2007, 04:17 PM
So Si, When you planning to post the fix? :]

Ini
19-06-2007, 05:17 PM
So Si, When you planning to post the fix? :]

Don't be so inpatient

Highjacker-x
19-06-2007, 07:18 PM
Don't be so inpatient

err.

Im not?

Xarea
19-06-2007, 09:13 PM
When did I say I wasn't going to post the fix?..

Please don't make moronic assumptions, I have always helped the people who use my scripts, ask anyone :\

It's true, lol.


Don't be so inpatient

I don't blame him - I use the panel, and I find it very annoying that I have to delete it manually from phpMA, but I have to deal with it until it's fixed.

Invent
19-06-2007, 10:34 PM
admin/delacc.php



<?php

if( isset( $_SESSION[ 'username' ] ) && isset( $_SESSION[ 'password' ] ) && $_SESSION[ 'level' ] == "admin" ) {

checkaccount( $_SESSION[username] );

?>
<link href="../css/inside.css" rel="stylesheet" type="text/css" />
<div id="content_title">
<p>Delete An Account (Remove a DJ) </p>
</div>

<div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
<?php

if( isset( $_POST[ 'id' ] ) ) {

$id = $_POST[ 'id' ];

if( $id == "1" ) {

echo( "<br /><strong>Sorry!</strong> You cannot delete the root administrator's account" );

}
else {

$insert = mysql_query( "DELETE FROM users WHERE id = '$id'" ) or die( 'Could not delete data, Error: '. mysql_error( ) );

echo( "<br />The user you specified has been <strong>deleted</strong>!" );

}
}


else {
?><br />
<br />

<?php

// We generate a list of users
$query = mysql_query( "SELECT * FROM users ORDER BY id" );

while( $rows = mysql_fetch_array( $query ) ) {

if( $rows[level] == "admin" ) {

$level = "Administrator";

}

elseif( $rows[level] == "trialist" ) {

$level = "Trialist DJ";

}

elseif( $rows[level] == "regular" ) {

$level = "Regular DJ";

}

elseif( $rows[level] == "senior" ) {

$level = "Senior DJ";

}

echo( "<form action='' method='POST'><input type='hidden' name='id' value='". $rows[id] ."' /><strong>Name Of User:</strong><br />". $rows[username] ."<br /><strong>Access Level:</strong><br />". $level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />" );

}
}

?></div>
<?php

}
else
{
header( 'location: index.php' );
die( '' );
}
?>

Xarea
20-06-2007, 06:31 AM
admin/delacc.php



<?php

if( isset( $_SESSION[ 'username' ] ) && isset( $_SESSION[ 'password' ] ) && $_SESSION[ 'level' ] == "admin" ) {

checkaccount( $_SESSION[username] );

?>
<link href="../css/inside.css" rel="stylesheet" type="text/css" />
<div id="content_title">
<p>Delete An Account (Remove a DJ) </p>
</div>

<div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
<?php

if( isset( $_POST[ 'id' ] ) ) {

$id = $_POST[ 'id' ];

if( $id == "1" ) {

echo( "<br /><strong>Sorry!</strong> You cannot delete the root administrator's account" );

}
else {

$insert = mysql_query( "DELETE FROM users WHERE id = '$id'" ) or die( 'Could not delete data, Error: '. mysql_error( ) );

echo( "<br />The user you specified has been <strong>deleted</strong>!" );

}
}


else {
?><br />
<br />

<?php

// We generate a list of users
$query = mysql_query( "SELECT * FROM users ORDER BY id" );

while( $rows = mysql_fetch_array( $query ) ) {

if( $rows[level] == "admin" ) {

$level = "Administrator";

}

elseif( $rows[level] == "trialist" ) {

$level = "Trialist DJ";

}

elseif( $rows[level] == "regular" ) {

$level = "Regular DJ";

}

elseif( $rows[level] == "senior" ) {

$level = "Senior DJ";

}

echo( "<form action='' method='POST'><input type='hidden' name='id' value='". $rows[id] ."' /><strong>Name Of User:</strong><br />". $rows[username] ."<br /><strong>Access Level:</strong><br />". $level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />" );

}
}

?></div>
<?php

}
else
{
header( 'location: index.php' );
die( '' );
}
?>


Warning: Cannot modify header information - headers already sent by (output started at /home/kissfor/public_html/panel/in.php:33) in /home/kissfor/public_html/panel/admin/delacc.php on line 81

:(!

Xarea
20-06-2007, 04:14 PM
admin/delacc.php



<?php

if( isset( $_SESSION[ 'username' ] ) && isset( $_SESSION[ 'password' ] ) && $_SESSION[ 'level' ] == "admin" ) {

checkaccount( $_SESSION[username] );

?>
<link href="../css/inside.css" rel="stylesheet" type="text/css" />
<div id="content_title">
<p>Delete An Account (Remove a DJ) </p>
</div>

<div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
<?php

if( isset( $_POST[ 'id' ] ) ) {

$id = $_POST[ 'id' ];

if( $id == "1" ) {

echo( "<br /><strong>Sorry!</strong> You cannot delete the root administrator's account" );

}
else {

$insert = mysql_query( "DELETE FROM users WHERE id = '$id'" ) or die( 'Could not delete data, Error: '. mysql_error( ) );

echo( "<br />The user you specified has been <strong>deleted</strong>!" );

}
}


else {
?><br />
<br />

<?php

// We generate a list of users
$query = mysql_query( "SELECT * FROM users ORDER BY id" );

while( $rows = mysql_fetch_array( $query ) ) {

if( $rows[level] == "admin" ) {

$level = "Administrator";

}

elseif( $rows[level] == "trialist" ) {

$level = "Trialist DJ";

}

elseif( $rows[level] == "regular" ) {

$level = "Regular DJ";

}

elseif( $rows[level] == "senior" ) {

$level = "Senior DJ";

}

echo( "<form action='' method='POST'><input type='hidden' name='id' value='". $rows[id] ."' /><strong>Name Of User:</strong><br />". $rows[username] ."<br /><strong>Access Level:</strong><br />". $level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />" );

}
}

?></div>
<?php

}
else
{
header( 'location: index.php' );
die( '' );
}
?>


Can't edit above. I had a free period, so I asked the IT Team [web team] about what's wrong with it, and they said it's to do with the header( 'location: index.php' );. It should be location: in.php.

I think thats what he said. I canne' remember.

Blob
20-06-2007, 04:23 PM
Can't edit above. I had a free period, so I asked the IT Team [web team] about what's wrong with it, and they said it's to do with the header( 'location: index.php' );. It should be location: in.php.

I think thats what he said. I canne' remember.

That wont fix it..

Invent
20-06-2007, 04:34 PM
Lol, they are *Text Removed* then.

The header is so that if you're not logged in it will send you to index.php to login.

But yes, that on it's own would send errors because of the data already outputted by in.php. But in "in.php", at the top of the file, it checks if you're logged in, if you're not it outputs NO data, thus allowing it to send you back to index.php, so basically really the "header( 'location: index.php' );" part shouldn't be the problem.

Edited by opensourcehost (Forum Moderator): Please don't avoid the filter.

Flisker
20-06-2007, 07:59 PM
<?php

if(isset($_SESSION['username']) && isset($_SESSION['password']) && $_SESSION['level'] == "admin") {

checkaccount($_SESSION[username]);

?>
<link href="../css/inside.css" rel="stylesheet" type="text/css" />
<div id="content_title">
<p>Delete An Account (Remove a DJ) </p>
</div>

<div id="content">On this page you are able to delete a DJs account to prevent them from accessing the panel. <br />
<?php

if(isset($_POST['id'])) {

$id = $_POST['id'];

if($id == "1") {
echo("<br /><strong>Sorry!</strong> You cannot delete the root administrator's account");
}
else {

$insert = mysql_query("DELETE FROM users WHERE id = '$id'") or die('Could not delete data, Error: '. mysql_error());

echo("<br />The user you specified has been <strong>deleted</strong>!");

}
}


else {
?><br />
<br />

<?php
// We generate a list of users
$query = mysql_query("SELECT * FROM users ORDER BY id");
while($rows = mysql_fetch_array($query)) {
if($rows[level] == "admin") {
$level = "Administrator";
}
elseif($rows[level] == "trialist") {
$level = "Trialist DJ";
}
elseif($rows[level] == "regular") {
$level = "Regular DJ";
}
elseif($rows[level] == "senior") {
$level = "Senior DJ";
}
echo("<form action='' method='POST'><input type='hidden' name='id' value='". $rows[id] ."' /><strong>Name Of User:</strong><br />". $rows[username] ."<br /><strong>Access Level:</strong><br />". $level ."<br /><br /><input type='submit' value='Remove Account' /></form><br /><hr color='lightgrey' /><br />");
}
?>

<? } ?></div>
<?php
} else {
header('location: index.php');
die();
}
?>


This one works as it works on my POWERpanel

Highjacker-x
20-06-2007, 08:56 PM
That doesn't work either, sorry.

Want to hide these adverts? Register an account for free!