This question has been answered by multiple community members. See the first response.
$url = $modx->makeUrl(54); $modx->sendRedirect($url);
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include, or require, functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
<?php session_start(); if (isset($_POST['connexion'])) { if($_POST['login']=='goupil' || $_POST['pass']=='usa2012') { $_SESSION['login']='goupil'; $url = $modx->makeUrl(2); $modx->sendRedirect($url); } else { $erreur = '<p class="warning">Ihr Passwort ist falsch! Bitte versuchen Sie es erneut.</p>'; } } if (isset($_GET['logout'])) { $success = '<p class="success">Sie haben sich erfolgreich ausgeloggt.</p>'; }
[[session_start?]]
$url = $modx->makeUrl(2); $modx->sendRedirect($url);
$url = $modx->makeUrl(2); $modx->sendRedirect($url);