• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved PHP - White space

trustjah

Newbie
Joined
Jan 22, 2009
Messages
124
Solutions
6
Reaction score
14
Location
Belgium
Hello Otlanders,

Anyone that could correct the enormous amount of white space generated by my php code?


PHP:
<?PHP
$main_content .= '<center><h1>Player Killing Event Winners</h1><h3>The PK event will be hosted every 3 hours.</h3></center><br>
<center>
<img src="https://game.netherspite.com/images/skulls/redskull.gif">
<br><br>
- Players inside a protection zone will not be able to participate in the event. <br>
- Once you engaged in combat, the normal skull timer begings to countdown. <br>
- Once you lose your skull the event is over for you. <br>
- Players who die lose theyre skull and cannot be attacked again without the usual penalty. <br>
- Once the event is finished all player skulls are reset back to their former state ie: if you had a red skull you will get back your red skull. <br>
<br><br>
<b>Additional Info:</b> You do NOT lose LEVELS or ITEMS while actively participating in this event!!';
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr BGCOLOR="'.$config['site']['vdarkborder'].'"><td CLASS=white><center><b>Player Name</b></center></td><td CLASS=white width=184 colspan=2><center><b>Kills</b></center></td><td width=60 CLASS=white><center><b>World</b></center></td></tr>';
$lottery = $SQL->query('SELECT id, winner, kills, world_id FROM pkevent WHERE world_id = 0 ORDER BY id DESC;');
foreach($lottery as $result) {
$players++;
            if(is_int($players / 2))
                $bgcolor = $config['site']['lightborder'];
            else
                $bgcolor = $config['site']['darkborder'];

$main_content .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=35%><center><a href="?subtopic=characters&name='.urlencode($result['winner']).'">'.$result['winner'].'</a></center></td><TD WIDTH=5%><center><img src=\'/images/skulls/redskull.gif\'></center></td><TD WIDTH=20%><center><b>'.$result[kills].'</b></center></td><TD WIDTH=30%><center>Netherot</center></td></tr><br>';
}
$main_content .= '</table>';
?>

Error55.png

Thanks in advance.
 
Last edited:
Solution
I found the cause of your problem.

Look its this <br> tag (useless)

1616802063005.png


(I changed the code a bit cause wanted to test it locally)
Back
Top