Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Senior Member tha_Gsheep's Avatar
    Join Date
    Feb 2003
    Location
    Scotland
    Posts
    188
    Member #
    780
    Hi there my passed parameters don't seem to be visible within the method could anyone suggest something I'm missing. I've tried both the normal and the $this-> method but I don't seem to get any output.

    Mycode looks like this:

    Calling Code:

    $dateMgr = new DateMgr();
    $timeStamp = 1159185712;
    $offset = 5;
    $timeStamp = $dateMgr->ammendServerTime($timeStamp, $offset);

    ---------------

    class DateMgr{

    function ammendServerTime($timestamp, $offset){
    echo("This is the Timestamp in ammendServerTime" . $timeStamp ."<br />");
    echo("This is the Timestamp in ammendServerTime" . $this->offset ."<br />");

    ...
    }

    }


    But I just get a blank page and no error output. Any ideas? Thanks.
    www.appletv.co.uk

  2.  

  3. #2
    Senior Member tha_Gsheep's Avatar
    Join Date
    Feb 2003
    Location
    Scotland
    Posts
    188
    Member #
    780
    echo 'This is the Timestamp in ammendServerTime' . $timeStamp .'<br />';
    echo 'This is the Timestamp in ammendServerTime' . $offset .'<br />';

    When I used echo without the brackets and without the double quotes it worked fine. I had also overlooked the fact I had used both "timeStamp" and "timestamp" in both cases. Although I didn't replicate my error in the above code. Thanks.
    www.appletv.co.uk

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You should only use [minicode]$this[/minicode] if you're referring to a member variable or method (i.e., some field or method defined in the class itself, not passed into the class or defined elsewhere).

    Wikipedia article on "this." The concept initially is confusing but then it becomes second-nature.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 03:14 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com