|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ryansyt Smarty n00b
Joined: 10 Mar 2016 Posts: 1
|
Posted: Thu Mar 10, 2016 3:02 pm Post subject: php redirect after post form information from smarty templat |
|
|
I am new to Smarty. I created a page call 'newcall.tpl' and newcall.php' to enter data to a database table. After I fill out the form fields on the tpl file, the php file takes the post variables and inserts those values to a database table and then runs some more business logic on the post data. That all works fine.
After the post I need to redirect to a page called 'calldetail.php' / 'calldetail.tpl' to display the newly entered data and enter related child data.
My problem is that if I use 'header("Location:calldetail.php")' to redirect at the end of the post operation I get this error:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\dispatch\libs\smarty\sysplugins\smarty_internal_template.php:174) in C:\xampp\htdocs\dispatch\newcall.php on line 129
I don't understand what that means and what to do about it. This seems like it should be simple.
Thanks!
Ryan |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Mar 10, 2016 5:12 pm Post subject: |
|
|
You're mixing multiple steps.
1. Showing form to user.
2. Processung submitted data.
3. Showing the results of user's submission.
This is 3 different actions, normally performed by 3 different pages.
And the #2 has nothing to do with Smarty. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|