I'm using PHP, Smarty, MySQL for my website. I have an array of error messages and I want to use this array in a PHP file to which I'm redirecting the control. However, I'm not understanding how should I achieve this.
code is as follows:
$error_msg = $contact_us->GetAllErrors();
$smarty->assign('error_msg', $error_msg);
$return_url = "view_contact_us.php?page=".$_SESSION['contact_us']."&from_date={$from_date}&to_date={$to_date}&contact_full_name={$contact_full_name}&contact_label={$hidden_contact_label}&error_msg=".$error_msg;
header("Location:".$return_url);
I tried many different ways, but I'm not able to use the array $error_msg
in the file view_contact_us.php
.
If I print the array $error_msg it looks like following:
Array
(
[error_msgs] => Please select at least one enquiry
Please select at least one enquiry label
)