Re: [PHP] Problem with header("Location:" )...

2011-07-31 Thread Jason Pruim





On Jul 31, 2011, at 6:23 PM, Tamara Temple wrote:

> 
> On Jul 31, 2011, at 1:40 PM, Jason Pruim wrote:
> 
>> So I'm attempting to redirect back to the main site of a page after a 
>> successful insert into a database... Here's my code:
>> > 
>> if (!$resp->is_valid) {
>>   // What happens when the CAPTCHA was entered incorrectly
>>   die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
>>"(reCAPTCHA said: " . $resp->error . ")");
>> } else {
>> 
>> $name = mysql_real_escape_string($_POST['txtName']);
>> $comment = mysql_real_escape_string($_POST['areaComment']);
>> $phonelink = mysql_real_escape_string($_POST['phonelink']);
>> $SQL = "INSERT INTO comments (name, comment, phonelink) VALUES ('$name', 
>> '$comment', '$phonelink')";
>> 
>> mysql_query($SQL) or die("Unable to insert at this time. Sorry for the 
>> inconvience");
>> //echo "Insert successful!";
>>   header("Location: 
>> HTTP://jason.pruimphotography.com/dev/clients/flewid/Phone/");
>> 
>> 
>> // Your code here to handle a successful verification
>> }
>> 
>> 
>> ?>
>> 
>> 
>> The insert happens, BUT it won't redirect back to the site  There isn't 
>> any reason I should be able to do a header() redirect at that point is there?
> 
> Since the echo is commented out, there shouldn't be any output if that is sum 
> total of the code executing on the http request. If this file is called from 
> some other script, you might check to see if any output is sent from there. 
> If display_errors is on, you should be getting something like "Unable to send 
> headers after output" or some such (I can't offhand think of the actual error 
> message).
> 
> You can keep the "error successful" message for verification if you write it 
> directly to the error log, via:
> 
>   error_log("Insert successful".PHP_EOL);
> 
> Sometimes, it's also nice to insert markers to let you know where the log is 
> emanating from:
> 
>   error_log(__FILE__.'@'.__LINE__.': '."Insert successful".PHP_EOL);
> 
> Sometimes, a vexing sort of error is a blank line at the top or bottom of a 
> file, outside the 

Just before I got your e-mail, I found there were 3 spaces at the very top of 
the file in front of my http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header("Location:" )...

2011-07-31 Thread Tamara Temple


On Jul 31, 2011, at 1:40 PM, Jason Pruim wrote:

So I'm attempting to redirect back to the main site of a page after  
a successful insert into a database... Here's my code:

