php - Codeigniter reload page with id in url -


on site i’m coding have page accessible through following urls:

http://site.com/campaigns/view/

which displays default view of campaigns , lets say

http://site.com/campaigns/view/8

which displays details campaign 8

on page have form can add subscribers specific campaign. controller logic goes this:

$campaign_id = $this -> uri -> segment(3); $this -> campaign_model -> get_campaign_details(3);  // form submitted if ($this -> input -> post()) {     //code check inputs , save subscriber } else {     // display page campaign details }  

now problem is, in else branch, how go displaying page campaign details. i’ve tried redirect("campaigns/view/8") creates redirect loop , also

$this -> load -> view("campaigns/view/".$campaign_id) 

which of course tries load view 8.php doesn’t exist. how go implementing functionality this?

thanks in advance!

jim

edit:

if there isn't post submit see details, includes among others list of subscribers, campaign number 8, 9 etc.

if there post submit see details page again of course time include newly added subscriber.

submit again -> add subscriber -> details view again , on.

you need specific you'd output in case of campaign 8 when not after post submit.. of course redirection comes same page.

what behavior see happen?


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -