Jump to content
MakeWebGames

Ranger Den (Comes out ugly)


Dragon Blade

Recommended Posts

So there is something wrong with my coding and it makes the page look very ugly.

Here is a screen shot -

 

[ATTACH=CONFIG]1143[/ATTACH]

 

Here is the code -

 

function hunt_index()
{
global $ir,$db,$userid;
echo "
<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'>
<th><center>Ranger Den</center></font><tr><td> 
Welcome to the Ranger Den! We shall train you to become a great ranger through dexterity! There are several different animal types (small,medium,large) in which you can hunt at a certain level. Defeating an animal will give you a piece of the animal, in which you can trade in for money at one of our collectors. First, you must purchase your bow and arrow, along with your ranger clothes. Have fun, and good luck in the wild!</tr></td></table></center><br />

<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'>
<th><center>Equipment</center></th>
<th><center>Price</center></th>
<th><center>Purchase?</center></th>

<tr><td>Ranger Bow
<td><center>$500
<td><center></tr>";

if($ir['ranger_equip'] >= 1)
{
echo "<font color=red>Done!</font>";
}
else
{
echo "<a href='rangerden.php?action=buybow'>Buy</a>";
}

echo" <tr><td>Ranger Clothes
<td><center>$500
<td><center>";

if($ir['ranger_equip'] >= 2)
{
echo "<font color=red>Done!</font>";
}
else
{
echo "<a href='rangerden.php?action=buyclothes'>Buy</a>";
}

echo" <tr><td>Ranger Arrows (x100)
<td><center>$500
<td><center>";

if($ir['arrows'] >= 1000)
{
echo "<font color=red>Maxed Out!</font>";
}
else
{
echo "<a href='rangerden.php?action=buyarrows'>Buy</a> ";
}

echo " </tr></td></table><br /></center>


<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'><th><center>Your Statistics</center><tr><td></th><center>
";

$dexterity=(int) ($ir['dexterity']/$ir['max_dexterity']*100);
$rangerxp=(int) ( $ir['ranger_exp']/$ir['ranger_needed']*100);
$dex=100-$dexterity;
$rangerx=100-$rangerxp;

echo "
<center>Ranger Level: {$ir['ranger_level']}<tr><td></center>

<center>Dexterity: {$ir['dexterity']}/{$ir['max_dexterity']}<tr><td></center>

<center>Ranger Exp: {$rangerxp}%</tr></td></center>

<tr><td>
<center>Arrows: {$ir['arrows']}/1000</tr></td></table><br /></center>

<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'><th><center>Your Collection</center></th><tr><td>
<center>You currently have {$ir['huntbirds']} bird's feathers!<br />
You currently have {$ir['huntlambs']} lamb's wool!<br />
You currently have {$ir['huntsheeps']} sheep's wool!<br />
You currently have {$ir['huntgoats']} goat's horns!<br />
You currently have {$ir['hunttigers']} tiger's skins!<br />
You currently have {$ir['huntelephants']} elephant's hides!
</tr></td></table><br /></center>

<center><table width=90% cellspacing=1 class='table'> <tr style='background:gray'>
<th><center>Small Animals</center></th>
<th><center>Medium Animals</center></th>
<th><center>Large Animals</center></th>";

if($ir['ranger_equip'] != 2)
{
echo"
<tr><td><center><hr />You cannot hunt here yet!
<hr /></td>
<td><center><hr />You cannot hunt here yet!<hr /></td>
<td><center><hr />You cannot hunt here yet!<hr />
</td></center></tr></td></table><br /><hr width=80% /><center><a href='explore.php'>Explore</a><hr width=80% /></center>";
}
else
{
echo "<tr><td><center>
[<a href='rangerden.php?action=hunt1'>Hunt - Bird</a>]<br />
[<a href='rangerden.php?action=hunt2'>Hunt - Lamb</a>]
</td><td><center>
[<a href='rangerden.php?action=hunt3'>Hunt - Sheep</a>]<br />
[<a href='rangerden.php?action=hunt4'>Hunt - Goat</a>]
</td><td><center>
[<a href='rangerden.php?action=hunt5'>Hunt - Tiger</a>]<br />
[<a href='rangerden.php?action=hunt6'>Hunt - Elephant</a>]

</center></tr></td></table><hr width=80%><center><a href='explore.php'>Explore</a><hr width=80%></center>";
}

screenny.png.d0d3194382ff0bf19d31d7116c3b054e.png

Link to comment
Share on other sites

line 6: missing </th> & </tr>

line 13: missing </tr>

lines 14, 15 & 16: missing </td>

im not going to go into it all,. but its missing loads of code which is confusing the fuk out of the browser lool,.

re-read through your script and tie up the ends ;)

there's commands started and not finished,.

Link to comment
Share on other sites

Also lines : 17 through to 53 ,.. they're not in a table,.

either close the table before line 17

or in the if statements include it into the tables

and work out your colspan's and rowspans for those table cells,.

ill complete your script for you for a price or some sort of arangement,..

