Get field value from URL parameters

business

Member
Hi,

I have two tables.

1. Payroll
2. Time_Log

Once you add a new record to payroll, I want it to redirect to the time_log new record and also I want the field (payroll_ID) to automatically get the ID of newly created payroll entry from the URL or by any other way, is it possible?

Do I have to use a custom function to get the URL parameters and return it to the field, or there is another possible way to do this?

Thanks
 

eugenio

Administrator
Staff member
Hello,
you can try to redirect using an after insert hook, it's tricky because the commit of the DB transaction is AFTER the execution of the hook function, but if you don't add an exit() statement after the redirect it should work anyway.

I am not sure which URL parameters are you referring to but in general you can get the URL parameters in PHP using the $_GET array.

Best,
 
Top