This topic is locked
[SOLVED]

 Set a Checkbox upon QRCode Scan

3/12/2021 2:01:26 PM
PHPRunner General questions
S
swanside author

I have this that generates a QRCode,

When scanned, is it possible that a checkbox can be checked upon the page opening?

SELECT

ID,

Name,

CONCAT('https://192.168.0.182/psapob/muster_list.php?qs=',`Name`) AS QRCode

FROM POB
A
acpan 3/13/2021

One way is to use DB API to update the status in the "Before Display" event, if the QR Code's content is a PHPRunner's Page URL.



I have this that generates a QRCode,

When scanned, is it possible that a checkbox can be checked upon the page opening?

SELECT

ID,

Name,

CONCAT('https://192.168.0.182/psapob/muster_list.php?qs=',`Name`) AS QRCode

FROM POB


S
swanside author 3/13/2021

Yes its a PHPRunner page, but don't have a clue what the DB API is



One way is to use DB API to update the status in the "Before Display" event, if the QR Code's content is a PHPRunner's Page URL.

A
acpan 3/13/2021

Assuming your QR Code URL data is 'https://192.168.0.182/psapob/muster_list.php?qs=name&id=123';
You can try this in Before Display event:



$id = $_REQUEST["id"];
DB::Exec("UPDATE your_table SET status = 1 WHERE id=$id");


Read the manual for DB API for more info.
[quote name='swanside' date='13 March 2021 - 06:55 AM' timestamp='1615618513' post='94087']

Yes its a PHPRunner page, but don't have a clue what the DB API is

S
swanside author 3/13/2021

Cheers

Changed to suit my table and names and works great. Thanks
[quote name='acpan' date='13 March 2021 - 07:09 AM' timestamp='1615619345' post='94088']

Assuming your QR Code URL data is 'https://192.168.0.182/psapob/muster_list.php?qs=name&id=123';
You can try this in Before Display event:



$id = $_REQUEST["id"];
DB::Exec("UPDATE your_table SET status = 1 WHERE id=$id");


Read the manual for DB API for more info.