• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PHP Header redirect?
PostPosted: Fri Feb 21, 2014 4:08 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Jan 11, 2008 6:56 pm
Posts: 37
Location: Wirral, UK
I am re-designing and converting an existing site to CMSMS. One of the pages has this PHP right at the top:

\$1:
<?php
if(isset($_POST['Submit'])) {
      $event = $_POST['event'];
      if($event != "exit") {
         $location = $event.'/';
         header('Location:'.$location);
      }
   }
?>


and further down within the page content there is a select element with a drop down list and when one of the options is selected the page redirects to the chosen option.

I understand that a PHP header event has to be the very first thing that happens before anything else on the page. So, my question is: How can I get this to work with CMSMS?

Any help very gratefully received,

T


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: PHP Header redirect?
PostPosted: Fri Feb 21, 2014 4:25 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 8166
Location: Fernie British Columbia, Canada
CMSMS has a redirect() function that handles this.

If the headers are already sent, it uses javascript to perform the redirection.

redirect('http://mysite.com/some_url');

_________________
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: googlebot


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 post attachments in this forum

Search for:
Jump to:  
A2 Hosting