Jump to content

error: Cannot modify header information


ammar77

Recommended Posts

Hi, i have an error message while running this random link redirection script, this script uses a urls.txt file to select random links..

 

link structure of urls.txt

 

http://www.yahoo.com
http://www.google.com
http://www.live.com

 

random.php

 

 <?
      $file = "urls.txt";
      $fp = file($file);
      $urls = $fp[array_rand($fp)];
      header("Location: $urls");
?>

 

error i got:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/random.php:1) in /home/user/public_html/random.php on line 5

 

 

kindly do some needful.

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/144694-error-cannot-modify-header-information/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.