0

I have created a page

myfunction.php and added two functions:

function AppNotify ($Uid,$ Message,$ Data)
{
    return;
}

function AppNotifyUnfriend($Uid,$ Message,$ Data)
{
    return;
}

After that I created another page and include “myfunction.php” on these page
then create code

$done= AppNotify (‘12’,’hello’,’Delete’);
$done2= AppNotifyUnfriend(‘12’,’hello’,’Delete’);

The problem is when i run myfunction.php, it’s only run first “AppNotify”. didn't run the 2nd function.

Then I change the code on the myfunction.php

$done2= AppNotifyUnfriend(‘12’,’hello’,’Delete’);
$done= AppNotify (‘12’,’hello’,’Delete’);

Now it’s run ‘AppNotifyUnfriend’.

Question) why it’s not running the 2nd function

I have also directly run

AppNotify (‘12’,’hello’,’Delete’);
AppNotifyUnfriend(‘12’,’hello’,’Delete’);

and then

AppNotifyUnfriend(‘12’,’hello’,’Delete’);
AppNotify (‘12’,’hello’,’Delete’);

Same error

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by DarkMonarch
0

To start... if that is a direct copy, you shouldnt have spaces after the $

so.. change

function AppNotify ($Uid,$Message,$Data)
 {
  return;
 }
function AppNotifyUnfriend($Uid,$Message,$Data)
 {    
  return;
 }

and see if that makes any changes...

otherwise, personally I would need more info than that to help... something is missing.

0

or create a

class myFunction{
function AppNotify ($Uid,$ Message,$ Data)
{
     return;
}
function AppNotifyUnfriend($Uid,$ Message,$ Data)
{
     return;
}
}//End myFunction

require_once in your file instead of include and call the functions the way you need it.

exemple:

$app = new myFunction();
$app->AppNotify(x, y, z);
$app->AppNotifyUnfriend(x, y, z);

and so on.

have fun.

Dark

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.