I want my webpage to redirect to another webpage once some code is run by a user action. However, I am coding PHP on a Wordpress page (with php plugin) and I keep getting the error that the headers are already sent. Even if I try ob_start approach I still get this error. Does anyone know a workaround to redirecting after a user clicks a button on the webpage and a query is run considering that the headers have already been sent by the wordpress code?
The error message isWarning: Cannot modify header information – headers already sent by (output started at...
//the code currently
header("Location: http://example.com/full/?wid=$the_WID");