PDA

View Full Version : Php Help!



Assassinator
15-09-2007, 02:47 PM
Well on my mafia game, all rank's have a bar with there percent on.But im trying to make Top rank's have something called "Xp" instead.Anyone know what is wrong with this?


<?php

if($fetch->rank == "Scum" || $fetch->rank == "Tramp" || $fetch->rank == "Chav" || $fetch->rank == "Vandal" || $fetch->rank == "Mobster" || $fetch->rank == "Hitman" || $fetch->rank == "Agent" || $fetch->rank == "Boss" || $fetch->rank == "Assassin" || $fetch->rank == "Godfather" || $fetch->rank == "Global Threat" || $fetch->rank == "World Dominator" || $fetch->rank == "World Class Dominator" || $fetch->rank == "Untouchable Godfather" || $fetch->rank == "Legend") { echo "<body>
<table width="0%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="0" colspan="3" align="top" valign="top" scope="col"><div align="middle">
<table width="100" height="0" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width='.makecomma($percent)."%"; ?>' <font color=#8a8a8a><div align="center"><font color="#FFFFFF"><b>
.makecomma($percent)."%"; ?></b></font></div></td>"; }

elseif($fetch->rank == "Official Bliss Godfather") { echo "<b><font color=#8a8a8a>Xp:</font>"; }



?>

Invent
15-09-2007, 02:52 PM
If you don't know; you should leave PHP.

No offence, x.

Assassinator
15-09-2007, 02:53 PM
I know the basic Php, i coded that but it just shows as blank:(
So can anyone help?

Invent
15-09-2007, 02:55 PM
<?php

if($fetch->rank == "Scum" || $fetch->rank == "Tramp" || $fetch->rank == "Chav" || $fetch->rank == "Vandal" || $fetch->rank == "Mobster" || $fetch->rank == "Hitman" || $fetch->rank == "Agent" || $fetch->rank == "Boss" || $fetch->rank == "Assassin" || $fetch->rank == "Godfather" || $fetch->rank == "Global Threat" || $fetch->rank == "World Dominator" || $fetch->rank == "World Class Dominator" || $fetch->rank == "Untouchable Godfather" || $fetch->rank == "Legend") { echo "<body>
<table width="0%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="0" colspan="3" align="top" valign="top" scope="col"><div align="middle">
<table width="100" height="0" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width='.makecomma($percent)."%";' <font color=#8a8a8a><div align="center"><font color="#FFFFFF"><b>
.makecomma($percent)."%</b></font></div></td>"; }

elseif($fetch->rank == "Official Bliss Godfather") { echo "<b><font color=#8a8a8a>Xp:</font>"; }



?>

EDIT: Oh and in my first post I was only kidding. I would never advise you to give up PHP. You're still learning and doing a good job ;] x

Assassinator
15-09-2007, 02:58 PM
Hmm its stilling showing white:(

Do you want the full script of the page?

And thanks x;)

Invent
15-09-2007, 02:59 PM
Oooh.

There was a big error in the code I posted, Ill fix it in a sec :)

EDIT:


<?php

if($fetch->rank == "Scum" || $fetch->rank == "Tramp" || $fetch->rank == "Chav" || $fetch->rank == "Vandal" || $fetch->rank == "Mobster" || $fetch->rank == "Hitman" || $fetch->rank == "Agent" || $fetch->rank == "Boss" || $fetch->rank == "Assassin" || $fetch->rank == "Godfather" || $fetch->rank == "Global Threat" || $fetch->rank == "World Dominator" || $fetch->rank == "World Class Dominator" || $fetch->rank == "Untouchable Godfather" || $fetch->rank == "Legend") { echo "<body>
<table width=\"0%\" height=\"0\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td height=\"0\" colspan=\"3\" align=\"top\" valign=\"top\" scope=\"col\"><div align=\"middle\">
<table width=\"100\" height=\"0\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
<tr>
<td width=".makecomma($percent)."%<font color=\"#8a8a8a\"><div align=\"center\"><font color=\"#FFFFFF\"><b>"
.makecomma($percent)."%</b></font></div></td>";
}

elseif($fetch->rank == "Official Bliss Godfather") { echo "<b><font color=\"#8a8a8a\">Xp:</font>"; }



?>

Assassinator
15-09-2007, 03:02 PM
Omg it works, thankyou SO MUCH! x

Invent
15-09-2007, 03:02 PM
Hmm its stilling showing whiteI think your host has disabled showing PHP Errors.

I'd ask them to enable showing them.

Agnostic Bear
15-09-2007, 03:09 PM
I think your host has disabled showing PHP Errors.

I'd ask them to enable showing them.

You can't disable errors in PHP last time I checked.

Try this



<?php
if($fetch->rank() == "Scum" || $fetch->rank() == "Tramp" || $fetch->rank() == "Chav" || $fetch->rank() == "Vandal" || $fetch->rank() == "Mobster" || $fetch->rank() == "Hitman" || $fetch->rank() == "Agent" || $fetch->rank() == "Boss" || $fetch->rank() == "Assassin" || $fetch->rank() == "Godfather" || $fetch->rank() == "Global Threat" || $fetch->rank() == "World Dominator" || $fetch->rank() == "World Class Dominator" || $fetch->rank() == "Untouchable Godfather" || $fetch->rank() == "Legend")
{
echo '<body>
<table width="0%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="0" colspan="3" align="top" valign="top" scope="col"><div align="middle">
<table width="100" height="0" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="' . makecomma($percent) . '%"> <div align="center"><font color=#8a8a8a>Xp:</font> <font color="#FFFFFF"><b>' . makecomma($percent) . '%</font></div></td>';
}

?>
I assume that's what you'd like to see

Invent
15-09-2007, 03:11 PM
You can't disable errors in PHP last time I checked.

I have been told you can.

As my friend (Patrick) could not see PHP Errors on his site. He contacted his support and they told him they enabled error displaying?

Agnostic Bear
15-09-2007, 03:11 PM
I have been told you can.

As my friend (Patrick) could not see PHP Errors on his site. He contacted his support and they told him they enabled error displaying?


whatever host that is should be avoided

Sygon..
15-09-2007, 04:20 PM
You can't disable errors in PHP last time I checked.

Try this



<?php
if($fetch->rank() == "Scum" || $fetch->rank() == "Tramp" || $fetch->rank() == "Chav" || $fetch->rank() == "Vandal" || $fetch->rank() == "Mobster" || $fetch->rank() == "Hitman" || $fetch->rank() == "Agent" || $fetch->rank() == "Boss" || $fetch->rank() == "Assassin" || $fetch->rank() == "Godfather" || $fetch->rank() == "Global Threat" || $fetch->rank() == "World Dominator" || $fetch->rank() == "World Class Dominator" || $fetch->rank() == "Untouchable Godfather" || $fetch->rank() == "Legend")
{
echo '<body>
<table width="0%" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="0" colspan="3" align="top" valign="top" scope="col"><div align="middle">
<table width="100" height="0" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td width="' . makecomma($percent) . '%"> <div align="center"><font color=#8a8a8a>Xp:</font> <font color="#FFFFFF"><b>' . makecomma($percent) . '%</font></div></td>';
}

?>
I assume that's what you'd like to see

lmao you so can..
http://us.php.net/error_reporting

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