is_valid) {
   // What happens when the CAPTCHA was entered incorrectly
   die ("The reCAPTCHA wasn't entered correctly. Go back and try it  
again." .

"(reCAPTCHA said: " . $resp->error . ")");
 } else {

 $name = mysql_real_escape_string($_POST['txtName']);
 $comment = mysql_real_escape_string($_POST['areaComment']);
 $phonelink = mysql_real_escape_string($_POST['phonelink']);
 $SQL = "INSERT INTO comments (name, comment, phonelink) VALUES  
('$name', '$comment', '$phonelink')";


 mysql_query($SQL) or die("Unable to insert at this time. Sorry  
for the inconvience");

 //echo "Insert successful!";
   header("Location: HTTP://jason.pruimphotography.com/dev/clients/flewid/Phone/ 
");



 // Your code here to handle a successful verification
 }


?>


The insert happens, BUT it won't redirect back to the site   
There isn't any reason I should be able to do a header() redirect at  
that point is there?


Since the echo is commented out, there shouldn't be any output if that  
is sum total of the code executing on the http request. If this file  
is called from some other script, you might check to see if any output  
is sent from there. If display_errors is on, you should be getting  
something like "Unable to send headers after output" or some such (I  
can't offhand think of the actual error message).


You can keep the "error successful" message for verification if you  
write it directly to the error log, via:


error_log("Insert successful".PHP_EOL);

Sometimes, it's also nice to insert markers to let you know where the  
log is emanating from:


error_log(__FILE__.'@'.__LINE__.': '."Insert successful".PHP_EOL);

Sometimes, a vexing sort of error is a blank line at the top or bottom  
of a file, outside the 




Or is there a better way to do it?

Thanks Everyone!


Jason Pruim
li...@pruimphotography.com




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header("Location:" )...

2011-07-31 Thread Jason Pruim

Jason Pruim
li...@pruimphotography.com



On Jul 31, 2011, at 2:50 PM, Dajka Tamas wrote:

> Try lowercase 'http'. Anything in error log? Try turning on display_errors.

Tried both, upper and lower case http nothing changed... And nothing in the 
error log... I try a simple echo with a link and that works just fine... 

Starting to get frustrated with it



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with header("Location:" )...

2011-07-31 Thread Dajka Tamas
Try lowercase 'http'. Anything in error log? Try turning on display_errors.

Cheers,

Tamas

-Original Message-
From: Jason Pruim [mailto:li...@pruimphotography.com] 
Sent: Sunday, July 31, 2011 8:40 PM
To: 
Subject: [PHP] Problem with header("Location:" )...

So I'm attempting to redirect back to the main site of a page after a
successful insert into a database... Here's my code:
is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again."
.
 "(reCAPTCHA said: " . $resp->error . ")");
  } else {

  $name = mysql_real_escape_string($_POST['txtName']);
  $comment = mysql_real_escape_string($_POST['areaComment']);
  $phonelink = mysql_real_escape_string($_POST['phonelink']);
  $SQL = "INSERT INTO comments (name, comment, phonelink) VALUES
('$name', '$comment', '$phonelink')";

  mysql_query($SQL) or die("Unable to insert at this time. Sorry for the
inconvience");
  //echo "Insert successful!";
header("Location:
HTTP://jason.pruimphotography.com/dev/clients/flewid/Phone/");

  
  // Your code here to handle a successful verification
  }


?>


The insert happens, BUT it won't redirect back to the site  There isn't
any reason I should be able to do a header() redirect at that point is
there?

Or is there a better way to do it?

Thanks Everyone!


Jason Pruim
li...@pruimphotography.com




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with header("Location:" )...

2011-07-31 Thread Jason Pruim
So I'm attempting to redirect back to the main site of a page after a 
successful insert into a database... Here's my code:
is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
 "(reCAPTCHA said: " . $resp->error . ")");
  } else {

  $name = mysql_real_escape_string($_POST['txtName']);
  $comment = mysql_real_escape_string($_POST['areaComment']);
  $phonelink = mysql_real_escape_string($_POST['phonelink']);
  $SQL = "INSERT INTO comments (name, comment, phonelink) VALUES ('$name', 
'$comment', '$phonelink')";

  mysql_query($SQL) or die("Unable to insert at this time. Sorry for the 
inconvience");
  //echo "Insert successful!";
header("Location: 
HTTP://jason.pruimphotography.com/dev/clients/flewid/Phone/");

  
  // Your code here to handle a successful verification
  }


?>


The insert happens, BUT it won't redirect back to the site  There isn't any 
reason I should be able to do a header() redirect at that point is there?

Or is there a better way to do it?

Thanks Everyone!


Jason Pruim
li...@pruimphotography.com




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with header();

2009-03-31 Thread Andrea Giammarchi

The output buffer on or off does not matter. If there is nothing sent, there is 
nothing sent.

If you have just a space, a new line, in one of included files and before


If that page generates an header you could have UTF-8 BOM problems, a prepended 
file in the Apache configuration which is broken/bugged/crap, or something 
truly bad in the configuration.

> Date: Tue, 31 Mar 2009 10:20:24 -0300
> From: titiolin...@gmail.com
> To: phps...@gmail.com
> CC: php-general@lists.php.net
> Subject: Re: [PHP] Problem with header();
> 
> I don't had the oportunity to test it yet, but today i will.
> 
> Today i will make two tests:
> 
> - Save the files without BOM.
> - If i dont have success i will disable the output buffering.
> 
> Thanks to everybody for all support.
> 
> Regards,
> Igor Escobar
> systems analyst & interface designer
> www . igorescobar . com
> 
> 
> 
> On Tue, Mar 31, 2009 at 12:39 AM, Phpster  wrote:
> 
> > Output buffering turned off?
> >
> > Bastien
> >
> > Sent from my iPod
> >
> >
> > On Mar 30, 2009, at 15:03, Igor Escobar  wrote:
> >
> >  Hi guys, probably everybody goes think:  "its the same problem ever"  HTML
> >> before header() functions ...  but it is not.
> >>
> >> I has working on a project and this are a running in "Windows" (shame on
> >> me).
> >> Recently i migrate to *Ubuntu *and some problems occurred and that
> >> specifically i can't understand WHY this rappening
> >>
> >> "Warning: Cannot modify *header* information - headers already sent by"
> >>
> >> On my web server on the internet it's OK
> >> On my local web server on my work it's OK
> >> On my loca web server on my notebook it's the problem.
> >>
> >> This error occurs only in my notebook (recently that I migrate to linux
> >> and
> >> it does not already).
> >>
> >> Please, someone have any idea what the fuck is happening?
> >>
> >> Regards,
> >> Igor Escobar
> >> systems analyst & interface designer
> >> www . igorescobar . com
> >>
> >

_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx

Re: [PHP] Problem with header();

2009-03-31 Thread Igor Escobar
I don't had the oportunity to test it yet, but today i will.

Today i will make two tests:

- Save the files without BOM.
- If i dont have success i will disable the output buffering.

Thanks to everybody for all support.

Regards,
Igor Escobar
systems analyst & interface designer
www . igorescobar . com



On Tue, Mar 31, 2009 at 12:39 AM, Phpster  wrote:

> Output buffering turned off?
>
> Bastien
>
> Sent from my iPod
>
>
> On Mar 30, 2009, at 15:03, Igor Escobar  wrote:
>
>  Hi guys, probably everybody goes think:  "its the same problem ever"  HTML
>> before header() functions ...  but it is not.
>>
>> I has working on a project and this are a running in "Windows" (shame on
>> me).
>> Recently i migrate to *Ubuntu *and some problems occurred and that
>> specifically i can't understand WHY this rappening
>>
>> "Warning: Cannot modify *header* information - headers already sent by"
>>
>> On my web server on the internet it's OK
>> On my local web server on my work it's OK
>> On my loca web server on my notebook it's the problem.
>>
>> This error occurs only in my notebook (recently that I migrate to linux
>> and
>> it does not already).
>>
>> Please, someone have any idea what the fuck is happening?
>>
>> Regards,
>> Igor Escobar
>> systems analyst & interface designer
>> www . igorescobar . com
>>
>


Re: [PHP] Problem with header();

2009-03-30 Thread Phpster

Output buffering turned off?

Bastien

Sent from my iPod

On Mar 30, 2009, at 15:03, Igor Escobar  wrote:

Hi guys, probably everybody goes think:  "its the same problem  
ever"  HTML

before header() functions ...  but it is not.

I has working on a project and this are a running in  
"Windows" (shame on

me).
Recently i migrate to *Ubuntu *and some problems occurred and that
specifically i can't understand WHY this rappening

"Warning: Cannot modify *header* information - headers already sent  
by"


On my web server on the internet it's OK
On my local web server on my work it's OK
On my loca web server on my notebook it's the problem.

This error occurs only in my notebook (recently that I migrate to  
linux and

it does not already).

Please, someone have any idea what the fuck is happening?

Regards,
Igor Escobar
systems analyst & interface designer
www . igorescobar . com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header();

2009-03-30 Thread Stuart
2009/3/30 Igor Escobar :
> Hi guys, probably everybody goes think:  "its the same problem ever"  HTML
> before header() functions ...  but it is not.
>
> I has working on a project and this are a running in "Windows" (shame on
> me).
> Recently i migrate to *Ubuntu *and some problems occurred and that
> specifically i can't understand WHY this rappening
>
> "Warning: Cannot modify *header* information - headers already sent by"
>
> On my web server on the internet it's OK
> On my local web server on my work it's OK
> On my loca web server on my notebook it's the problem.

Chances are good that php.ini on your notebook has output buffers
switched off. Google it if you don't know what they are.

> This error occurs only in my notebook (recently that I migrate to linux and
> it does not already).
>
> Please, someone have any idea what the  is happening?

Please refrain from using language like that on this list. It's
unnecessary inappropriate.

-Stuart

-- 
http://stut.net/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with header();

2009-03-30 Thread Igor Escobar
Hi guys, probably everybody goes think:  "its the same problem ever"  HTML
before header() functions ...  but it is not.

I has working on a project and this are a running in "Windows" (shame on
me).
Recently i migrate to *Ubuntu *and some problems occurred and that
specifically i can't understand WHY this rappening

"Warning: Cannot modify *header* information - headers already sent by"

On my web server on the internet it's OK
On my local web server on my work it's OK
On my loca web server on my notebook it's the problem.

This error occurs only in my notebook (recently that I migrate to linux and
it does not already).

Please, someone have any idea what the fuck is happening?

Regards,
Igor Escobar
systems analyst & interface designer
www . igorescobar . com


Re: [PHP] Problem with header in an if

2005-03-26 Thread Burhan Khalid
Jay Blanchard wrote:
[snip]
/* send the errors to the interface and exit*/
if('' !== $errorsReported){
for($i = 0; $i < count($errorsReported); $i++){
echo $errorsReported[$i];
}
unset($errorsReported);
print_r($errorsReported);
} else {
/* reload the empty interface */

a quick echo statement here to check that this block is running when
you expect it to might tell you something... but you have probably
already plastered your code with echo/print statements to determine the
flow :-)
[/snip]
Well, the array still appears, it is empty  and unset (see modified code
above) does not get rid of it. Here is how it comes back 
Array ( [0] => [1] => [2] => [3] => ) 
Well maybe its just me, but you are comparing an array with a string if 
('' !== $errorsReported), which doesn't make any sense. Try this instead:

if (is_array($errorsReported))
{
   echo implode("",$errorsReported);
} else {
   header();
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem with header in an if SOLVED

2005-03-25 Thread Jochem Maas
Jay Blanchard wrote:
[snip]
/* check for errors */
$arrCheckItems = array(	
	'Name',
	'Dept',
	'Level',
);
/* check for blanks */
foreach($_POST AS $key=>$value){
	if(in_array(niceName($key), $arrCheckItems)){
	 	$errorsReported[] = notBlank($key, $value);
	} 
}

Even if the return from notBlank is nothing, $errorReported[] gets set
for each item passed in the foreach loop. I have tried using conditional
returns in the function, but to no avail. Perhaps my logic is screwed on
this.
[/snip]
I changed to  the following code and it solves the problem ...
foreach($_POST AS $key=>$value){
	if(in_array(niceName($key), $arrCheckItems)){
	 	$nbr = notBlank($key, $value);
		if(!('' == $nbr)){
			$errorsReported[] = $nbr;
		}
	} 
}


// one less if :-)...
foreach($_POST AS $key=>$value){
if(in_array(niceName($key), $arrCheckItems) && !('' == ($nbr = 
notBlank($key, $value {
// error to report.
$errorsReported[] = $nbr;
}
}
// ...also array_filter() with only 1 arg (array) is handy for remove empty vals
$errorsReported = array();
foreach($_POST AS $k => $v){
if(in_array(niceName($k), $arrCheckItems)) {
$errorsReported[] = notBlank($k, $v);
}
}
if (count($errorsReported = array_filter($errorsReported))) {
// error msgs to report!
}
?>
quote from manual:
"If the callback function is not supplied, array_filter() will remove
all the entries of input that are equal to FALSE. See converting to
boolean for more information."
I do like array filter - also very handy in conjunction with create_function() 
:-)
rgds,
jochem
Before I was directly assigning the value of the return from the
notBlank function to $errorsReported. Now something only gets assigned
to $errorsReported if there is something to assign. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Problem with header in an if SOLVED

2005-03-25 Thread Jay Blanchard
[snip]
/* check for errors */
$arrCheckItems = array( 
'Name',
'Dept',
'Level',
);
/* check for blanks */
foreach($_POST AS $key=>$value){
if(in_array(niceName($key), $arrCheckItems)){
$errorsReported[] = notBlank($key, $value);
} 
}

Even if the return from notBlank is nothing, $errorReported[] gets set
for each item passed in the foreach loop. I have tried using conditional
returns in the function, but to no avail. Perhaps my logic is screwed on
this.
[/snip]

I changed to  the following code and it solves the problem ...

foreach($_POST AS $key=>$value){
if(in_array(niceName($key), $arrCheckItems)){
$nbr = notBlank($key, $value);
if(!('' == $nbr)){
$errorsReported[] = $nbr;
}
} 
}

Before I was directly assigning the value of the return from the
notBlank function to $errorsReported. Now something only gets assigned
to $errorsReported if there is something to assign. 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with header in an if

2005-03-25 Thread Jay Blanchard
[snip]
>   /* send the errors to the interface and exit*/
>   if('' !== $errorsReported){
>   for($i = 0; $i < count($errorsReported); $i++){
>   echo $errorsReported[$i];
>   }
unset($errorsReported);
print_r($errorsReported);
>   } else {
>   /* reload the empty interface */


Well, the array still appears, it is empty  and unset (see modified code
above) does not get rid of it. Here is how it comes back 
Array ( [0] => [1] => [2] => [3] => ) 
[/snip]

The $errorsReported array does not test as 'empty', it only has no
values. There are 4 keys set, so what I have to do is figure out how to
not set them.

/* check for errors */
$arrCheckItems = array( 
'Name',
'Dept',
'Level',
);
/* check for blanks */
foreach($_POST AS $key=>$value){
if(in_array(niceName($key), $arrCheckItems)){
$errorsReported[] = notBlank($key, $value);
} 
}

Even if the return from notBlank is nothing, $errorReported[] gets set
for each item passed in the foreach loop. I have tried using conditional
returns in the function, but to no avail. Perhaps my logic is screwed on
this.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with header in an if

2005-03-25 Thread Jay Blanchard
[snip]
>   /* send the errors to the interface and exit*/
>   if('' !== $errorsReported){
>   for($i = 0; $i < count($errorsReported); $i++){
>   echo $errorsReported[$i];
>   }
unset($errorsReported);
print_r($errorsReported);
>   } else {
>   /* reload the empty interface */

a quick echo statement here to check that this block is running when
you expect it to might tell you something... but you have probably
already plastered your code with echo/print statements to determine the
flow :-)
[/snip]

Well, the array still appears, it is empty  and unset (see modified code
above) does not get rid of it. Here is how it comes back 
Array ( [0] => [1] => [2] => [3] => ) 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header in an if

2005-03-24 Thread Jochem Maas
Jay Blanchard wrote:
/* send the errors to the interface and exit*/
if('' !== $errorsReported){
for($i = 0; $i < count($errorsReported); $i++){
echo $errorsReported[$i];
}
} else {
/* reload the empty interface */
a quick echo statement here to check that this block is running when
you expect it to might tell you something... but you have probably
already plastered your code with echo/print statements to determine the
flow :-)
header("Location: adminTicketMgmtCreationForm.php");
}
The above does not work on the else statement. If $errorsReported is
blank the header statement does not work, the script just exits. I have
had a long day and I may not be seeing something correctly, can anyone
see an error with this? If so, can you tell me where I am going wrong?
having read the other replies to this post I'm a little perplexed...
I was wondering if adminTicketMgmtCreationForm.php isn't crashing?
I sometimes get into a situation where an include file has a syntax
error that causes complete failure (blank screen, nothing in log), I have
had the same on occasion with require_once() statements that fail
so maybe the redirect is working only the destination page is silently dying
on you
I assume that you are not outputting anything before the call to header.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Problem with header in an if

2005-03-24 Thread Chris W. Parker
Jay Blanchard 
on Thursday, March 24, 2005 1:00 PM said:

> I have tried ...
> 0 < count($errorsReported)
> 0 !=
> 0 !==
> isset($errorReported)
> !empty
> '' !=
> '' !==

Have you tried explicitly setting $errorsReported to "" to see where it
goes?

$errorsReported = "";

if(!empty($errorsReported))
{
  // do loop
}
else
{
  // do redirect
}

Also, are you sure your program is even GETTING that far? Maybe the
program is stopping before the point in question.

> And Chris, thanks for the heads up, I put the exit() and the FQDN in
> there.

In that case may I suggest the following function:

function redirect($location)
{
header("Location: ".FQDN_CONSTANT."$location");
exit;
}

Makes things easier down the road.



Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Problem with header in an if

2005-03-24 Thread Jay Blanchard
[snip]
> /* send the errors to the interface and exit*/
> if('' !== $errorsReported){
>  for($i = 0; $i <
count($errorsReported); $i++){
>   echo
$errorsReported[$i];
>  }
> } else {
> /* reload the empty interface */
>  header("Location:
adminTicketMgmtCreationForm.php");
> } 

[/snip]

I have tried ...
0 < count($errorsReported)
0 !=
0 !==
isset($errorReported)
!empty
'' !=
'' !==

I tried reversing the order in the statement itself, no go.
And Chris, thanks for the heads up, I put the exit() and the FQDN in
there. 

I am headed out for the afternoon, perhaps a clearer head will prevail
in the morning!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header in an if

2005-03-24 Thread dpgirago
>/* send the errors to the interface and exit*/
>if('' !== $errorsReported){
>for($i = 0; $i < count($errorsReported); 
$i++){
>echo $errorsReported[$i];
>}
>} else {
>/* reload the empty interface */
>header("Location: 
adminTicketMgmtCreationForm.php");
>}

Jay,

Maybe try...

if(!empty($errorsReported)) {

instead of...

if('' !== $errorsReported){


David

RE: [PHP] Problem with header in an if

2005-03-24 Thread Chris W. Parker
Jay Blanchard 
on Thursday, March 24, 2005 12:34 PM said:

I don't know if either of these two things will make a difference but
here they are anyway.

>   /* send the errors to the interface and exit*/
>   if('' !== $errorsReported){

Why not if(!empty($errorsReported))?

>   } else {
>   /* reload the empty interface */
>   header("Location: adminTicketMgmtCreationForm.php");
>   }

Also the Location header should(?) receive a FQDN (although I know it
works sans FQDN) and I think I read in the manual or somewhere that you
should put an exit; after it.


.02

Chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with header in an if

2005-03-24 Thread Jay Blanchard
/* send the errors to the interface and exit*/
if('' !== $errorsReported){
for($i = 0; $i < count($errorsReported); $i++){
echo $errorsReported[$i];
}
} else {
/* reload the empty interface */
header("Location: adminTicketMgmtCreationForm.php");
}
The above does not work on the else statement. If $errorsReported is
blank the header statement does not work, the script just exits. I have
had a long day and I may not be seeing something correctly, can anyone
see an error with this? If so, can you tell me where I am going wrong?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header-dispotition in IE

2004-09-21 Thread Marek Kilimajer
adwinwijaya wrote:
The error that I got just IE cannot download download.php from
mysite.com .. IE was not able to open this site and bla bla bla. No
hint in the error.
I think the problem that I faced is with SSL.
I try http://www.wazzup.co.nz/tutorials/protect_pdf/index.php
and it didnt work on my web
Why IE cannot work with SSL mode to download file ?
Is there any solution ?
Are you using session? Then you need to use
session_cache_limiter('private_no_expire');
before starting the session.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] problem with header-dispotition in IE

2004-09-20 Thread Brad Pauly
On Mon, 20 Sep 2004 10:58:46 +0200, Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> 
> I suppose you are trying to force IE to download the pdf file, but it is
> always displaying it - you did not tell what is your problem.
> 
> IE determines the type of file from the extension, if it is a known
> extension it ignores the content-type header. You might want to try
> adding space char after the filename, I've heard it works.

Apparently IE sometimes makes multiple requests for a URI and this can
cause problems with large PDF files.

http://support.microsoft.com/default.aspx?scid=kb;en-us;293792

- Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] problem with header-dispotition in IE

2004-09-20 Thread adwinwijaya
Hello Marek,

Monday, September 20, 2004, 6:58:46 PM, you wrote:

MK> adwinwijaya wrote:
>> Hi all ...
>> 
>> 
>> I have script that looks like :
>> 
>> if(file_exists($filename)){
>>   $len = filesize($filename);
>>   //header("Content-type: attachment/pdf");
>>   header('Content-Type: application/pdf');
>>   //header("Content-Type: application/octet-stream");
>>   header("Content-Type: application/force-download");
>>   header("Content-Length: $len");
>>   
>>if(preg_match("/MSIE/", $_SERVER["HTTP_USER_AGENT"])){
>> header("Content-Disposition:
>> attachment; filename=".$name.".pdf","pdf");
>>}else
>>{
>> header("Content-Disposition:
>> attachment; filename=".$name.".pdf","pdf");
>>}  
>>   
>>   //header("Content-Disposition: attachment;
>> filename=personal_inventory_forms.pdf");
>>   readfile($filename);
>> } else
>> {   
>> echo $filename ; 
>> echo ' ERROR :  file is not exist' ;
>> }
>> 
>> This script works very well on Mozilla, Opera and Safari..but doesnt
>> work with IE. can someone help me to solve this problem ?

MK> I suppose you are trying to force IE to download the pdf file, but it is
MK> always displaying it - you did not tell what is your problem.

MK> IE determines the type of file from the extension, if it is a known
MK> extension it ignores the content-type header. You might want to try
MK> adding space char after the filename, I've heard it works.

MK> PS: Second param to header should be bool


The error that I got just IE cannot download download.php from
mysite.com .. IE was not able to open this site and bla bla bla. No
hint in the error.

I think the problem that I faced is with SSL.
I try http://www.wazzup.co.nz/tutorials/protect_pdf/index.php
and it didnt work on my web

Why IE cannot work with SSL mode to download file ?
Is there any solution ?

-- 
Best regards,
adwin
www.kuya-kuya.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header-dispotition in IE

2004-09-20 Thread Marek Kilimajer
adwinwijaya wrote:
Hi all ...
I have script that looks like :
if(file_exists($filename)){
  $len = filesize($filename);
  //header("Content-type: attachment/pdf");
  header('Content-Type: application/pdf');
  //header("Content-Type: application/octet-stream");
  header("Content-Type: application/force-download");
  header("Content-Length: $len");
  
   if(preg_match("/MSIE/", $_SERVER["HTTP_USER_AGENT"])){
header("Content-Disposition: attachment; filename=".$name.".pdf","pdf");
   }else
   {
header("Content-Disposition: attachment; filename=".$name.".pdf","pdf");
   }  
  
  //header("Content-Disposition: attachment; filename=personal_inventory_forms.pdf");
  readfile($filename);
} else
{   
echo $filename ; 
echo ' ERROR :  file is not exist' ;
}

This script works very well on Mozilla, Opera and Safari..but doesnt
work with IE. can someone help me to solve this problem ?
I suppose you are trying to force IE to download the pdf file, but it is 
always displaying it - you did not tell what is your problem.

IE determines the type of file from the extension, if it is a known 
extension it ignores the content-type header. You might want to try 
adding space char after the filename, I've heard it works.

PS: Second param to header should be bool
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] problem with header-dispotition in IE

2004-09-20 Thread adwinwijaya
Hi all ...


I have script that looks like :

if(file_exists($filename)){
  $len = filesize($filename);
  //header("Content-type: attachment/pdf");
  header('Content-Type: application/pdf');
  //header("Content-Type: application/octet-stream");
  header("Content-Type: application/force-download");
  header("Content-Length: $len");
  
   if(preg_match("/MSIE/", $_SERVER["HTTP_USER_AGENT"])){
header("Content-Disposition: attachment; 
filename=".$name.".pdf","pdf");
   }else
   {
header("Content-Disposition: attachment; 
filename=".$name.".pdf","pdf");
   }  
  
  //header("Content-Disposition: attachment; 
filename=personal_inventory_forms.pdf");
  readfile($filename);
} else
{   
echo $filename ; 
echo ' ERROR :  file is not exist' ;
}

This script works very well on Mozilla, Opera and Safari..but doesnt
work with IE. can someone help me to solve this problem ?

thx


-- 
Best regards,
adwin
www.kuya-kuya.net
"There is a story living in us that speaks of our 
place in the world. 
It is a story that invites us to love what we love 
and simply be ourselves."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with Header("Location: home.php");

2004-09-10 Thread Chris Shiflett
--- CBharadwaj <[EMAIL PROTECTED]> wrote:
> In conection.php I have written.
> SESSION_ START();
> 
> on successful login I am registering a session variable.
> SESSION_REGISTER("userId");


Do this instead:

session_start();
$_SESSION['userid'] = 'myuser';

>  Header("Location: home.php");

Use an absolute URL:

header('Location: http://example.org/home.php');

> Warning: Cannot modify header information - headers already sent by 
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
>  in E:\PHPMySql scripts\bugtrack\index.php on line 117

This call to header() on line 117 of index.php generates an error, because
line 3 of connection.php generated output. Calls to header() must come
prior to output. You can either rearrange your code or use output
buffering:

http://www.php.net/ob_start

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header("Location:home.php")

2004-09-09 Thread Alex Hogan
> Warning: Cannot modify header information - headers already sent by
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
> in E:\PHPMySql scripts\bugtrack\index.php on line 117
> 
> the connection file I have included in every page.
> why this error is occuring?

You are getting this error because you have header output starting at
line 3 in file connection.php.

The warning is stating that the function, 'header("location:
home.php");' cannot fire because you have started outputing header
information.

Your header() call is on line 117 of index.php.

Header() can only be used if there has been no header information sent
to the page.

You will need to see what is on line 3 and probably line 2 of connection.php.



alex hogan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header("Location:home.php")

2004-09-09 Thread Pablo M. Rivas
look the line 3 of connection.php
Good luck


On Wed, 8 Sep 2004 16:43:54 -0700, CBharadwaj
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> In conection.php I have written.
>SESSION_ START();
> 
> on successful login I am registering a session variable.
>SESSION_REGISTER("userId");
> 
> on login failure  I am redirecting to home page.
> Header("Location: home.php");
> 
> the following error occuring in above line.
> Warning: Cannot modify header information - headers already sent by
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
> in E:\PHPMySql scripts\bugtrack\index.php on line 117
> 
> the connection file I have included in every page.
> why this error is occuring?
> 
> Bharadwaj
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header("Location:home.php")

2004-09-09 Thread Matt M.
> the connection file I have included in every page.
> why this error is occuring?

check E:\PHPMySql scripts\bugtrack\connection.php for white space
before or after 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with Header("Location: home.php");

2004-09-09 Thread Andre Dubuc
On Thursday 12 August 2004 07:48 pm, CBharadwaj wrote:
> Hello,
>
> In conection.php I have written.
> SESSION_ START();
   ^

Get rid of extra space and it should work
Hth,
Andre


> on successful login I am registering a session variable.
> SESSION_REGISTER("userId");
>
> on login failure  I am redirecting to home page.
>  Header("Location: home.php");
>
>
> the following error occuring in above line.
> Warning: Cannot modify header information - headers already sent by
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
>  in E:\PHPMySql scripts\bugtrack\index.php on line 117
>
> the connection file I have included in every page.
> why this error is occuring?
>
>
> Bharadwaj

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with Header("Location: home.php");

2004-09-09 Thread Paul Waring
> the following error occuring in above line.
> Warning: Cannot modify header information - headers already sent by
> (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
>  in E:\PHPMySql scripts\bugtrack\index.php on line 117

Have you got any space before you output anything to the browser? I've
found that often I've saved a file with a newline at the end by
accident - meaning that PHP thinks I'm ready to start sending output
and therefore any functions that modify the headers won't work because
they've already been sent.

Check connection.php around line 3 to see if there is anything sending
output before you call session_* or Header().

BTW, you shouldn't use relative URIs in Location: headers, try using:

header('Location: http://www.mydomain.com/path/to/home.php');

instead (this won't fix anything, but it's the correct way to do it
according to the HTTP/1.1 standard).

Hope this helps,

Paul

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem with Header("Location: home.php");

2004-09-09 Thread CBharadwaj
Hello,

In conection.php I have written.
SESSION_ START();

on successful login I am registering a session variable.
SESSION_REGISTER("userId"); 

on login failure  I am redirecting to home page.
 Header("Location: home.php");


the following error occuring in above line.
Warning: Cannot modify header information - headers already sent by 
(output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
 in E:\PHPMySql scripts\bugtrack\index.php on line 117

the connection file I have included in every page.
why this error is occuring?


Bharadwaj

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem with header("Location:home.php")

2004-09-09 Thread CBharadwaj
Hello,

In conection.php I have written.
SESSION_ START();

on successful login I am registering a session variable.
SESSION_REGISTER("userId"); 

on login failure  I am redirecting to home page.
 Header("Location: home.php");


the following error occuring in above line.
Warning: Cannot modify header information - headers already sent by 
(output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
 in E:\PHPMySql scripts\bugtrack\index.php on line 117

the connection file I have included in every page.
why this error is occuring?


Bharadwaj

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Problem with header

2004-03-25 Thread Tom Rogers
Hi,

Friday, March 26, 2004, 2:36:18 PM, you wrote:

pen> On 25 Mar 2004 at 14:10, Tom Rogers wrote:
 >> 
>> Any whitespace in any file before the > to the browser forcing the headers to be sent. So make sure the first
>> line of your page has  from
>> included pages as there may be blank lines following which are just as
>> bad. So the rule is, header() can go anywhere but before any output to
>> the browser.
>> 
pen> and also


>> One other little rule: get into the habit of putting the full url in
>> location, it will save you grief down the line :)
>> 
>> To redirect to the same page for example
>> 
>> $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF";];
>> header("Location: $url");
>> 
pen> Thanks, Tom! That did the trick. I began the file with the  appears that for a web page that has a lot of ordinary HTML on it,
pen> the PHP must begin BEFORE even the Doc Type line. 

pen> I have a question about just how the PHP headers work; I have looked
pen> around in the PHP manual, but I am still not quite clear on this.

pen> I want to follow this logic when the user fills out the guestbook and
pen> clicks on the "submit" button. Is the following the general idea? (I
pen> have not tried to use the proper syntax, just want to know if the
pen> general logic is sound):

pen> if $submit //if the user has clicked the submit button
pen> then 
pen> check that the form is filled out correctly // validation routine
pen> if $notvalid then header("Location: $badform");
pen> else 
pen> check the URL's// make sure spammers are not trying to co-opt script
pen> if $urlfail then header("Location: $urlfail");
pen> else
pen> send the mail, redirect to thank you page // 
pen> header("Location: $url");

pen> $url = "http://www.whatever.com/thanks.shtml";;
pen> $urlfail ="http://www.whatever.com/warning.shtml";;
pen> $urlbadform="http://www.whatever.com/error.shtml";;

pen> Is that the way to use multiple headers for conditional statements?

pen> TIA --- Phil Matt

Yes that logic should work fine, and it will also stop the refresh
warning from the browser and help prevent multiple submissions.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header

2004-03-24 Thread Chris Shiflett
--- Phil Matt <[EMAIL PROTECTED]> wrote:
> header("Location:thanks.shtml");

Two errors here:

1. There is a space after the colon.
2. The URL must be an absolute URL.

> But no matter where I place it in the PHP file, I get the error
> message that says "Headers already sent..."

Read this message. It tells you exactly what is wrong and where.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming Fall 2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re[2]: [PHP] Problem with header

2004-03-24 Thread Tom Rogers
Hi,

TR> Any whitespace in any file before the  to the browser forcing the headers to be sent. So make sure the first
TR> line of your page has  from
TR> included pages as there may be blank lines following which are just as
TR> bad. So the rule is, header() can go anywhere but before any output to
TR> the browser.

TR> -- 
TR> regards,
TR> Tom

One other little rule: get into the habit of putting the full url in
location, it will save you grief down the line :)

To redirect to the same page for example

$url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF";];
header("Location: $url");


-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem with header

2004-03-24 Thread Tom Rogers
Hi,

Thursday, March 25, 2004, 9:17:31 AM, you wrote:
PM> Hello to all - just joined this list to see if I can enhance
PM> my pretty slim knowledge of PHP.

PM> I have a little script I cobbled together than I modified to use as a guestbook 
for a
PM> client's site. I am trying to get the script to call a
PM> "success" page if the mail in fact gets 
PM> sent. I plan to also add a "failure" page if the validation
PM> routine (haven't added this yet) 
PM> doesn't work.

PM> I have been experimenting with the statement

PM> header("Location:thanks.shtml");

PM> But no matter where I place it in the PHP file, I get the error message that says
PM> "Headers already sent..."

PM> To wit:
PM>  include ("/file with passwords and user id's in it"); 
PM> //a bunch of stuff to pull email recipient's address and id out of MySQL db
PM> //works fine
PM> //$enjoy, $visit, $test vars pulled from form that follows the script, no probs 
there
PM> $recipient=$to_name;
PM> $message=$enjoy.$visit.$text;
PM> $params['sendmail_path'] = '/usr/sbin/sendmail';
PM> if ($submit){
PM> mail($recipient, $subject, $message,
PM> "From:\"$from_name\"<$from_email>\r\n" .
PM> "Reply-to: $from_email\r\n" .   
PM> "X-Mailer: PHP/" . phpversion());
PM>}
?>>

PM> So where in the world does the

PM> header("Location:thanks.shtml");

PM> statement go? And if I do an if/else thing on submit, where does the other 
statement go?

PM> header("Location:error.shtml");

PM> TIA for any advice you can offer. I must be really missing the point here.

PM> Cheers --- Phil Matt


Any whitespace in any file before the  from
included pages as there may be blank lines following which are just as
bad. So the rule is, header() can go anywhere but before any output to
the browser.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem with header

2004-03-24 Thread Phil Matt
Hello to all - just joined this list to see if I can enhance my pretty slim knowledge 
of PHP.

I have a little script I cobbled together than I modified to use as a guestbook for a 
client's site. I am trying to get the script to call a "success" page if the mail in 
fact gets 
sent. I plan to also add a "failure" page if the validation routine (haven't added 
this yet) 
doesn't work.

I have been experimenting with the statement

header("Location:thanks.shtml");

But no matter where I place it in the PHP file, I get the error message that says 
"Headers already sent..."

To wit:
\r\n" .
"Reply-to: $from_email\r\n" .   
"X-Mailer: PHP/" . phpversion());
   }
?>

So where in the world does the

header("Location:thanks.shtml");

statement go? And if I do an if/else thing on submit, where does the other statement 
go? 

header("Location:error.shtml");

TIA for any advice you can offer. I must be really missing the point here.

Cheers --- Phil Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] problem with header

2003-01-30 Thread Chris Hayes

can it be related to the double slash in that path?
/usr/local/php/bin//php

At 15:42 30-1-2003, you wrote:

i have an script, it send a header response:






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] problem with header

2003-01-30 Thread Martin
i have an script, it send a header response:

http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Problem with header redirect with register_globals off

2002-11-12 Thread David Russell
Could you post some code?

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com

-Original Message-
From: pig pig [mailto:pigpig8080@;yahoo.com.sg] 
Sent: 12 November 2002 03:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem with header redirect with register_globals off


Hi All,

I am having problem with redirecting using header
function with register_globals off.  It works fine on
my PC but not on the site as the register_globals is
off on the server.  When redirecting on the server it
gave an CGI error:

CGI Error
The specified CGI application misbehaved by not
returning a complete set of HTTP headers. The headers
it did return are:


I am using session to pass some variables to the
target page, could this cause the problem?
Is there a work around for this problem?

Thanks in advance.

CK Ong

__
Do You Yahoo!?
Great flight deals, travel info and prizes! http://sg.travel.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




smime.p7s
Description: application/pkcs7-signature


Re: [PHP] Problem with header redirect with register_globals off

2002-11-12 Thread Marco Tabini
Can you post some code?


Marco
-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers
Check us out on the web at http://www.phparch.com


On Tue, 2002-11-12 at 08:52, pig pig wrote:
> Hi All,
> 
> I am having problem with redirecting using header
> function with register_globals off.  It works fine on
> my PC but not on the site as the register_globals is
> off on the server.  When redirecting on the server it
> gave an CGI error:
> 
> CGI Error
> The specified CGI application misbehaved by not
> returning a complete set of HTTP headers. The headers
> it did return are:
> 
> 
> I am using session to pass some variables to the
> target page, could this cause the problem?
> Is there a work around for this problem?
> 
> Thanks in advance.
> 
> CK Ong
> 
> __
> Do You Yahoo!?
> Great flight deals, travel info and prizes!
> http://sg.travel.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with header redirect with register_globals off

2002-11-12 Thread pig pig
Hi All,

I am having problem with redirecting using header
function with register_globals off.  It works fine on
my PC but not on the site as the register_globals is
off on the server.  When redirecting on the server it
gave an CGI error:

CGI Error
The specified CGI application misbehaved by not
returning a complete set of HTTP headers. The headers
it did return are:


I am using session to pass some variables to the
target page, could this cause the problem?
Is there a work around for this problem?

Thanks in advance.

CK Ong

__
Do You Yahoo!?
Great flight deals, travel info and prizes!
http://sg.travel.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with Header!

2001-11-16 Thread Andre Lacour

I want to sent a script-result as a renamed html-document to the client.
I tried:

- header("Content-Disposition: inside; filename=name.html");

- header("Content-Disposition: inside; filename=\"name.html\"");

- header("Content-Disposition: inside;");
  header("Content-filename=name.html");

even with a content-type: text/html...
but it doesn't work.

inside replaced by something other like attachement or inline does not work,
either!

someone an idea?
thx






-- 
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] Problem with header()

2001-09-06 Thread Stonix

Hi,

Can anyone tell me why header cannot been used after any network
operation?

In my script, there are following steps:

1).a socket is opened for smtp; 
2).send email;
3).closed the socket; 
4).use header() to redirect to another page. 

If no 1), 2) and 3), 4) can be processed without any problem. But if 
socket steps added, system will send warning message: Cannot add 
header information - headers already sent by ( output started at.)

