Support cron job

lordi

Registered
Hello, I hope someone can help me, I'm trying to create a kind of cron job. My goal is when a user clicks on a file, for example. test.php some information should written to the db, like

PHP:
$statement = $pdo->prepare("INSERT INTO test (Name, id, nummer, nummer2) VALUES (?, ?, ?, ?)");
$statement->execute(array('$XF:User', '$user', '. $userFinder .', 'wert3'));


I enter three values manually but how can I ensure that his user id is also entered? How is it possiblöe to import the board to get the ip and add it to the db import.

sorry for my bad english


sorry i forgot something, the php file would have to import the login data and the user id to then enter it in the db, how is that possible?
 

lordi

Registered
Thats what i try atm

<?php
$dir = __DIR__;
require($dir . '/src/XF.php');

XF::start($dir);

if (\XF::requestUrlMatchesApi())
{
\XF::runApp('XF\Api\App');
}
else
{
\XF::runApp('XF\Pub\App');
}


$sql = $db->prepare("INSERT INTO test (Name, id, nummer, nummer2) VALUES (?, ?, ?, ?)");
$sql->execute(array('$userid', '$user', '. $userFinder .', 'wert3'));
echo "Hello $xf.visitor.user_id";

?>
 
  • Tags
    support cron job
  • Back
    Top Bottom