I am new to php. I am trying to redirect to some page. At first, I am trying by hardcoding as below, but still not working.
$location = 'https://mywebsite.com/abc/?a=xyz';
header('Location:'.$location);
Above just redirecting till here: https://mywebsite.com/abc/
But I am unable to get query-params at the end of the url. Please someone tell me whats the fix for above?
EDITED:
In logs, I am getting as below warning:
PHP Warning: Cannot modify header information - headers already sent by (output started at /myfile1.php:34) in /myfile2.php on line 317,
Here is myfile1.php code:
class MyClass32
{
function myFun() {
?>
<head>
<body>
<div align=center>
<p><br>
<table width=778 cellpadding=0 cellspacing=0 border=0>
<tr>
<td bgcolor="#3399cc" width=6> </td>
<td colspan=3>
<table width="100%" cellPadding=0 cellSpacing=0 border=0>
<tr>
<?php // **THIS IS LINE 34**
//START TOP RIGHT MENU
$abc = new MyClass($this);
if ($this->isLog()) $xyz->goInto();
//END TOP RIGHT MENU
?>