Jump to content

WhiteyDude

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

WhiteyDude's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Oh... Oh my . Thank you btherl . I was doing $User instead of User . Works fine now . And redbullmarky, I know . However, changing the settings in the ini doesn't do it either. Here's some of my php.ini... error_reporting = E_ALL & E_STRICT display_errors = On display_startup_errors = On log_errors = On log_errors_max_len = 1024 ignore_repeated_errors = Off ignore_repeated_source = Off report_memleaks = On track_errors = On error_prepend_string = "<font color=ff0000>" error_append_string = "</font>" error_log = "C:\error.log" /Whitey
  2. Already tried that utexas_pjm - doesn't do a thing . I know you really need the actual code, but what I'm working on is closed source currently... I'll show you as much as I can attack.php <?php ... require ($atw->getClassDirectory().'Fighting.class.php'); require ($atw->getClassDirectory().'Users.class.php'); ... $Fighting = new Fighting(); $Users = new Users(); ... if ($_POST['attack']) { $attackerData = $psuedo; $defenderData = $psuedo; $turns = $psuedo; $return = $Fighting->attackPlayer($attackerData,$defenderData,$turns); } ?> Fighting.class.php <?php class Fighting{ // constructor function Fighting(){} ... function attackPlayer($attackerData,$defenderData,$turns) { ... $Users::updateUser($attackerData['userID'], "updatedata=here"); $Users::updateUser($defenderData['userID'], "updatedata=here"); return true; } ?> Users.class.php <?php class Users { // constructor function Users(){ } ... function updateUser($id, $data) { //Update code here } ?> Also, I'm not really a big O.O.P. buff (obviously). That link Daniel0 posted makes me think the second class (Users) has to be defined as a child class? I hope not, because I still want to be able to call it without calling Fighting... Thanks guys, /Whitey
  3. I forgot to put that into the example code I put up there... They're both required, they're both initialized fine. I can't call class2function() from inside Class1 still though.. /Whitey
  4. Note: I don't think anyone checks the O.O.P. section... There arn't many posts or reads there... It's fine if someone wants to delete the original topic there . Hi guys, I have a quick but relatively urgent question. I have 2 classes here, and I wish to call a function that's inside one of them from another. Example code: Main page: <?php $class1 = new Class1(); $class2 = new Class2(); $class1->function1(); ?> Class 1 <?php class Class1 { function Class1() {} function function1() { //THIS is the line I'm having a problem with Class2::class2function(); } } ?> Class 2 <?php class Class2 { function Class2() {} function class2function() { echo "Worked!"; } } ?> Another problem is that on the apache server I'm running (2.2.4, local) I'm unable to display PHP errors. I've tried everything I can think of - the PHP ini is starting to get worn, it's been modified so many times. PHP 5.2.1 by the way. Please help guys, I need this fixed within the next hour or so. Thanks, /Whitey
  5. I think this belongs here... If not, please move to the appropriate section Hi guys, I have a quick but relatively urgent question. I have 2 classes here, and I wish to call a function that's inside one of them from another. Example code: Main page: <?php $class1 = new Class1(); $class2 = new Class2(); $class1->function1(); ?> Class 1 <?php class Class1 { function Class1() {} function function1() { //THIS is the line I'm having a problem with Class2::class2function(); } } ?> Class 2 <?php class Class2 { function Class2() {} function class2function() { echo "Worked!"; } } ?> Another problem is that on the apache server I'm running (2.2.4, local) I'm unable to display PHP errors. I've tried everything I can think of - the PHP ini is starting to get worn, it's been modified so many times. PHP 5.2.1 by the way. Please help guys, I need this fixed within the next hour or so. Thanks, /Whitey
  6. [code=php:0] session_start(); //Make sure the above line is put somewhere high up (probably just after your <?php tag) $email2 = $_POST['email2']; $passwd = $_POST['passwd']; // check if the user info validates the db $sql = mysql_query("SELECT * FROM odesign WHERE email='$email2' AND password='$passwd'"); $myrow = @mysql_fetch_array($sql); if($myrow > 0){ $usrid = $myrow["usrid"];         // Register some session variables!         session_register('email2');         $_SESSION['email2'] = $email2;         $_SESSION['passwd'] = $passwd;         $_SESSION['usrid'] = $usrid; [/code] ------------------------------ [code=php:0] function session_checker(){ if(!$_SESSION['usrid']){   $error1= "You are not logged in!"; header("Location: http://www.gamegear.com.au/login.php?error1=$error1");   exit(); } } [/code] Is how I believe the above two are suggesting it :P. Don't forget, if that function is in another file, it needs a session_start() up the top too :). Otherwise $_SESSION will be empty :P. Also, you shouldn't put a variable straight into an SQL query after $_POST. Have a look at http://au3.php.net/manual/en/function.mysql-escape-string.php and http://au3.php.net/manual/en/function.addslashes.php BTW, Aussie Aussie Aussie ^_^
  7. [quote author=fert link=topic=123749.msg511965#msg511965 date=1169604486] this is an HTML problem not a php problem [/quote] That's what I thought when I looked too, but he said he's getting "Fatal errors", sounds like PHP to me. uglysignman: are you able to paste some of these errors here? Does look like you're using some sort of external library though (joomla?), and I don't personally have a lot of expertise in it :P. -Whitey
  8. [!--quoteo(post=377814:date=May 28 2006, 11:22 PM:name=localhost)--][div class=\'quotetop\']QUOTE(localhost @ May 28 2006, 11:22 PM) [snapback]377814[/snapback][/div][div class=\'quotemain\'][!--quotec--] As I said, I am completely new to PHP, I have no idea what you are talking about in alot of that, I just replaced my query with the one you posted and I still get the same error. Also, is sha1 built into php like md5? [/quote] He means you have to replace the "unique_id" field with your unique id field... Like userID or ID. Get a description of your table. If you use phpMyAdmin, find the table, go SQL and put in "describe yourtablename" replacing yourtablename with the name of the table. If you use a command line client (where it says mysql>), put in "use yourdatabase;" and "describe yourtablename;", replacing the relevant bits with your data. /Whitey
×
×
  • 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.