Ok, once again I am back. This time I have done everything I could think of and even searched the net looking for answers before turning to asking for assistance.
What I am trying to do, is get the page to post most of the fields, plus add some together and post those. Some of the ways that I have seen to do this, I'm just not sure it would work as I need everything posted in a certain order. Hopefully one of you can assist me with this one. I originally started it over 5 weeks ago but stopped to work on scripts a little easier.
Code:
function viewChar() {
global $db, $username, $user_prefix, $char;
$query = "SELECT * FROM '.user_prefix.'_registry WHERE Name='$char'";
$result = $db->mysql_query($query);
$row = $db->mysql_fetch_array($result);
if ($username != $row[OwnedBY]) {
echo "You do not have the proper permissions to view this page. Error given: This is not your character.";
}
else
{
if ($row[Multi] = 'Yes') {
echo "<b>$row[Name]</b><br>$row[Race]<br>$row[Ethic]<br>$row[Profession]<br>$row[Credits]<br>$row[XP]<br>$row[Level]<br>$row[HP]<br>$Attack<br>$rowEvade<br>";
echo "'.$Strength.'<br>'.$Dexterity.'<br>'.$Wisdom.'<br>'.$Intelligence.'<br>'.$Constitution.'<br>'.$Charisma.'<br>$row[Hair]<br>$row[Eyes]<br>$row[Weight]<br>";
echo "$row[Age]<br>$row[Sex]<br>$row[Height1]\'$row[Height2]\"<br>$row[SubGroup]<br>$row[Background]<br>$row[CharacterPic]<br>$row[LastUpdated]<br>$row[Profession2]<br>";
echo "$row[XP2]<br>$row[Level2]<br>$row[Date]<br>$row[Flaws]<br>$row[Items]<hr>";
}
else
{
echo "<b>$row[Name]</b><br>$row[Race]<br>$row[Ethic]<br>$row[Profession]<br>$row[Credits]<br>$row[XP]<br>$row[Level]<br>$row[HP]<br>$Attack<br>$rowEvade<br>";
echo "'.$Strength.'<br>'.$Dexterity.'<br>'.$Wisdom.'<br>'.$Intelligence.'<br>'.$Constitution.'<br>'.$Charisma.'<br>$row[Hair]<br>$row[Eyes]<br>$row[Weight]<br>";
echo "$row[Age]<br>$row[Sex]<br>$row[Height1]\'$row[Height2]\"<br>$row[SubGroup]<br>$row[Background]<br>$row[CharacterPic]<br>$row[LastUpdated]<br>";
echo "$row[Date]<br>$row[Flaws]<br>$row[Items]<hr>";
}
}
}
Now, this is the output I am getting from the script.
Code:
'.0.'
'.0.'
'.0.'
'.0.'
'.0.'
'.0.'
'.0.'
'.0.'
\'"
For some reason, there are three problems.
#1) It isn't picking up the $char thats being passed back to the script when they click on a link (i.e. modules.php?name=Your_Account&op=viewChar&char=$Name).
#2) The math isn't working either. Now, I am still new to php so maybe I wrote those math parts out wrong?
#3) The if statement for $row[Multi] isn't working, its posting the complete info reguardless.
Any and all help is VERY much appreciated. Thanks!!
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12383
Posted:
Sun Jun 19, 2005 4:38 pm
You may need to explicitly declare
Code:
$char = $_GET["char"];
For some reason perhaps that register_globals isn't on.
In terms of the database, I would try using the correct database abstraction commands
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum