Skip to Content
It is currently March 2nd, 2021, 8:50 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: June 30th, 2019, 8:59 am 
Offline
Senior User
Senior User

Joined: September 12th, 2012, 9:42 pm
Posts: 90
Hi. I am familiar with the ExecCMD command but is there a way to trigger a php script? Currently I have a bat file set to run which does the job but it fails about 20% of the time for unknown reasons.

Is there a better way to run it?

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: June 30th, 2019, 10:17 am 
Offline
SVS Member
SVS Member

Joined: May 8th, 2004, 9:00 am
Posts: 10524
Location: Denver, CO
Code:
{ make the pal loop }
PAL.Loop := True;

PAL.LockExecution;
{ Configuration }
{==================================================}
{ URL of the script you are wanting to run }
const theurl = 'https://xxxxxxxx.com/xxxxxxxxxxx.php';
{==================================================}
{ End Configuration }

{--------------------------------------------------}

{ Build URL to access the webpage and update/run stuff }
var URL : String;
URL := ''+theurl+'';

{ execute webpage }
WebToFile('c:\dummy.txt',URL);
PAL.UnLockExecution;
PAL.WaitForTime('+00:01:30');  //Change to how long to wait to run again

_________________
- Rob Oyler, SVS
Image


Top
 Profile  
Reply with quote  
PostPosted: June 30th, 2019, 10:34 am 
Offline
Senior User
Senior User

Joined: September 12th, 2012, 9:42 pm
Posts: 90
DJ Cassio wrote:
Code:
{ make the pal loop }
PAL.Loop := True;

PAL.LockExecution;
{ Configuration }
{==================================================}
{ URL of the script you are wanting to run }
const theurl = 'https://xxxxxxxx.com/xxxxxxxxxxx.php';
{==================================================}
{ End Configuration }

{--------------------------------------------------}

{ Build URL to access the webpage and update/run stuff }
var URL : String;
URL := ''+theurl+'';

{ execute webpage }
WebToFile('c:\dummy.txt',URL);
PAL.UnLockExecution;
PAL.WaitForTime('+00:01:30');  //Change to how long to wait to run again



Thank you!I have a question. What about triggering a local php script? c:\wamp\php\php.exe c:\myphpfiles\myscript.php

Can you give me the proper context for that?


Top
 Profile  
Reply with quote  
PostPosted: July 1st, 2019, 3:03 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8155
Location: Cologne (Germany)
Code:
ExecuteCmd('c:\wamp\php\php.exe',['c:\myphpfiles\myscript.php']);

If either path has spaces inside, you need to first add quotes to it:
Code:
ExecuteCmd(AnsiQuotedStr('c:\wamp\php\php.exe', '"'), [AnsiQuotedStr('c:\myphpfiles\myscript.php', '"')]);


See the PAL Scripting Reference for the ExecuteCmd command for more examples.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group