Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

php redirect after post form information from smarty templat

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
ryansyt
Smarty n00b


Joined: 10 Mar 2016
Posts: 1

PostPosted: Thu Mar 10, 2016 3:02 pm    Post subject: php redirect after post form information from smarty templat Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Mar 10, 2016 5:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP