There may not be any headers before you use the 'header' statement.
The header("Location:...") should be the first output you send. You
might want to consider moving the two 'anti-cache' headers after the
header("Location;...") statement.

RenzE.


On Mon, Mar 26, 2001 at 11:06:11PM +0800, E K L wrote:
> Hi all,
> 
> could any one tell me that how do I go to a specific URL using php 
> command.At the same time, I would like to pass the variable to the page.
> I used header to do it but failed, with the error message:-
> 
> Warning: Cannot add header information - headers already sent by (output 
> started at /usr/local/apache/htdocs/traName_use.php:2) in 
> /usr/local/apache/htdocs/traName_use.php on line 3
> 
> Warning: Cannot add header information - headers already sent by (output 
> started at /usr/local/apache/htdocs/traName_use.php:2) in 
> /usr/local/apache/htdocs/traName_use.php on line 4
> 
> Warning: Cannot add header information - headers already sent by (output 
> started at /usr/local/apache/htdocs/traName_use.php:2) in 
> /usr/local/apache/htdocs/traName_use.php on line 26
> 
> 
> 
> 
> And our code is as below:-
> 
> <?php
> header("Pragma : no-cache ");
> header("Cache-Control :no-cache,must-revalidate");
> 
> $db=mysql_connect("localhost","root","123456");
> mysql_select_db("test",$db);
> $query="select trade_name_c
>         from confirm_member_info
>               where  trade_name_c = '$tradeName'";
> $result=mysql_query($query,$db);
> $row=mysql_fetch_row($result);
> 
> if($row[0]==$tradeName)
> {
> //echo "Sorry, the Trade Name <b>$tradeName</b> has been used<Br>";
> //echo "Please Choose other Trade Name<BR>";
> //echo "Click <a href='mysignup_1.php'here</a> to back.";
> header("Location: http://192.168.0.1/mysignup_1.php");
> }
> else
> {
> //echo "Your Trade Name and password has been acceptted<br>";
> //echo "Click to proceed.";
> //<input type='hidden' name='introducer' value='$introducer'>
> header("Location: http://www.hotmail.com");
> }
> ?>
> <input type="hidden" name="tradeName" value="<?$tradeName?>">
> <input type="hidden" name="password" value="<?$password?>">
> <input type="hidden" name="MotherName" value="<?$MotherName?>">
> 
> 
> I tried to use hidden input type to pass the value, but can it work without 
> form and submit button??
> 
> I would appreaciate if you could give me suggestions and advice.
> 
> thanks
> 
> 
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to