Request guidance with writing automation code, and accessing the database.

Links for php scripts

Moderators: gesf, Michalio

Post Reply
ICHaps
New php-forum User
New php-forum User
Posts: 4
Joined: Sun Nov 27, 2022 1:34 am

Hello.

Could I please request some guidance with writing some automation code, as I've not done this before?

At present I've written the cron.php file:

Code: Select all

<?php
/* Root Directory*/
header('Location: '."/Automation/start.php");
die();
?>
and the start.php file:-

Code: Select all

<?php
header('Location: '.'/Automation/crnaccount/accountmnge.php');
header('Location: '.'/Automation/crnentrykeys/seviceentries.php');
die();
?>
I'm unsure if I've written the above correctly, or if I should have used include.

Also may I ask, using the server's cron job, how would I access the database table, and update or delete a record?

Thank You.
User avatar
Michalio
Moderator
Moderator
Posts: 339
Joined: Sun Jul 18, 2021 1:33 pm
Location: Poland

You cannot use multiple Location header, if you want to execute some php scripts you can create an request to call the file by http:

Code: Select all

<?php
$results1 = file_get_contents('http://.../Automation/crnaccount/accountmnge.php');
$results2 = file_get_contents('http://.../Automation/crnentrykeys/seviceentries.php');
Free coding lessons: https://php-forum.com/phpforum/viewtopic.php?t=29852
ICHaps
New php-forum User
New php-forum User
Posts: 4
Joined: Sun Nov 27, 2022 1:34 am

Hello Michalio.

Thank you for your reply.
Post Reply