You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 66 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Adding to Your_Account Module. Please Help. [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
Tokeda
Nuke Cadet
Nuke Cadet


Joined: May 25, 2005
Posts: 9


PostPosted: Sun Jun 19, 2005 5:01 am Reply with quoteBack to top

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);

$Attack = $Att + $BonusHit;
$Evade = $Eva + $BonusEvade;
$Strength = $Str + $BonusStremgth;
$Dexterity = $Dex + $BonusDexterity;
$Wisdom = $Wis + $BonusWisdom;
$Intelligence = $Int + $BonusIntelligence;
$Constitution = $Con + $BonusConstitution;
$Charisma = $Char + $BonusCharisma;

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!!
Find all posts by TokedaView user's profileSend private messageVisit poster's website
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12349


PostPosted: Sun Jun 19, 2005 4:38 pm Reply with quoteBack to top

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

Code:

$result = $db->sql_query($query);
$row = $db->sql_fetchrow($result);


Other than that, you may want to try echo'ing your queries out to the browser, and then trying to run them in phpMyAdmin

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.192 Seconds - 297 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::