Hi guys I want to combine one banner + website url (not local in same folder) into one php page and then display into browser. Here is my code gcsurls.php <?php header("Location: http://www.yahoo.com"); ?> (If I acess this url this works fine and I am redirected to yahoo.com) test2.php <a rel="nofollow" target="_blank" href=http://goldenwealth.biz/?ref=globalcashsite><img src="http://goldenwealth.biz/images/468x60.gif" width="468" height="60"></a> <? include("/home/gcsite/public_html/urls/gcsurls.php"); ?> When I access http://www.globalcashsite.com/urls/test2.php? it gives error Warning: Cannot modify header information - headers already sent by (output started at /home/gcsite/public_html/urls/test2.php:3) in /home/gcsite/public_html/urls/gcsurls.php on line 2 Previously I was using notepad to edit php file but then I used CuteFTP to edit file and upload. Please help me how to solve this issue. Thank you GlobalCashSite
header() function in php must be called before any actual output is sent to the client (read this php.net/manual/en/function.header.php) In your code, you output the banner first, then header is called next which caused the error that you described. Maybe you can use $ycontent = file_get_contents("www.yahoo.com"); first, then append the banner to the top of "ycontent"; $ycontent = "your banner".$ycontent; Little John
Hi littlejon, Your suggestion worked and that error disappeared. Now my code is as follows: <? $site = include("/home/gcsite/public_html/urls/gcsurls.php"); $banner = '<a rel="nofollow" target="_blank" href=http://goldenwealth.biz/?ref=globalcashsite><img src="http://goldenwealth.biz/images/468x60.gif" width="468" height="60"></a>'; $show = $banner.$site; echo $show; ?> But now it does not display banner and browser redirected to yahoo website. I want to show banner at top and yahoo website below banner. How I can do this? I think this redirect will not work that I used in gcsurls.php as follows: <?php header("Location: http://www.yahoo.com"); ?> Please help me? GlobalCashSite
You don't want to use header("Location ....."); because that will redirect users to yahoo.com website. So, in gcsurls.php, you want to get the content of yahoo.com. You would do this <?php $ycontent = file_get_contents("http://www.yahoo.com"); echo $ycontent; ?> Little John
Hi John, Thank you very much for your quick help, this solved my problem. I am sure I also can open two sites at same time at same page. GlobalCashSite