This topic is locked

Redirect to success msg page after added record.

10/19/2011 11:37:36 PM
PHPRunner General questions
K
kiki_lala author

hi.
how to create a success message view page after the user added new record?
The page must contain field name, id and the name of sports_name that the user choose.
For example,
"Congratulation (name),(id). you succesfully registered as (sports_name) player."
The field must contain the new record of user only.
Tq. Kiki_Lala

C
cgphp 10/20/2011

In the "After record added" event enter this code:

$_SESSION['message'] = "Congratulations.......";

header("Location: tablename_view.php?editid1=".$keys['key_field_name']); //key_field_name is the name of the primary key field of the new added record

exit();


In the "Before display" event of the view page:

if(isset($_SESSION['message']))

{

$xt->assign("message",$_SESSION['message']);

unset($_SESSION['message']);

}


In the Visual Editor of the View page, switch to HTML mode and add the following template var where you want to see the message:

{$message}