Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Strange Redirect Message appearing!

Go to End

3 Posts   1498 Views


Community Member, 23 Posts

7 May 2011 at 5:18am


I've got a message appearing when I enter a search term and redirect to another page:

Redirecting to http://localhost/xxx/ie/home/roi-domestic-help-centre/new-faqsearchpage... (output started on C:\xampp\htdocs\xxx\FAQ\code\Tips.php, line 1)

I do a redirect from the page like this after taking in some form data for Search:
function doSearchResults($data, $form) {
Session::set('q', $data['q']);

Tips looks like this

class Tips extends Page {

public static $db = array(
"Options" => "Enum('ie, uk')"

function getCMSFields() {
$fields = parent::getCMSFields();
new DropdownField(
'Choose which country this tip applies to:',

return $fields;
class Tips_Controller extends Page_Controller {

* An array of actions that can be accessed via a request. Each array element should be an action name, and the
* permissions or conditions required to allow the user to access it.
* <code>
* array (
* 'action', // anyone can access this action
* 'action' => true, // same as above
* 'action' => 'ADMIN', // you must have ADMIN permissions to access this action
* 'action' => '->checkAction' // you can only access this action if $this->checkAction() returns true
* );
* </code>
* @var array
public static $allowed_actions = array (


Thanks in advance,



Forum Moderator, 5523 Posts

7 May 2011 at 2:47pm

Normally this occurs if you have whitespace after the ?> tag or before the <?php tag in one of your PHP files. This causes whitespace output so when submitting forms or other things which redirect will cause the warning you mention. This is why one of our guidelines is to avoid using the closing PHP tag.


Community Member, 23 Posts

7 May 2011 at 10:49pm

Hi Willr,

Thanks once again for your help!

That's worked eventually... I couldn't find the rogue space or special character but when I re-wrote the php piece by piece it worked fine.