im not spending time onit for nothing back,. but ive helped you enough to figure it out yourself :)

Link to comment
Share on other sites

function hunt_index()
{
global $ir,$db,$userid;

echo "
	<table align='center' width='90%' cellspacing='1' class='table'>
		<tr style='background:gray'>
			<th>Ranger Den</th>
		<tr>
			<td> 
				Welcome to the Ranger Den! We shall train you to become a great ranger through dexterity! There are several different animal types (small,medium,large) in which you can hunt at a certain level. Defeating an animal will give you a piece of the animal, in which you can trade in for money at one of our collectors. First, you must purchase your bow and arrow, along with your ranger clothes. Have fun, and good luck in the wild!
			</td>
		</tr>
	</table>

	<table width=90% cellspacing=1 class='table'>
		<tr style='background:gray'>
			<th><center>Equipment</th>
			<th><center>Price</th>
			<th><center>Purchase?</th>
		</tr>
		<tr>
			<td align='center'>
				Ranger Bow
			</td>
			<td align='center'>
				$500
			</td>
			<td align='center'>";

if($ir['ranger_equip'] >= 1)
{
	echo "<font color=red>Done!</font>";
}
else
{
	echo "<a href='rangerden.php?action=buybow'>Buy</a>";
}

echo
	"</td></tr>
	<tr>
		<td align='center'>
			Ranger Clothes
		</td>
		<td align='center'>
			$500
		</td>
		<td align='center'>";

if($ir['ranger_equip'] >= 2)
{
	echo "<font color=red>Done!</font>";
}
else
{
	echo "<a href='rangerden.php?action=buyclothes'>Buy</a>";
}

echo
	"</td></tr>
	<tr>
		<td align='center'>
			Ranger Arrows (x100)
		</td>
		<td align='center'>
			$500
		</td>
		<td align='center'>";

if($ir['arrows'] >= 1000)
{
	echo "<font color=red>Maxed Out!</font>";
}
else
{
	echo "<a href='rangerden.php?action=buyarrows'>Buy</a> ";
}

echo "
	</td></tr>
	</table>

	<table align='center' width=90% cellspacing=1 class='table'>
		<tr style='background:gray'>
			<th>Your Statistics</th>
		</tr>
		<tr>
			<td align='center'>";

$dexterity=(int) ($ir['dexterity']/$ir['max_dexterity']*100);
$rangerxp=(int) ( $ir['ranger_exp']/$ir['ranger_needed']*100);
$dex=100-$dexterity;
$rangerx=100-$rangerxp;

echo "
			Ranger Level: {$ir['ranger_level']}<br />
			Dexterity: {$ir['dexterity']}/{$ir['max_dexterity']}<br />
			Ranger Exp: {$rangerxp}%<br />
		</td>
		</tr><tr>
			<td align='center'>
				Arrows: {$ir['arrows']}/1000
			</td>
		</tr>
	</table>

	<table align='center' width=90% cellspacing=1 class='table'>
		<tr style='background:gray'>
			<th>Your Collection</th>
		</tr>
		<tr>
			<td align='center'>
				You currently have {$ir['huntbirds']} bird's feathers!<br />
				You currently have {$ir['huntlambs']} lamb's wool!<br />
				You currently have {$ir['huntsheeps']} sheep's wool!<br />
				You currently have {$ir['huntgoats']} goat's horns!<br />
				You currently have {$ir['hunttigers']} tiger's skins!<br />
				You currently have {$ir['huntelephants']} elephant's hides!<br />
			</td>
		</tr>
	</table>

	<table align='center' width=90% cellspacing=1 class='table'>
		<tr style='background:gray'>
			<th>Small Animals</th>
			<th>Medium Animals</th>
			<th>Large Animals</th>
		</tr>";

if($ir['ranger_equip'] != 2)
{
	echo"
		<tr>
			<td align='center'>
				<hr />
					You cannot hunt here yet!
				<hr />
			</td>
			<td align='center'>
				<hr />
					You cannot hunt here yet!
				<hr />
			</td>
			<td align='center'>
				<hr />
					You cannot hunt here yet!
				<hr />
			</td>
		</tr>";
}
else
{
	echo "
		<tr>
			<td align='center'>
				[<a href='rangerden.php?action=hunt1'>Hunt - Bird</a>]<br />
				[<a href='rangerden.php?action=hunt2'>Hunt - Lamb</a>]
			</td>
			<td align='center'>
				[<a href='rangerden.php?action=hunt3'>Hunt - Sheep</a>]<br />
				[<a href='rangerden.php?action=hunt4'>Hunt - Goat</a>]<br />
			</td>
			<td align='center'>
				[<a href='rangerden.php?action=hunt5'>Hunt - Tiger</a>]
				[<a href='rangerden.php?action=hunt6'>Hunt - Elephant</a>]
			</td>
		</tr>";
}

echo "
	</table>
	<center>
	<hr width='80%'>
		<a href='explore.php'>Explore</a>
	<hr width='80%'>
	</center>";
}
Link to comment
Share on other sites