So, it seems like fsockopen will cause a header to be sent and other 
header cannot been sent after that within same scritp even though
the socket is closed. Now my question is how can the second header
been sent?

Alex




-- 
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] Problem with header()

2001-09-04 Thread Alex Shi

Hi,

Can anyone tell me why header() cannot been used after any network
operation?

In my script, there are following steps:

1).a socket is opened for smtp; 
2).send email;
3).closed the socket; 
4).use header() to redirect to another page. 

If no 1), 2) and 3), 4) can be processed without any problem. But if 
socket steps added, system will send warning message: Cannot add 
header information - headers already sent by ( output started at.)

So, it seems like fsockopen will cause a header to be sent and other 
header cannot been sent after that within same scritp even though
the socket is closed. Now my question is how can the second header
been sent?

Alex



-- 
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] problem with header()

2001-06-28 Thread Sheni R. Meledath

Hello:

I am having a problem using the header() function. I am using this function 
in a script that is used to download files.
When used, I am getting a blank page with some junk characters and 
some  html code, that I haven't created. And in the location its showing 
the correct url.

Details:

Function used in the script:
header("Location: http://www.test.com/pdf/test.pdf";);

The page I got after executing the script is a blank page with the 
following source code (junk characters in their respective html code).
###
ÿp
http://www.test.com/pdf/download.php3>
###

The embed src is the name of the script file. But in the location field its 
showing the pdf url. This happened in some version of IE browser.

Please help me to solve this issue.

Many Thanks


Sheni R Meledath
[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]




[PHP] problem with header()

2001-06-27 Thread Sheni R. Meledath

Hello:

Thank God. The mailing list is back and many thanks to the PHP Owners.

I am having a problem using the header() function. I am using this function 
in a script that is used to download files.
When used, I am getting a blank page with some junk characters and 
some  html code, that I haven't created. And in the location its showing 
the correct url.

Details:

Function used in the script:
header("Location: http://www.test.com/pdf/test.pdf";);

The page I got after executing the script is a blank page with the 
following source code (junk characters in their respective html code).
###
ÿp
http://www.test.com/pdf/download.php3>
###

The embed src is the name of the script file. But in the location field its 
showing the pdf url. This happened in IE browser.

Please help me to solve this issue.

Many Thanks


Sheni R Meledath
[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]