This topic is locked

Redirect to view page passing variable

11/25/2016 12:16:46 PM
PHPRunner General questions
M
Maven Consulting author

Hi

I have a registration table, after the record is added I generate a unique code which is then saved in voucher table. Now I want to redirect the page to view page of voucher table and display the record of unique code.

Thank you

Sergey Kornilov admin 11/25/2016

Assuming that this unique code is a primary key of voucher table you can use something like this:

$url = "vouchers_view.php?editid1=".$unique;

header("Location: ".$url);

exit();
M
Maven Consulting author 11/25/2016

The unique code is not the primary key, can we do it without primary key. Its a text field of 15 character.