Jump to content

Problem With My Script


dark dude

Recommended Posts

What's the problem with my script? I get a white page opening it, indicating a problem with the script, but I cant find the problems...

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?
session_start();

$Username = $_SESSION['Username'];

include("dbinfo.inc.php");

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "SELECT * FROM Users WHERE Username='$Username'";
$result = mysql_query($query) or die(mysql_error());

$results = mysql_fetch_array($result);

$query = "SELECT * FROM Alliances WHERE AllianceName='$results[Alliance]'";
$result2 = mysql_query($query) or die(mysql_error());

$results2 = mysql_fetch_array($result2);

$query = "SELECT * FROM Diplomacy WHERE AllianceName='$results[Alliance]'";
$result3 = mysql_query($query) or die(mysql_error());

$results3 = mysql_fetch_array($result3);

if($results[Alliance]==""){
?>
<table><tr><th>Alliance Search</th></tr><tr><td><form name="search" method="post" action="alliancesearch.php">Search Alliance Tag <input name="Search" type="text" size="20" maxlength="18"/> <input type="submit">Search</input></form></td></tr></table>
<?
} else {
?>

<table><tr><th>Alliance "<? echo $results2[AllianceName] ?>"'s Panel</th></tr>
<tr><td><center>Alliance Name: <? echo $results2[AllianceName] ?></td></tr>
<tr><td>Alliance Tag: <? echo $results2[AllianceTag] ?></td></tr>
<tr><td>Members: <? echo $results2[Members] ?></td></tr>
<tr><td>Rank: <? echo $results[AllianceRank] ?></td></tr>
<tr><td><? echo $results2[Description] ?></td></tr>
<tr><th>Diplomacy Status</th></tr>
<tr><td><?
if($results3[War]==""){
echo '<span style=color:red><b>Wars:</b></span> The Alliance is at Peace';
}
else {
echo '<span style=color:red><b>Wars:</b></span> 1.'.$results3[War].'<br>2.'.$results3[War2].'<br>3.'.$results3[War3].'<br>4.'.$results3[War4].'<br>5.'.$results3[War5].';
}
?>
</td></tr>
<tr><td><?
if($results3[Ally]==""){
echo '<span style=color:red><strong>Wars:</strong></span> The Alliance is Unified';
}
else {
echo '<span style=color:red><strong>Wars:</strong></span> 1.'.$results3[Ally].'<br>2.'.$results3[Ally2].'<br>3.'.$results3[Ally3].'<br>4.'.$results3[Ally4].'<br>5.'.$results3[Ally5].';
}
?>
</td></tr>
</table>
<?
}[/quote]


Thanks for any help ^_^,
~Dark dude~
Link to comment
https://forums.phpfreaks.com/topic/13138-problem-with-my-script/
Share on other sites

In the connect statement doesn't localhost need quotes around it? At any rate try turning on error reporting in the php.ini file and let us know what line the error is reported (preferably by marking it in the code), if you can't get error reporting on then try echoing from the top of your script down, till you hit the part that doesn't work.
Link to comment
https://forums.phpfreaks.com/topic/13138-problem-with-my-script/#findComment-50518
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.