Wow, thanks. I have fixed it anyway -

 

function hunt_index()
{
global $ir,$db,$userid;
echo "
<hr width=90%><center><table width=90% cellspacing=1 class='table'><tr style='background:gray'>
<th><center>Ranger Den</center></th>
</tr>
<tr>
<td>Welcome to the Ranger Den! We shall train you to become a great ranger through dexterity! There are several different animal types (small,medium,large) in which you can hunt at a certain level. Defeating an animal will give you a piece of the animal, in which you can trade in for money at one of our collectors. First, you must purchase your bow and arrow, along with your ranger clothes. Have fun, and good luck in the wild!</td></tr></table></center>
<hr width=90%>
<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'>
<th>Equipment</th>
<th>Price</th>
<th>Purchase</th>
</tr> 
<tr>
<td>Ranger Bow</td>
<td><center>$500</td>
<td><center>
";

if($ir['ranger_equip'] >= 1)
{
echo "<font color=red>Done!</font>";
}
else
{
echo "<a href='rangerden.php?action=buybow'>Buy</a>";
}

echo"</td></tr><td>Ranger Clothes
<td><center>$500</td>
<td><center>";

if($ir['ranger_equip'] >= 2)
{
echo "<font color=red>Done!</font>";
}
else
{
echo "<a href='rangerden.php?action=buyclothes'>Buy</a>";
}

echo" 
</td></tr>
<tr>
<td>Ranger Arrows (x100)</td>
<td><center>$500</td>
<td><center>";

if($ir['arrows'] >= 1000)
{
echo "<font color=red>Maxed Out!</font>";
}
else
{
echo "<a href='rangerden.php?action=buyarrows'>Buy</a> ";
}

echo "</tr></td></table></center><hr width=90%>";


echo"<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'><th><center>Your Statistics</center></th></tr><center>
";

$dexterity=(int) ($ir['dexterity']/$ir['max_dexterity']*100);
$rangerxp=(int) ( $ir['ranger_exp']/$ir['ranger_needed']*100);
$dex=100-$dexterity;
$rangerx=100-$rangerxp;

echo "
<tr><td><center>Ranger Level: {$ir['ranger_level']}</tr></td></center>
<tr><td><center>Dexterity: {$ir['dexterity']}/{$ir['max_dexterity']}</tr></td></center>
<tr><td><center>Ranger Exp: {$rangerxp}</tr></td></center>
<tr><td><center>Arrows: {$ir['arrows']}/1000</tr></td></table></center><hr width=90%>";


echo"<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'><th><center>Your Collection</center></th><tr><td>
<center>You currently have {$ir['huntbirds']} bird's feathers!<br/>
You currently have {$ir['huntlambs']} lamb's wool!<br/>
You currently have {$ir['huntsheeps']} sheep's wool!<br/>
You currently have {$ir['huntgoats']} goat's horns!<br/>
You currently have {$ir['hunttigers']} tiger's skins!<br/>
You currently have {$ir['huntelephants']} elephant's hides!<br/>
</tr></td></table></center><hr width=90%>";
echo"
<center><table width=90% cellspacing=1 class='table'><tr style='background:gray'>
<th><center>Small Animals</center></th>
<th><center>Medium Animals</center></th>
<th><center>Large Animals</center></th></tr>";

if($ir['ranger_equip'] != 2)
{
echo"
<tr><td><center><hr />You cannot hunt here yet!
<hr /></td>
<td><center><hr />You cannot hunt here yet!<hr /></td>
<td><center><hr />You cannot hunt here yet!<hr />
</td></center></tr></td></table><hr width=80% /><center><a href='explore.php'>Explore</a><hr width=80% /></center>";
}
else 
{
echo "<tr><td><center>
[<a href='rangerden.php?action=hunt1'>Hunt - Bird</a>]
[<a href='rangerden.php?action=hunt2'>Hunt - Lamb</a>]
</td><td><center>
[<a href='rangerden.php?action=hunt3'>Hunt - Sheep</a>]
[<a href='rangerden.php?action=hunt4'>Hunt - Goat</a>]
</td><td><center>
[<a href='rangerden.php?action=hunt5'>Hunt - Tiger</a>]
[<a href='rangerden.php?action=hunt6'>Hunt - Elephant</a>]

</center></tr></td></table><hr width=90%><center><a href='explore.php'>Explore</a><hr width=90%></center>";

}

 

But since Seker helped me out I am now going to be using his! As his one looks more neat.

Thank Seker :)

Link to comment
Share on other sites

but also,. people like dragon blade charge for anything that anyone wants done by him,.. have you considered that ??

Did you see what this thread is asking... And the issue at hand... ?

If anyone pays this guy for anything, they deserve to lose any money they throw his way.

Link to comment
Share on other sites

Did you see what this thread is asking... And the issue at hand... ?

If anyone pays this guy for anything, they deserve to lose any money they throw his way.

i can agree on that,. not that ive paid him for any services,. but has offered me coding for prices,.

which wernt really needed as i had better coders on hand,.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...