Does anyone know another way to redirect without header(); giving me this error? wp_redirect
doesn't work for me either...
This is the error I'm getting:
Warning: Cannot modify header information - headers already sent by (output started at /home/my_site/public_html/wp-content/themes/EHCC/page-secure.php:8) in /home/my_site/public_html/wp-content/themes/my_theme/template-parts/secure-form.php on line 8
<?php
ob_start();
if (!empty($_POST['password']))
{
$redirect = ($_POST['password']);
$redirect = str_replace(" ","-",$redirect);
$redirect = strtolower($redirect);
header("Location: /bids/$redirect");
die();
}
else
{
print '
<div class=\'row secureform__container\'>
<form id=\'securedownloads\' class=\'secureform\' method=\'post\' action=\'\'>
<fieldset class=\'secureform__inner\'>
<label for=\'password\' class=\'secureform__label\'>Password:</label>
<input id=\'password\' type=\'text\' name=\'password\' maxlength=\'40\' class=\'secureform__input\'>
<input type=\'submit\' value=\'login\' class=\'secureform__submit\'>
<input type=\'hidden\' name=\'next\' value=\'\'>
</fieldset>
</form>
</div>
';
}
?>