Re: Header Location Question

From: Date: Wed, 07 Feb 2001 04:43:04 +0000
Subject: Re: Header Location Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38492@lists.php.net to get a copy of this message
On Wed, 7 Feb 2001 13:27, Jeff Oien wrote: > I have the code below within a larger web page which is > like a portal. When I submit the form, I get this message: > > -------- > Warning: Cannot add header information - headers already sent by (output > started at c:\apache\htdocs\index1.php3:9) > -------- > > Can I get it to take me to the BigCharts site and leave the > page I'm on? Thanks. > Jeff Oien > > -------- > <?php > > print "<form method=\"post\" action=\"$PHP_SELF\">"; > print "Symbol<br>"; > print "<input type=\"Text\" size=\"5\" > name=\"symbol\"><br>"; > print "<INPUT type=\"hidden\" name=\"op\" > value=\"ds\">"; > print "<input type=\"Submit\" value=\"Chart\">"; > > if ($op == "ds") { > $url = > 'http://www.bigcharts.com/quickchart/quickchart.asp?symb= . > $symbol'; header ("Location: $url"); > } > ?> If you are going to use header, you _must_ make sure that nothing is output to the server, not even white space or blank lines, before the header function is called. -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#38492) next »