Run php script "on_insert" event

QuestionsRun php script "on_insert" event
Gaƫtan asked 3 years ago

Hi,
Could you please tell me how to do the following:

"on_insert" event, I would like to run an external php script which updates some database fields using external data.

Here is part of my script:


$eg3["on_insert"] = array("add_walletGrid03", null, true);
$g3->set_events($eg3);

function add_walletGrid03($data)
{
$id = intval($_GET["rowid"]);
$data["params"]["transaction_wallet_id"] = $id;

===> Here is where i would like to run "../my_script.php"

}

How can I achieve this please ?

3 Answers
Abu Ghufran answered 3 years ago

You can simple include or require this php script.
It will get executed.

include("../my_script.php");

You may need to adjust file paths if you have included other files in it.

selectcas.biz answered 3 years ago

Thanks Abu, it does work but not all the time I add a record… Strange ?

Abu Ghufran answered 3 years ago

You should check php error log file or put echo "test";die; for debugging.

Your Answer

1 + 5 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?