Thread: getmypid

    #1
  1. No Profile Picture
    Viper_SB
    Guest
    Devshed Newbie (0 - 499 posts)
    I have it in a script and was working great in php3 but have just upgraded to php4 and it giveing me an error now.

    Then I call the $PID in a function. This is all in an include script.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
    var $PID = getmypid();
    fuction something($um) {
    $thisone = $time . " : " . $PID;
    do something with $thisone
    }
    [/code]

    If I just do:
    $mypid = getmypid();
    echo $mypid
    somewhere in a page its fine but not the way above.

    ------------------
    Viper_SB
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    You need to RTFM about variable scope.

    Pass the variable to the function or declare it global.

IMN logo majestic logo threadwatch logo seochat tools logo