Re: [PHP] Re: header modify errors

2008-12-15 Thread Jim Lucas
Jay Moore wrote:
 Terion Miller wrote:
 I am working from home today and getting this error with my copy of my
 project:
 *Warning*: Cannot modify header information - headers already sent by
 (output started at
 C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
 in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php* on
 line *3*

 *Warning*: Cannot modify header information - headers already sent by
 (output started at
 C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
 in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php* on
 line *4*
 Could not connect to the database.

 I have set my php.ini file output_buffering to ON it was off (read in
 a past
 post that will fix this error--but it did not)
 I also set session.cache_limiter =  to nothing it was set to nocache

 Any other things I'm missing?
 Thanks
 Terion

 
 What's on/around line 31 in Welcome.php?
 
 J
 

Jay.  I agree with your thought process.  Why not fix the warning instead of 
hiding it.

But that isn't what the OP is asking for.

I think the OP understands why it is giving this warning, but is looking for a 
way to not display the error.

Sounds like his production environment is setup to where it does not display 
the warning.  So, he wants his newly installed test machine to match what
the production is doing.

Correct me if I'm wrong Terion.


-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Re: header modify errors

2008-12-15 Thread Terion Miller
On Mon, Dec 15, 2008 at 11:37 AM, Jim Lucas li...@cmsws.com wrote:

 Jay Moore wrote:
  Terion Miller wrote:
  I am working from home today and getting this error with my copy of my
  project:
  *Warning*: Cannot modify header information - headers already sent by
  (output started at
  C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
  in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
 on
  line *3*
 
  *Warning*: Cannot modify header information - headers already sent by
  (output started at
  C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
  in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
 on
  line *4*
  Could not connect to the database.
 
  I have set my php.ini file output_buffering to ON it was off (read in
  a past
  post that will fix this error--but it did not)
  I also set session.cache_limiter =  to nothing it was set to nocache
 
  Any other things I'm missing?
  Thanks
  Terion
 
 
  What's on/around line 31 in Welcome.php?
 
  J
 

 Jay.  I agree with your thought process.  Why not fix the warning instead
 of hiding it.

 But that isn't what the OP is asking for.

 I think the OP understands why it is giving this warning, but is looking
 for a way to not display the error.

 Sounds like his production environment is setup to where it does not
 display the warning.  So, he wants his newly installed test machine to match
 what
 the production is doing.

 Correct me if I'm wrong Terion.


 --
 Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

 Twelfth Night, Act II, Scene V
by William Shakespeare

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

 Well If there is a problem with the script and that is why its giving the
warning I would want to fix that, I just figured the php.ini file on the
live server at the office is different from the one i have on my home xampp
install and I am not allowed access to the php.ini on the server at work, I
just tried getting it to compare it to my own.  I have to go check to see
about the .htaccess file, I need to read up on these, like what is the
difference and if you have one do you need the other?  .htaccess is for
directory control yes? If that is the case there is none in the directory I
have this project in.

I just stopped and restarted my xampp and that didn't work either...should I
make a .htaccess file for this directory to over ride whatever setting is
preventing the headers from loading?
Thanks guys
Terion


Re: [PHP] Re: header modify errors

2008-12-15 Thread VamVan
Hey,

Few things:

1) Check to see if you have any trailing spaces after the end of the file.
2) Check to see if your session_start() is not the first line of the code.


Thanks,
V

On Mon, Dec 15, 2008 at 9:36 AM, Terion Miller webdev.ter...@gmail.comwrote:

 On Mon, Dec 15, 2008 at 11:29 AM, Jay Moore jaymo...@accu-com.com wrote:

  Terion Miller wrote:
 
  I am working from home today and getting this error with my copy of my
  project:
  *Warning*: Cannot modify header information - headers already sent by
  (output started at
  C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
  in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
 on
  line *3*
 
  *Warning*: Cannot modify header information - headers already sent by
  (output started at
  C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
  in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php*
 on
  line *4*
  Could not connect to the database.
 
  I have set my php.ini file output_buffering to ON it was off (read in a
  past
  post that will fix this error--but it did not)
  I also set session.cache_limiter =  to nothing it was set to nocache
 
  Any other things I'm missing?
  Thanks
  Terion
 
 
  What's on/around line 31 in Welcome.php?
 
  J

 Line 32-36 are:
 ?php
If (!empty($msg)){
echo div class=\Error\. $msg ./divBRBR;
}
 ?


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



Re: [PHP] Re: header modify errors

2008-12-15 Thread Terion Miller
On Mon, Dec 15, 2008 at 11:29 AM, Jay Moore jaymo...@accu-com.com wrote:

 Terion Miller wrote:

 I am working from home today and getting this error with my copy of my
 project:
 *Warning*: Cannot modify header information - headers already sent by
 (output started at
 C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
 in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php* on
 line *3*

 *Warning*: Cannot modify header information - headers already sent by
 (output started at
 C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\Welcome.php:31)
 in *C:\Inetpub\Xampp\htdocs\SNLeader\WOSystem\inc\dbconn_openTest.php* on
 line *4*
 Could not connect to the database.

 I have set my php.ini file output_buffering to ON it was off (read in a
 past
 post that will fix this error--but it did not)
 I also set session.cache_limiter =  to nothing it was set to nocache

 Any other things I'm missing?
 Thanks
 Terion


 What's on/around line 31 in Welcome.php?

 J

Line 32-36 are:
?php
If (!empty($msg)){
echo div class=\Error\. $msg ./divBRBR;
}
?



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




Re: [PHP] Re: Header() - POST

2008-09-21 Thread Ashley Sheridan
On Sun, 2008-09-21 at 14:29 +0200, Lupus Michaelis wrote:
 Maciek Sokolewicz a écrit :
 
  Your xss answer is moot. XSS attacks can (almost) just as easily be 
  performed via POST as they can via GET.
 
No, because you can't click on a link that make a post. Maybe on 
 unsecured browser that allows Xhr (and a POST so) on every sites on the 
 Internet.
 
 -- 
 Mickaël Wolff aka Lupus Michaelis
 http://lupusmic.org
 
No, but it is very simple to spoof a POST request. It's not unknown for
people to tamper with the outgoing POST request sent from the browser as
well.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Re: Header() - POST

2008-09-21 Thread Stut

On 20 Sep 2008, at 01:23, Michelle Konzack wrote:

Am 2008-09-05 17:11:58, schrieb Stut:

You're trying to post to the browser which won't know how to handle
it. The header() function is modifying the response headers that are
being sent back to the browser, they do not create a new request.

If you want to do a new request I suggest looking at curl. If you
actually want the browser to make the new request the only way is to
return a hidden form and auto-submit it with JS. However, as someone
else pointed out if that second request is coming back to the same
server there probably isn't any need for a second request at all.


Why using JS?

   echo meta http-equiv=\refresh\ content=\0; . $FULL_URL \;

would do the trick...


Bloody nora Michelle. If you're going to post answers to week-old  
questions please have the decency to read the question properly. The  
OP wanted to automatically POST some data. That's not gonna happen  
with a meta tag no matter how much you want it to do it.


-Stut

--
http://stut.net/

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



Re: [PHP] Re: header

2008-09-17 Thread Micah Gersten
Wouldn't it be nice if in the $_SERVER array you could get the whole URL
now that PHP has a parse_url function?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Jochem Maas wrote:
 Robert Cummings schreef:
 On Tue, 2008-09-16 at 21:18 +0100, Nathan Rixham wrote:
 Jim Lucas wrote:
 Robert Cummings wrote:
 On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:
 I also meant:
 define('PUBLIC_BASE_HREF' , 'http://php.net/')
 head
 base href=?php echo PUBLIC_BASE_HREF; ? /
 /head

 and further thinking there has to be an easier / cleaner way of
 getting http://; / https://; in php..
 What's wrong with $_SERVER['HTTPS'] ?

 Cheers,
 Rob.
 my way

 ?php

 function get_http_protocol() {
   $proto = 'http';
   if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS'])
 !== 'off' ) {
 $proto .= 's';
   }
   return $proto . '://';  # Adding the :// is optionial
 }

 echo get_http_protocol();

 ?

 That is about as simple as you can get.

 lol this one's got my brain going; here's mine:

 ?php
 function get_http_protocol() {
 return 'http' . ($_SERVER['SERVER_PORT'] == 443 ? 's' : '') .
 '://';
 }
 echo get_http_protocol();
 ?

 Just because 443 is the default HTTPS port, doesn't mean HTTPS is being
 served over 443, nor does it mean HTTPS isn't also being served over
 another port. This is less effective than using $_SERVER['HTTPS'].

 although I hazard to offer the following as more complete:

 function get_http_protocol()
 {
 $proto = 'http';
 if (isset($_SERVER['HTTPS'])  $_SERVER['HTTPS'] 
 strtolower($_SERVER['HTTPS']) !== 'off') {
 $proto .= 's';
}

 return $proto . '://';  # Adding the :// is optionial
 }

 because if $_SERVER['HTTPS'] happens to be false (which I don't think
 it ever should be) it
 would cause the return value to be 'https://' which I don't think
 would be correct in that case
 (even thought the case is theoretical and likely to indicate an engine
 problem if it did occur)


 Cheers,
 Rob.



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



Re: [PHP] Re: header

2008-09-17 Thread mike
On Tue, Sep 16, 2008 at 11:40 PM, Micah Gersten [EMAIL PROTECTED] wrote:
 Wouldn't it be nice if in the $_SERVER array you could get the whole URL
 now that PHP has a parse_url function?

That actually would be a nice thing to have, instead of having to
build it yourself (considering people do it a variety of ways)

Although I think this would sum it up quite briefly:

$url = 'http';
if(isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) == 'on')
{ $url .= 's'; }
$url .= '//'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

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



Re: [PHP] Re: header

2008-09-17 Thread Nathan Rixham

Jochem Maas wrote:

Robert Cummings schreef:

On Tue, 2008-09-16 at 21:18 +0100, Nathan Rixham wrote:

Jim Lucas wrote:

Robert Cummings wrote:

On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:

I also meant:
define('PUBLIC_BASE_HREF' , 'http://php.net/')
head
base href=?php echo PUBLIC_BASE_HREF; ? /
/head

and further thinking there has to be an easier / cleaner way of 
getting http://; / https://; in php..

What's wrong with $_SERVER['HTTPS'] ?

Cheers,
Rob.

my way

?php

function get_http_protocol() {
  $proto = 'http';
  if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) !== 
'off' ) {

$proto .= 's';
  }
  return $proto . '://';  # Adding the :// is optionial
}

echo get_http_protocol();

?

That is about as simple as you can get.


lol this one's got my brain going; here's mine:

?php
function get_http_protocol() {
return 'http' . ($_SERVER['SERVER_PORT'] == 443 ? 's' : '') . '://';
}
echo get_http_protocol();
?


Just because 443 is the default HTTPS port, doesn't mean HTTPS is being
served over 443, nor does it mean HTTPS isn't also being served over
another port. This is less effective than using $_SERVER['HTTPS'].


although I hazard to offer the following as more complete:

function get_http_protocol()
{
$proto = 'http';
if (isset($_SERVER['HTTPS'])  $_SERVER['HTTPS']  
strtolower($_SERVER['HTTPS']) !== 'off') {

$proto .= 's';
   }

return $proto . '://';  # Adding the :// is optionial
}

because if $_SERVER['HTTPS'] happens to be false (which I don't think it 
ever should be) it
would cause the return value to be 'https://' which I don't think would 
be correct in that case
(even thought the case is theoretical and likely to indicate an engine 
problem if it did occur)




Cheers,
Rob.




thats funny about 8 back I said the same thing but in a define!

?php
define('ACCESS_PROTOCOL', isset($_SERVER['HTTPS'])  $_SERVER['HTTPS'] 
? ( $_SERVER['HTTPS']  strtolower($_SERVER['HTTPS']) != 'off' ? 
'https' : 'http' ) : 'http' . '://');


def the most complete/accurate way of doing it (same as the function)

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



Re: [PHP] Re: header

2008-09-17 Thread Nathan Rixham

Micah Gersten wrote:

Wouldn't it be nice if in the $_SERVER array you could get the whole URL
now that PHP has a parse_url function?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



off on a tangent.. I made this some time ago which is rather useful:

class url {

public $scheme = false;
public $host = false;
public $port = false;
public $user = false;
public $pass = false;
public $path = false;
public $query = false;
public $fragment = false;

public function __construct( $url = FALSE )
{
if( $url !== FALSE ) {
$this-load( $url );
}
}

public function load( $url )
{
if( is_string( $url )  strlen( trim( $url ) ) ) {
if( ($tempSelf = parse_url( $url )) !== FALSE ) {
foreach( $tempSelf as $component = $value ) {
$this-$component = $value;
}
return TRUE;
}
}
return FALSE;
}

public function __toString()
{
if($this-scheme) {
$_string .= $this-scheme . '://';
}
if($this-user  $this-pass) {
$_string .= $this-user . ':' . $this-pass . '@';
}
if($this-host) {
$_string .= $this-host;
}
if($this-port) {
$_string .= ':' . $this-port;
}
if($this-path) {
$_string .= $this-path;
}
if($this-query) {
$_string .= '?' . $this-query;
}
if($this-fragment) {
$_string .= $this-fragment;
}
return $_string;
}

}

$url = new url('http://php.net/some.page');

echo $url;
echo $url-scheme;

etc.

Agreed though; it would be nice if PHP had gave access to all the 
properties in a simple UNIFIED way regardless of the http server 
software and protocol used.


$_SERVER['HTTP_REQUEST_SCHEME'] = 'http://';
$_SERVER['HTTP_REQUEST_HOST'] = 'php.net';
etc..

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



Re: [PHP] Re: header

2008-09-17 Thread mike
On Wed, Sep 17, 2008 at 2:31 AM, Nathan Rixham [EMAIL PROTECTED] wrote:

 off on a tangent.. I made this some time ago which is rather useful:


 $url = new url('http://php.net/some.page');

 echo $url;
 echo $url-scheme;

Why would you need this with parse_url() ?

Seems like that function is completely duplicated there...

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



Re: [PHP] Re: header

2008-09-16 Thread Nathan Rixham

tedd wrote:

At 3:16 PM +0100 9/16/08, Nathan Rixham wrote:

Alain R. wrote:

Hi,

how in PHP can i create the similar header as following ?
head
base href=www.mywebsite.com
/head

thx.

A.


just incase everybody else went down a complete tangent on this one

head
base href=?php echo $_SERVER['HTTP_HOST']; ?
/head

it's not nice, elegant, the *proper* way to do things but it'll do the 
job if I understand you correctly



I don't see anything wrong with it. It looks nice, elegant and proper to 
me.


Cheers,

tedd


thanks tedd, to be full proof though there's a lot lacking; for example 
http/1.0 browsers don't pass through HTTP_HOST seeing as it's only in 
http/1.1; also even on http/1.1 it's sometimes spoofed; further there's 
the whole HTTPS_HOST to concider; there's only one full proof method and 
thats to simple hard code or define it:


define('PUBLIC_BASE_HREF' , 'http://php.net/')
head
?php echo PUBLIC_BASE_HREF; ?
/head

or the will probably work for all http/1.1 https calls multi-site version:

?php
define('ACCESS_PROTOCOL', isset($_SERVER['HTTPS'])  $_SERVER['HTTPS'] 
? ( $_SERVER['HTTPS']  strtolower($_SERVER['HTTPS']) != 'off' ? 
'https' : 'http' ) : 'http' . '://');

if( isset($_SERVER['HTTP_HOST'])  $_SERVER['HTTP_HOST'] ) {
	define('PUBLIC_BASE_HREF', ACCESS_PROTOCOL . 
strtolower($_SERVER['HTTP_HOST']) . '/');

} else {
define('PUBLIC_BASE_HREF', FALSE);
}
function html_base_href() {
	return PUBLIC_BASE_HREF ? 'base href=' . PUBLIC_BASE_HREF . '' . 
PHP_EOL : '';

}

?
head
?php echo html_base_href(); ?
/head

and I really don't have the time to go into templating;

somebody should really bring out a class environment or such like with 
all of this in it..


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



Re: [PHP] Re: header

2008-09-16 Thread Robert Cummings
On Tue, 2008-09-16 at 17:49 +0100, Nathan Rixham wrote:
 tedd wrote:
  At 3:16 PM +0100 9/16/08, Nathan Rixham wrote:
  Alain R. wrote:
  Hi,
 
  how in PHP can i create the similar header as following ?
  head
  base href=www.mywebsite.com
  /head
 
  thx.
 
  A.
 
  just incase everybody else went down a complete tangent on this one
 
  head
  base href=?php echo $_SERVER['HTTP_HOST']; ?
  /head
 
  it's not nice, elegant, the *proper* way to do things but it'll do the 
  job if I understand you correctly
  
  
  I don't see anything wrong with it. It looks nice, elegant and proper to 
  me.
  
  Cheers,
  
  tedd
 
 thanks tedd, to be full proof though there's a lot lacking; for example 
 http/1.0 browsers don't pass through HTTP_HOST seeing as it's only in 
 http/1.1; also even on http/1.1 it's sometimes spoofed; further there's 
 the whole HTTPS_HOST to concider; there's only one full proof method and 
 thats to simple hard code or define it:

I think you mean fool proof when you say full proof. It's synonymous
with idiot proof.

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Re: header

2008-09-16 Thread Nathan Rixham

Robert Cummings wrote:

On Tue, 2008-09-16 at 17:49 +0100, Nathan Rixham wrote:

tedd wrote:

At 3:16 PM +0100 9/16/08, Nathan Rixham wrote:

Alain R. wrote:

Hi,

how in PHP can i create the similar header as following ?
head
base href=www.mywebsite.com
/head

thx.

A.

just incase everybody else went down a complete tangent on this one

head
base href=?php echo $_SERVER['HTTP_HOST']; ?
/head

it's not nice, elegant, the *proper* way to do things but it'll do the 
job if I understand you correctly


I don't see anything wrong with it. It looks nice, elegant and proper to 
me.


Cheers,

tedd
thanks tedd, to be full proof though there's a lot lacking; for example 
http/1.0 browsers don't pass through HTTP_HOST seeing as it's only in 
http/1.1; also even on http/1.1 it's sometimes spoofed; further there's 
the whole HTTPS_HOST to concider; there's only one full proof method and 
thats to simple hard code or define it:


I think you mean fool proof when you say full proof. It's synonymous
with idiot proof.

Cheers,
Rob.


indeed; I also meant consider  simply;

I also meant:
define('PUBLIC_BASE_HREF' , 'http://php.net/')
head
base href=?php echo PUBLIC_BASE_HREF; ? /
/head

and further thinking there has to be an easier / cleaner way of getting 
http://; / https://; in php..


ps: please excuse the typo's etc.

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



Re: [PHP] Re: header

2008-09-16 Thread Robert Cummings
On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:

 I also meant:
 define('PUBLIC_BASE_HREF' , 'http://php.net/')
 head
 base href=?php echo PUBLIC_BASE_HREF; ? /
 /head
 
 and further thinking there has to be an easier / cleaner way of getting 
 http://; / https://; in php..

What's wrong with $_SERVER['HTTPS'] ?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Re: header

2008-09-16 Thread Jim Lucas
Robert Cummings wrote:
 On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:
 I also meant:
 define('PUBLIC_BASE_HREF' , 'http://php.net/')
 head
 base href=?php echo PUBLIC_BASE_HREF; ? /
 /head

 and further thinking there has to be an easier / cleaner way of getting 
 http://; / https://; in php..
 
 What's wrong with $_SERVER['HTTPS'] ?
 
 Cheers,
 Rob.

my way

?php

function get_http_protocol() {
  $proto = 'http';
  if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) !== 'off' ) {
$proto .= 's';
  }
  return $proto . '://';  # Adding the :// is optionial
}

echo get_http_protocol();

?

That is about as simple as you can get.

-- 
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] Re: header

2008-09-16 Thread Nathan Rixham

Jim Lucas wrote:

Robert Cummings wrote:

On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:

I also meant:
define('PUBLIC_BASE_HREF' , 'http://php.net/')
head
base href=?php echo PUBLIC_BASE_HREF; ? /
/head

and further thinking there has to be an easier / cleaner way of getting 
http://; / https://; in php..

What's wrong with $_SERVER['HTTPS'] ?

Cheers,
Rob.


my way

?php

function get_http_protocol() {
  $proto = 'http';
  if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) !== 'off' ) {
$proto .= 's';
  }
  return $proto . '://';  # Adding the :// is optionial
}

echo get_http_protocol();

?

That is about as simple as you can get.



lol this one's got my brain going; here's mine:

?php
function get_http_protocol() {
return 'http' . ($_SERVER['SERVER_PORT'] == 443 ? 's' : '') . '://';
}
echo get_http_protocol();
?

Nathan

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



Re: [PHP] Re: header

2008-09-16 Thread Robert Cummings
On Tue, 2008-09-16 at 21:18 +0100, Nathan Rixham wrote:
 Jim Lucas wrote:
  Robert Cummings wrote:
  On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:
  I also meant:
  define('PUBLIC_BASE_HREF' , 'http://php.net/')
  head
  base href=?php echo PUBLIC_BASE_HREF; ? /
  /head
 
  and further thinking there has to be an easier / cleaner way of getting 
  http://; / https://; in php..
  What's wrong with $_SERVER['HTTPS'] ?
 
  Cheers,
  Rob.
  
  my way
  
  ?php
  
  function get_http_protocol() {
$proto = 'http';
if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) !== 'off' 
  ) {
  $proto .= 's';
}
return $proto . '://';  # Adding the :// is optionial
  }
  
  echo get_http_protocol();
  
  ?
  
  That is about as simple as you can get.
  
 
 lol this one's got my brain going; here's mine:
 
 ?php
 function get_http_protocol() {
   return 'http' . ($_SERVER['SERVER_PORT'] == 443 ? 's' : '') . '://';
 }
 echo get_http_protocol();
 ?

Just because 443 is the default HTTPS port, doesn't mean HTTPS is being
served over 443, nor does it mean HTTPS isn't also being served over
another port. This is less effective than using $_SERVER['HTTPS'].

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Re: header

2008-09-16 Thread Jochem Maas

Robert Cummings schreef:

On Tue, 2008-09-16 at 21:18 +0100, Nathan Rixham wrote:

Jim Lucas wrote:

Robert Cummings wrote:

On Tue, 2008-09-16 at 18:13 +0100, Nathan Rixham wrote:

I also meant:
define('PUBLIC_BASE_HREF' , 'http://php.net/')
head
base href=?php echo PUBLIC_BASE_HREF; ? /
/head

and further thinking there has to be an easier / cleaner way of getting 
http://; / https://; in php..

What's wrong with $_SERVER['HTTPS'] ?

Cheers,
Rob.

my way

?php

function get_http_protocol() {
  $proto = 'http';
  if ( isset($_SERVER['HTTPS'])  strtolower($_SERVER['HTTPS']) !== 'off' ) {
$proto .= 's';
  }
  return $proto . '://';  # Adding the :// is optionial
}

echo get_http_protocol();

?

That is about as simple as you can get.


lol this one's got my brain going; here's mine:

?php
function get_http_protocol() {
return 'http' . ($_SERVER['SERVER_PORT'] == 443 ? 's' : '') . '://';
}
echo get_http_protocol();
?


Just because 443 is the default HTTPS port, doesn't mean HTTPS is being
served over 443, nor does it mean HTTPS isn't also being served over
another port. This is less effective than using $_SERVER['HTTPS'].


although I hazard to offer the following as more complete:

function get_http_protocol()
{
$proto = 'http';
if (isset($_SERVER['HTTPS'])  $_SERVER['HTTPS']  
strtolower($_SERVER['HTTPS']) !== 'off') {
$proto .= 's';
}

return $proto . '://';  # Adding the :// is optionial
}

because if $_SERVER['HTTPS'] happens to be false (which I don't think it ever 
should be) it
would cause the return value to be 'https://' which I don't think would be 
correct in that case
(even thought the case is theoretical and likely to indicate an engine problem 
if it did occur)



Cheers,
Rob.



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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Daniel Brown

On 7/24/07, Daniel Kasak [EMAIL PROTECTED] wrote:

On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote:

 Hello, Dans!

 Dan K., is there any reason the validation can't reside within the
 same script as the form, then forward on success?  A very simple
 example:

 ?
 if($_POST) {
 // Check to ensure that your variables are all correct,
 // then use header(Location: successful-target.php?var1=avar2=b);
 // And then, on forwarding, remember to exit;
 }
 ?
 FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];?
 INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR /
 INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR /
 INPUT TYPE=SUBMIT VALUE=GO!
 /FORM

 Since the user will start with a blank form, and the $_POST values
 won't already be set, the values in the form will be blank on the
 initial page load, but for unsuccessful attempts, they'll be populated
 with the correct data.

 ~ Dan^[3]


I've completely changed the way I was doing this now. Initially I
implemented lots of checks for NULL values, as Dan[2] recommended, and
this worked well apart from in the case of text areas. These broke
things completely. I've now decided to shove all form data into session
globals, and just refresh with a 'load_previous' flag in the URL. I my
form constructor sees this flag, it populates things from session
globals. Otherwise it resets the session globals with defaults.

This seems to be the best solution ( ie the only one that's worked
completely so far ).

Thank you, both of you. Long live Dans!

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au




   Viva Danielism!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Tijnema

On 7/25/07, Daniel Brown [EMAIL PROTECTED] wrote:

On 7/24/07, Daniel Kasak [EMAIL PROTECTED] wrote:
 On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote:

  Hello, Dans!
 
  Dan K., is there any reason the validation can't reside within the
  same script as the form, then forward on success?  A very simple
  example:
 
  ?
  if($_POST) {
  // Check to ensure that your variables are all correct,
  // then use header(Location: successful-target.php?var1=avar2=b);
  // And then, on forwarding, remember to exit;
  }
  ?
  FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];?
  INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR /
  INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR /
  INPUT TYPE=SUBMIT VALUE=GO!
  /FORM
 
  Since the user will start with a blank form, and the $_POST values
  won't already be set, the values in the form will be blank on the
  initial page load, but for unsuccessful attempts, they'll be populated
  with the correct data.
 
  ~ Dan^[3]
 

 I've completely changed the way I was doing this now. Initially I
 implemented lots of checks for NULL values, as Dan[2] recommended, and
 this worked well apart from in the case of text areas. These broke
 things completely. I've now decided to shove all form data into session
 globals, and just refresh with a 'load_previous' flag in the URL. I my
 form constructor sees this flag, it populates things from session
 globals. Otherwise it resets the session globals with defaults.

 This seems to be the best solution ( ie the only one that's worked
 completely so far ).

 Thank you, both of you. Long live Dans!

 --
 Daniel Kasak
 IT Developer
 NUS Consulting Group
 Level 5, 77 Pacific Highway
 North Sydney, NSW, Australia 2060
 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
 email: [EMAIL PROTECTED]
 website: http://www.nusconsulting.com.au



   Viva Danielism!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


You Dans driving me insine with all those dans :P

Tijnema
--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Tijnema

On 7/25/07, Daniel Brown [EMAIL PROTECTED] wrote:

On 7/25/07, Tijnema [EMAIL PROTECTED] wrote:
 You Dans driving me insine with all those dans :P

 Tijnema
 --
 Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info


   Be jealous and afraid.  It's not just a name it's a race.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



Oh, Ok, let me change my nick


- Daniel

--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-25 Thread Daniel Brown

On 7/25/07, Tijnema [EMAIL PROTECTED] wrote:

You Dans driving me insine with all those dans :P

Tijnema
--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info



   Be jealous and afraid.  It's not just a name it's a race.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-24 Thread Daniel Brown

On 7/23/07, Daniel Kasak [EMAIL PROTECTED] wrote:

Thanks for the response Dan. Us Dans have to stick together :)

On Mon, 2007-07-23 at 17:37 -0700, Dan wrote:

 Then validate the field obviously!
 $description = ;
 $categoryid = ;

 if(isset($_POST['description']))
 $description = ?description=$_POST['description'];

 if(isset($_POST['categoryid']))
 {
 if($description != ) $categoryid = ; else $categoryid = ?;  // if a
 description has been entered you'll need an  symbol otherwise a ?
 $category .= categoryid=$_POST['categoryid'];  // append category to
 itself with the posted info
 }

H. Yeah I thought it would come to that. I was hoping for a quick 
nasty fix.

 I didn't test this it's just off the top of my head, also you should
 sanitize the input before you do anythign with it really, but that's another
 issue.  Also this is really something that you should be doing with ajax
 rather than having the page reloading, and passing variables back, etc.
 This is the EXACT purpose that Ajax as made for, validation of info.  Check
 out XAJAX it's very simple to use but powerfull when you need it.

I will try to make some time for investigating ajax. I'm mostly
developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is
a once-off maintenance thing ), so I'll a little out of my comfort
zone ...

Thanks again for your help.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

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




   Hello, Dans!

   Dan K., is there any reason the validation can't reside within the
same script as the form, then forward on success?  A very simple
example:

?
if($_POST) {
   // Check to ensure that your variables are all correct,
   // then use header(Location: successful-target.php?var1=avar2=b);
   // And then, on forwarding, remember to exit;
}
?
FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];?
INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR /
INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR /
INPUT TYPE=SUBMIT VALUE=GO!
/FORM

   Since the user will start with a blank form, and the $_POST values
won't already be set, the values in the form will be blank on the
initial page load, but for unsuccessful attempts, they'll be populated
with the correct data.

   ~ Dan^[3]

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-24 Thread Tijnema

On 7/24/07, Daniel Brown [EMAIL PROTECTED] wrote:

On 7/23/07, Daniel Kasak [EMAIL PROTECTED] wrote:
 Thanks for the response Dan. Us Dans have to stick together :)

 On Mon, 2007-07-23 at 17:37 -0700, Dan wrote:

  Then validate the field obviously!
  $description = ;
  $categoryid = ;
 
  if(isset($_POST['description']))
  $description = ?description=$_POST['description'];
 
  if(isset($_POST['categoryid']))
  {
  if($description != ) $categoryid = ; else $categoryid = ?;  // if a
  description has been entered you'll need an  symbol otherwise a ?
  $category .= categoryid=$_POST['categoryid'];  // append category to
  itself with the posted info
  }

 H. Yeah I thought it would come to that. I was hoping for a quick 
 nasty fix.

  I didn't test this it's just off the top of my head, also you should
  sanitize the input before you do anythign with it really, but that's another
  issue.  Also this is really something that you should be doing with ajax
  rather than having the page reloading, and passing variables back, etc.
  This is the EXACT purpose that Ajax as made for, validation of info.  Check
  out XAJAX it's very simple to use but powerfull when you need it.

 I will try to make some time for investigating ajax. I'm mostly
 developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is
 a once-off maintenance thing ), so I'll a little out of my comfort
 zone ...

 Thanks again for your help.

 --
 Daniel Kasak
 IT Developer
 NUS Consulting Group
 Level 5, 77 Pacific Highway
 North Sydney, NSW, Australia 2060
 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
 email: [EMAIL PROTECTED]
 website: http://www.nusconsulting.com.au

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



   Hello, Dans!

   Dan K., is there any reason the validation can't reside within the
same script as the form, then forward on success?  A very simple
example:

?
if($_POST) {
   // Check to ensure that your variables are all correct,
   // then use header(Location: successful-target.php?var1=avar2=b);
   // And then, on forwarding, remember to exit;
}
?
FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];?
INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR /
INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR /
INPUT TYPE=SUBMIT VALUE=GO!
/FORM

   Since the user will start with a blank form, and the $_POST values
won't already be set, the values in the form will be blank on the
initial page load, but for unsuccessful attempts, they'll be populated
with the correct data.

   ~ Dan^[3]

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107




Note that if you have E_NOTICE set in error reporting level, then this
gives some warnings about undefined variables!

Tijnema

--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-24 Thread Daniel Kasak
On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote:

 Hello, Dans!
 
 Dan K., is there any reason the validation can't reside within the
 same script as the form, then forward on success?  A very simple
 example:
 
 ?
 if($_POST) {
 // Check to ensure that your variables are all correct,
 // then use header(Location: successful-target.php?var1=avar2=b);
 // And then, on forwarding, remember to exit;
 }
 ?
 FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];?
 INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR /
 INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR /
 INPUT TYPE=SUBMIT VALUE=GO!
 /FORM
 
 Since the user will start with a blank form, and the $_POST values
 won't already be set, the values in the form will be blank on the
 initial page load, but for unsuccessful attempts, they'll be populated
 with the correct data.
 
 ~ Dan^[3]
 

I've completely changed the way I was doing this now. Initially I
implemented lots of checks for NULL values, as Dan[2] recommended, and
this worked well apart from in the case of text areas. These broke
things completely. I've now decided to shove all form data into session
globals, and just refresh with a 'load_previous' flag in the URL. I my
form constructor sees this flag, it populates things from session
globals. Otherwise it resets the session globals with defaults.

This seems to be the best solution ( ie the only one that's worked
completely so far ).

Thank you, both of you. Long live Dans!

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

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



Re: [PHP] Re: header( 'refresh' ), form data, and IE

2007-07-23 Thread Daniel Kasak
Thanks for the response Dan. Us Dans have to stick together :)

On Mon, 2007-07-23 at 17:37 -0700, Dan wrote:

 Then validate the field obviously!
 $description = ;
 $categoryid = ;
 
 if(isset($_POST['description']))
 $description = ?description=$_POST['description'];
 
 if(isset($_POST['categoryid']))
 {
 if($description != ) $categoryid = ; else $categoryid = ?;  // if a 
 description has been entered you'll need an  symbol otherwise a ?
 $category .= categoryid=$_POST['categoryid'];  // append category to 
 itself with the posted info
 }

H. Yeah I thought it would come to that. I was hoping for a quick 
nasty fix.

 I didn't test this it's just off the top of my head, also you should 
 sanitize the input before you do anythign with it really, but that's another 
 issue.  Also this is really something that you should be doing with ajax 
 rather than having the page reloading, and passing variables back, etc. 
 This is the EXACT purpose that Ajax as made for, validation of info.  Check 
 out XAJAX it's very simple to use but powerfull when you need it.

I will try to make some time for investigating ajax. I'm mostly
developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is
a once-off maintenance thing ), so I'll a little out of my comfort
zone ...

Thanks again for your help.

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

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



RE: [PHP] Re: header('Location:') works locally but not remotely

2007-04-16 Thread Tim
 

 -Message d'origine-
 De : Ross [mailto:[EMAIL PROTECTED] 
 Envoyé : lundi 16 avril 2007 19:45
 À : php-general@lists.php.net
 Objet : [PHP] Re: header('Location:') works locally but not remotely
 
 ok I have a page that calls my my functions, basically a 6 
 step signup. All the steps look like this
 
 function step_one() {
 
 $_SESSION['property_id'] =$_POST['property_id']; $property_id 
 = $_POST['property_id']; $postcode= $_POST['postcode']; 
 $query = INSERT INTO properties (property_id, postcode) 
 VALUES ('$property_id', '$postcode'); $result= 
 mysql_query($query); header( 'Location: ?step=two' ); }

php.net
http://fr.php.net/header:

Note:  HTTP/1.1 requires an absolute URI as argument to » Location:
including the scheme, hostname and absolute path, but some clients accept
relative URIs. You can usually use $_SERVER['HTTP_HOST'],
$_SERVER['PHP_SELF']  and dirname() to make an absolute URI from a relative
one yourself
/php.net

Could this be your issue? I always use full URI for header('location:

Regards,

Tim

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



RE: [PHP] Re: header('Location:') works locally but not remotely

2007-04-16 Thread Tim
 

 -Message d'origine-
 De : Tim [mailto:[EMAIL PROTECTED] 
 Envoyé : lundi 16 avril 2007 19:54
 À : 'Ross'; php-general@lists.php.net
 Objet : RE: [PHP] Re: header('Location:') works locally but 
 not remotely
 
  
 
  -Message d'origine-
  De : Ross [mailto:[EMAIL PROTECTED] 
  Envoyé : lundi 16 avril 2007 19:45
  À : php-general@lists.php.net
  Objet : [PHP] Re: header('Location:') works locally but not remotely
  
  ok I have a page that calls my my functions, basically a 6 
  step signup. All the steps look like this
  
  function step_one() {
  
  $_SESSION['property_id'] =$_POST['property_id']; $property_id 
  = $_POST['property_id']; $postcode= $_POST['postcode']; 
  $query = INSERT INTO properties (property_id, postcode) 
  VALUES ('$property_id', '$postcode'); $result= 
  mysql_query($query); header( 'Location: ?step=two' ); }
 
 php.net
 http://fr.php.net/header:
 
 Note:  HTTP/1.1 requires an absolute URI as argument to » Location:
 including the scheme, hostname and absolute path, but some 
 clients accept
 relative URIs. You can usually use $_SERVER['HTTP_HOST'],
 $_SERVER['PHP_SELF']  and dirname() to make an absolute URI 
 from a relative
 one yourself
 /php.net
 
 Could this be your issue? I always use full URI for 
 header('location:

Sorry i meant i always use full host/uri/extra schema

Tim

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



Re: [PHP] Re: header('Location:') works locally but not remotely

2007-04-16 Thread Philip Thompson

On Apr 16, 2007, at 12:44 PM, Ross wrote:

ok I have a page that calls my my functions, basically a 6 step  
signup. All

the steps look like this

function step_one() {

$_SESSION['property_id'] =$_POST['property_id'];
$property_id = $_POST['property_id'];
$postcode= $_POST['postcode'];


Escape your data:
$property_id = mysql_real_escape_string($_POST['property_id']);
$postcode = mysql_real_escape_string($_POST['postcode']);



$query = INSERT INTO properties (property_id, postcode) VALUES
('$property_id', '$postcode');
$result= mysql_query($query);
header( 'Location: ?step=two' );


As others have mentioned, you must include at least the relative path.

header (Location: add_new.php?step=two);
exit;

Always include 'exit;' after a redirect. Happy coding...

~Philip



}

This SHOULD redirect to

add_new.php?step=two

As add_new is the container page.

Thanks.

R.


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



Re: [PHP] RE: header data being inserted into message

2006-01-19 Thread Richard Lynch
On Tue, January 17, 2006 9:12 am, ET Support wrote:
 I am having a problem using PHP's mail function to send mail via BCC
 to
 multiple recipients. Here's my code;
 --
 $get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE conf
 = 1);
 $count = pg_numrows($get_emails);
 $bcc_count = $envelope_count = 0;
 $bcc_limit = 200;
 $subject = $body = 'test message';
 $from = '[EMAIL PROTECTED]';
 $header = From: $from\r\n;

You probably want Reply-to: here as well...

 for($x = 0; $x  $count; $x++) {
   $email = pg_result($get_emails,$x,0);
   if($bcc_count = $bcc_limit) {
   if($x  0) {
   $envelope_count++;
   mail($from,$subject,$body,$headers);
   }
   $headers = $header . Bcc: $email\r\n;

   $bcc_count = 1;
   } else {
   $headers .= Bcc: $email\r\n;
   $bcc_count++;
   }
 }
 # send the last envelope
 mail($from,$subject,$body,$headers);
 --

 The problem is that for some recipients they get a message body like
 this;

 --
 Message-Id: [EMAIL PROTECTED]
 Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

 test message
 --

 Any idea why those headers are being inserted into the message body
 and how
 that can be prevented?

If $email contains a newline, or a \r\n, then you might see that...

Because your Bcc: $email\r\n turns into:

Bcc: junk\n
\r\n
Message-Id: 


At which point you're not in the heades any more because your 'email'
forced you out of them with a blank line.

How 'clean' are the emails in your database?... :-)

If they've come from a web signup form, and you weren't validating the
input, then I guarantee you've got spammers trying to use your form to
send out junk by forcing newlines and the headers THEY want into your
'email' field...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] RE: header data being inserted into message

2006-01-18 Thread ET Support
Hi Richard,

Thanks for the response, however I do not want to have to use any special
classes or other software... I want to get it working just using the basic
php functions, which should be possible as far as I understand the php
documentation... if I keep finding that I can't get it working then maybe
I'll go to majordomo2.

Anyone else have some advice for me here?

Thanks,
Ben

-Original Message-
From: Richard Correia [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 17, 2006 12:37 PM
To: ET Support
Cc: php-general@lists.php.net
Subject: Re: [PHP] RE: header data being inserted into message


Hey,

You can use the readymase mailer class from
http://www.weberdev.com/get_example-462.html

and

http://www.weberdev.com/get_example-3724.html

Thanks
Richard


On 1/17/06, ET Support [EMAIL PROTECTED] wrote:
Hello all,

I am having a problem using PHP's mail function to send mail via BCC to
multiple recipients. Here's my code;
--
$get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE conf = 1);
$count = pg_numrows($get_emails);
$bcc_count = $envelope_count = 0;
$bcc_limit = 200;
$subject = $body = 'test message';
$from = '[EMAIL PROTECTED]';
$header = From: $from\r\n;
for($x = 0; $x  $count; $x++) {
   $email = pg_result($get_emails,$x,0);
   if($bcc_count = $bcc_limit) {
   if($x  0) {
   $envelope_count++;
   mail($from,$subject,$body,$headers);
   }
   $headers = $header . Bcc: $email\r\n;
   $bcc_count = 1;
   } else {
   $headers .= Bcc: $email\r\n;
   $bcc_count++;
   }
}
# send the last envelope
mail($from,$subject,$body,$headers);
--

The problem is that for some recipients they get a message body like this;

--
Message-Id:  [EMAIL PROTECTED]
Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

test message
--

Any idea why those headers are being inserted into the message body and how
that can be prevented?

Thanks,
Ben King
[EMAIL PROTECTED]

--
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] RE: header data being inserted into message

2006-01-18 Thread ET Support
That did not work, however what does seem to work is changing all my \r\n to
just \n ... which I found after going over the php docs again at
http://www.php.net/manual/en/function.mail.php ... Note:  If messages are
not received, try using a LF (\n) only. Some poor quality Unix mail transfer
agents replace LF by CRLF automatically (which leads to doubling CR if CRLF
is used). This should be a last resort, as it does not comply with RFC
2822.

... we're using FreeBSD 4.11-STABLE so that must be in the category of one
of the poor quality Unix mail transfer agents

Thanks for the input!


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 18, 2006 11:29 AM
To: ET Support
Subject: RE: [PHP] RE: header data being inserted into message


what you're showing indicates that an MTA is getting confused about
the structure of the message and putting the message-id into the
body, rather than header.

you need to have a cr/lf (null line) between the header and the body,
otherwise the/an MTA can get things mixed up. so, when you exit your
bcc loop write out (another) \n.


 Original Message 
 Date: Wednesday, January 18, 2006 10:52:10 AM -0400
 From: ET Support [EMAIL PROTECTED]
 To: Richard Correia [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Subject: RE: [PHP] RE: header data being inserted into message

 Hi Richard,

 Thanks for the response, however I do not want to have to use any
 special classes or other software... I want to get it working just
 using the basic php functions, which should be possible as far as I
 understand the php documentation... if I keep finding that I can't
 get it working then maybe I'll go to majordomo2.

 Anyone else have some advice for me here?

 Thanks,
 Ben

 -Original Message-
 From: Richard Correia [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 17, 2006 12:37 PM
 To: ET Support
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] RE: header data being inserted into message


 Hey,

 You can use the readymase mailer class from
 http://www.weberdev.com/get_example-462.html

 and

 http://www.weberdev.com/get_example-3724.html

 Thanks
 Richard


 On 1/17/06, ET Support [EMAIL PROTECTED] wrote:
 Hello all,

 I am having a problem using PHP's mail function to send mail via
 BCC to multiple recipients. Here's my code;
 --
 $get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE
 conf = 1); $count = pg_numrows($get_emails);
 $bcc_count = $envelope_count = 0;
 $bcc_limit = 200;
 $subject = $body = 'test message';
 $from = '[EMAIL PROTECTED]';
 $header = From: $from\r\n;
 for($x = 0; $x  $count; $x++) {
$email = pg_result($get_emails,$x,0);
if($bcc_count = $bcc_limit) {
if($x  0) {
$envelope_count++;
mail($from,$subject,$body,$headers);
}
$headers = $header . Bcc: $email\r\n;
$bcc_count = 1;
} else {
$headers .= Bcc: $email\r\n;
$bcc_count++;
}
 }
# send the last envelope
 mail($from,$subject,$body,$headers);
 --

 The problem is that for some recipients they get a message body
 like this;

 --
 Message-Id:  [EMAIL PROTECTED]
 Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

 test message
 --

 Any idea why those headers are being inserted into the message body
 and how that can be prevented?

 Thanks,
 Ben King
 [EMAIL PROTECTED]

 --
 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

-- End Original Message --

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



Re: [PHP] RE: header data being inserted into message

2006-01-17 Thread Richard Correia
Hey,

You can use the readymase mailer class from
http://www.weberdev.com/get_example-462.html

and

http://www.weberdev.com/get_example-3724.html

Thanks
Richard


On 1/17/06, ET Support [EMAIL PROTECTED] wrote:

 Hello all,

 I am having a problem using PHP's mail function to send mail via BCC to
 multiple recipients. Here's my code;
 --
 $get_emails = pg_exec($dbh,SELECT email FROM mailing_list WHERE conf =
 1);
 $count = pg_numrows($get_emails);
 $bcc_count = $envelope_count = 0;
 $bcc_limit = 200;
 $subject = $body = 'test message';
 $from = '[EMAIL PROTECTED]';
 $header = From: $from\r\n;
 for($x = 0; $x  $count; $x++) {
$email = pg_result($get_emails,$x,0);
if($bcc_count = $bcc_limit) {
if($x  0) {
$envelope_count++;
mail($from,$subject,$body,$headers);
}
$headers = $header . Bcc: $email\r\n;
$bcc_count = 1;
} else {
$headers .= Bcc: $email\r\n;
$bcc_count++;
}
 }
 # send the last envelope
 mail($from,$subject,$body,$headers);
 --

 The problem is that for some recipients they get a message body like this;

 --
 Message-Id: [EMAIL PROTECTED]
 Date: Mon, 16 Jan 2006 17:06:40 + (GMT)

 test message
 --

 Any idea why those headers are being inserted into the message body and
 how
 that can be prevented?

 Thanks,
 Ben King
 [EMAIL PROTECTED]

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




Re: [PHP] Re: Header target?

2004-06-14 Thread Bob Lockie
On 06/12/04 19:05 Kim Steinhaug spoke:
Steve Douville had a long answer, the short answer : no
Ok, thanks.
I want to avoid relying on Javascript anyways.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Header target?

2004-06-14 Thread Marek Kilimajer
Bob Lockie wrote --- napísal::
On 06/12/04 19:05 Kim Steinhaug spoke:
Steve Douville had a long answer, the short answer : no

Ok, thanks.
I want to avoid relying on Javascript anyways.
Make _top the target of the form, then rebuild the frameset based on 
your logic.

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


Re: [PHP] Re: header() function...

2003-10-15 Thread Tristan . Pretty
You are all heart... ;-)




Curt Zirzow [EMAIL PROTECTED] 
14/10/2003 17:23

To
[EMAIL PROTECTED]
cc

Subject
Re: [PHP] Re: header() function...







I officially declare this thread foobar.

Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
   http://zirzow.dyndns.org/html/mlists/

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




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Chris Hayes
It might help to have a peek at how the php Pdf libraries are doing this 
(www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot 
of  things to worry about with pdf, not the least the fact that older 
acrobat readers will give plenty of errors when the page is not send fast 
enough  and many other reasons.
The safest workaround might be to save the pdf on the server, and then use 
headers to tell the browser where to find it.

At 14:55 14-10-03, you wrote:
Well, now, I get an unknown file type.  I have already specified the
   Scott Fletcher [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
I seem to be having problem with sending the PDF document to the 
browser to
be open on screen.  I kept getting the error message, it say 
'Windows cannot open this file'.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
I'm using the library from www.fpdf.org.  I currently using the method on
storing the file to the server because of two features.  One so I can have
php script to use the email to pick up the file and send it to my boss.
Two, an optional option to view the billing invoice.  I am beginning to
think that it might not be a browser problem after all.  But something with
the fpdf library.  One way to test my theory is to grab a working pdf file
on my machine and put it on the server, have php point to it and see if it
can be display without a problem.  If there's problem then it had to do with
the poor scripting I made on the php header.

Right now, I'm thinking of using hte HTML conversion to PDF feature.  I
haven't found this feature on the Internet until recently when I saw an
earlier PHP newsgroup post yesterday.  The reason is because it's quicker
that way, I'm trying to finish the project so I can leave my job.  So, I
would like to make this project be simpilier for any future hired web
programmer.

Scott F.

Chris Hayes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 It might help to have a peek at how the php Pdf libraries are doing this
 (www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot
 of  things to worry about with pdf, not the least the fact that older
 acrobat readers will give plenty of errors when the page is not send fast
 enough  and many other reasons.
 The safest workaround might be to save the pdf on the server, and then use
 headers to tell the browser where to find it.


 At 14:55 14-10-03, you wrote:
 Well, now, I get an unknown file type.  I have already specified the
 Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  I seem to be having problem with sending the PDF document to the
  browser to
  be open on screen.  I kept getting the error message, it say
  'Windows cannot open this file'.

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



Re: [PHP] Re: header() function for displaying an opened PDF document.

2003-10-14 Thread Scott Fletcher
Aw, scratch that HTML conversion to PDF feature.  It require an installation
of a couple of other stuffs.  I'm going to stick back to fpdf library for
now.

Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm using the library from www.fpdf.org.  I currently using the method on
 storing the file to the server because of two features.  One so I can have
 php script to use the email to pick up the file and send it to my boss.
 Two, an optional option to view the billing invoice.  I am beginning to
 think that it might not be a browser problem after all.  But something
with
 the fpdf library.  One way to test my theory is to grab a working pdf file
 on my machine and put it on the server, have php point to it and see if it
 can be display without a problem.  If there's problem then it had to do
with
 the poor scripting I made on the php header.

 Right now, I'm thinking of using hte HTML conversion to PDF feature.  I
 haven't found this feature on the Internet until recently when I saw an
 earlier PHP newsgroup post yesterday.  The reason is because it's quicker
 that way, I'm trying to finish the project so I can leave my job.  So, I
 would like to make this project be simpilier for any future hired web
 programmer.

 Scott F.

 Chris Hayes [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
  It might help to have a peek at how the php Pdf libraries are doing this
  (www.php.net/pdflib, fpdf.org, www.ros.co.nz/pdf) . There are a lot
  of  things to worry about with pdf, not the least the fact that older
  acrobat readers will give plenty of errors when the page is not send
fast
  enough  and many other reasons.
  The safest workaround might be to save the pdf on the server, and then
use
  headers to tell the browser where to find it.
 
 
  At 14:55 14-10-03, you wrote:
  Well, now, I get an unknown file type.  I have already specified the
  Scott Fletcher [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   I seem to be having problem with sending the PDF document to
the
   browser to
   be open on screen.  I kept getting the error message, it say
   'Windows cannot open this file'.

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



Re: [PHP] Re: header() function...

2003-10-14 Thread Tristan . Pretty
Bog standard web server logs...
We're hosted on a windows server I think... (sadly)





Scott Fletcher [EMAIL PROTECTED] 
14/10/2003 16:25

To
[EMAIL PROTECTED]
cc

Subject
[PHP] Re: header() function...






Web Server's log file or user defined log file (Sort of Like PHP Log)?

Tristan Pretty [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
.
 We've just moved sites, to a new URL...
 on the home page of the old url, I simply had a page that was;

 ?
 header(Location: http://www.newsite.com);
 ?

 All good, any requests to that page, were cleanly redirected to the new
 site.
 I know this cause I tested it many times...

 Now on the stats for the new site, we can record no referals from
 http://www.oldsite.com
 yet I know I (and my co-workers) went to http://www.oldsite.com and got
 redirected to http://www.newsite.com
 Can someone confirm:

 Does this method or redirection interfere with the web server logging
 visits?

 Cheers,
 Tris...

 *
 The information contained in this e-mail message is intended only for
 the personal and confidential use of the recipient(s) named above.
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is
 strictly prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original message.
 ***



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




*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



Re: [PHP] Re: header() function...

2003-10-14 Thread Curt Zirzow

I officially declare this thread foobar.

Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Re: header() function...

2003-10-14 Thread Scott Fletcher
In that case, you most likely would find the 'www.oldsite.com' in the ACCESS
log or whatever it is.  As for the redirecting, nah, there shouldn't be any
interference.  The webserver just record the browser's request into the log
file, then come the header() for redirecting, then the webserver retrieve
whatever the file is as specified by the header() redirect then record the
data into the log file, then send the webpage back to the web browser.

The webserver just recorded whatever is requested by the browser and
whatever is specified from the PHP Module/CGI/ISAPI, and/or user defined
script from the webpage.  Unless there is a configuration setting somewhere
that said otherwise about the log files.


Tristan Pretty [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Bog standard web server logs...
 We're hosted on a windows server I think... (sadly)





 Scott Fletcher [EMAIL PROTECTED]
 14/10/2003 16:25

 To
 [EMAIL PROTECTED]
 cc

 Subject
 [PHP] Re: header() function...






 Web Server's log file or user defined log file (Sort of Like PHP Log)?

 Tristan Pretty [EMAIL PROTECTED] wrote in message

news:[EMAIL PROTECTED]
 .
  We've just moved sites, to a new URL...
  on the home page of the old url, I simply had a page that was;
 
  ?
  header(Location: http://www.newsite.com);
  ?
 
  All good, any requests to that page, were cleanly redirected to the new
  site.
  I know this cause I tested it many times...
 
  Now on the stats for the new site, we can record no referals from
  http://www.oldsite.com
  yet I know I (and my co-workers) went to http://www.oldsite.com and got
  redirected to http://www.newsite.com
  Can someone confirm:
 
  Does this method or redirection interfere with the web server logging
  visits?
 
  Cheers,
  Tris...
 
  *
  The information contained in this e-mail message is intended only for
  the personal and confidential use of the recipient(s) named above.
  If the reader of this message is not the intended recipient or an agent
  responsible for delivering it to the intended recipient, you are hereby
  notified that you have received this document in error and that any
  review, dissemination, distribution, or copying of this message is
  strictly prohibited. If you have received this communication in error,
  please notify us immediately by e-mail, and delete the original message.
  ***
 
 

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




 *
 The information contained in this e-mail message is intended only for
 the personal and confidential use of the recipient(s) named above.
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is
 strictly prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original message.
 ***



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



Re: [PHP] Re: header() refresh vs location

2003-10-14 Thread Chris Shiflett
--- Kevin Stone [EMAIL PROTECTED] wrote:
 The Refresh directive is a valid header.  I've used it for many
 years and it seems to be supported by the majority of browsers.

My experience has been the same.

 However I've never read anything that would indicate that Refresh
 works any differently than Location.

Well, it does, though the difference may not be so obvious. The Location header
accompanies a response with a status code of 3xx, which tells the Web client
that the resource has moved. This matters when it comes to things like Google
indexing your site. Google will fetch the new resource and consider it the same
as the original resource as long as the status code was 3xx.

It is also more transparent; a 3xx response does not exist in the client's
history mechanism (well, it's not supposed to), so a user who clicks back won't
be sent forward immediately (making the back button appear broken or disabled).
I'm not sure if Refresh is interpreted as being transparent in the history as
well, but in my current browser (Galeon), it is definitely not.

Oh, and the original problem was likely due to a relative URL being used in the
Location header. This is a violation of the protocol and can cause problems
with certain clients.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp

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



Re: [PHP] Re: header() refresh vs location

2003-10-14 Thread Curt Zirzow
* Thus wrote Chris Shiflett ([EMAIL PROTECTED]):
 --- Kevin Stone [EMAIL PROTECTED] wrote:
  The Refresh directive is a valid header.  I've used it for many
  years and it seems to be supported by the majority of browsers.
 
 My experience has been the same.
 
  However I've never read anything that would indicate that Refresh
  works any differently than Location.
 
 Well, it does, though the difference may not be so obvious. The Location header
 accompanies a response with a status code of 3xx, which tells the Web client
 that the resource has moved. This matters when it comes to things like Google
 indexing your site. Google will fetch the new resource and consider it the same
 as the original resource as long as the status code was 3xx.
 
 It is also more transparent; a 3xx response does not exist in the client's
 history mechanism (well, it's not supposed to), so a user who clicks back won't
 be sent forward immediately (making the back button appear broken or disabled).
 I'm not sure if Refresh is interpreted as being transparent in the history as
 well, but in my current browser (Galeon), it is definitely not.

Correct. Also, a 3xx response should not render the content that is
included with the response, unless the client doesn't support 3xx
(rare) or the user wishes that the browser not to redirect
automatically.

The refresh header will render the html and start the timer for the
refresh once the rendering is done, which does effect the history
of the browser.


Curt
-- 
My PHP key is worn out

  PHP List stats since 1997: 
  http://zirzow.dyndns.org/html/mlists/

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Marek Kilimajer
And what about $_SERVER[HTTPS], are you using it?

PHP wrote:

Jay, good guess, but wrong!  While register_globals does equal off, I am
using $_GET['pagename']  to assign the value to $pagename before the snippet
of code that I sent.  Sorry I didn't mention that earlier.  I tried putting
the _GET in my header redirection directly, but that didn't help.  Any other
ideas?  Anyone else have an idea?
Thanks,
Jonathan Duncan
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
This used to work before I upgraded my PHP.
[/snip]

Let me guess, you upgraded without actually reading the README or update
notes. I am going to guess that register_globals = off in php.ini. You
can either fix the variables $_GET['pagename'] or turn RG back on.
Jay Blanchard

Jonathan Duncan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
This is code that I have in my index that check whether or not SSL is
being

used when accessing certain pages and if not then it redirects to the same
address but with SSL.
if ($pagename==login || $pagename==signup || $pagename==checkout) {
if (!$HTTPS) {
  //header(Location:
https://.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].?pagename=$pagename);

  exit;
   }
 }
This used to work before I upgraded my PHP.  Now when I click on a link
that

matches my SSL checker it just hangs:

http://www.routerbitworld.com/index.php?pagename=checkout

If I change the header to redirect to a location without any variable
directive like this
http://www.routerbitworld.com/index.php

...works fine.  Why can't I send a variable this way?

Thanks,
Jonathan Duncan


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


RE: [PHP] Re: Header won't redirect

2003-09-19 Thread Jay Blanchard
[snip]
Jay, good guess, but wrong!  While register_globals does equal off, I am
using $_GET['pagename']  to assign the value to $pagename before the
snippet
of code that I sent.  Sorry I didn't mention that earlier.  I tried
putting
the _GET in my header redirection directly, but that didn't help.  Any
other
ideas?  Anyone else have an idea?
[/snip]

Can we see the line of code where you are making the assignment?

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Robert Cummings
Here's an idea... echo each of the values and see what they actually
contain. While you grab $pagename from $_GET, where are you getting
$HTTPS? Is it a superglobal too? Maybe it's $_SERVER['HTTPS']

Cheers,
Rob.

On Fri, 2003-09-19 at 10:57, PHP wrote:
 Jay, good guess, but wrong!  While register_globals does equal off, I am
 using $_GET['pagename']  to assign the value to $pagename before the snippet
 of code that I sent.  Sorry I didn't mention that earlier.  I tried putting
 the _GET in my header redirection directly, but that didn't help.  Any other
 ideas?  Anyone else have an idea?
 
 Thanks,
 Jonathan Duncan
 
 
 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 [snip]
 This used to work before I upgraded my PHP.
 
 [/snip]
 
 Let me guess, you upgraded without actually reading the README or update
 notes. I am going to guess that register_globals = off in php.ini. You
 can either fix the variables $_GET['pagename'] or turn RG back on.
 
 Jay Blanchard
 
 
 Jonathan Duncan [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  This is code that I have in my index that check whether or not SSL is
 being
  used when accessing certain pages and if not then it redirects to the same
  address but with SSL.
 
  if ($pagename==login || $pagename==signup || $pagename==checkout) {
   if (!$HTTPS) {
 //header(Location:
 
 https://.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].?pagename=$pagename);
 exit;
  }
}
 
  This used to work before I upgraded my PHP.  Now when I click on a link
 that
  matches my SSL checker it just hangs:
 
  http://www.routerbitworld.com/index.php?pagename=checkout
 
  If I change the header to redirect to a location without any variable
  directive like this
 
  http://www.routerbitworld.com/index.php
 
  ...works fine.  Why can't I send a variable this way?
 
  Thanks,
  Jonathan Duncan
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Scott Fletcher
Try $_REQUEST['pagename'] instead.  Oh before you do that, try this and see
if you have any received data at all in the first place.  just look for
'pagename' in any arrays, don't look for $_GET['pagename'], just look for
'pagename' and see if there is any.

--snip--
?
print_r($GLOBALS);
?
--snip--
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
Jay, good guess, but wrong!  While register_globals does equal off, I am
using $_GET['pagename']  to assign the value to $pagename before the
snippet
of code that I sent.  Sorry I didn't mention that earlier.  I tried
putting
the _GET in my header redirection directly, but that didn't help.  Any
other
ideas?  Anyone else have an idea?
[/snip]

Can we see the line of code where you are making the assignment?

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Jonathan Duncan
Marek and Rob,

Doh!  That was it.  I am still finding things that I used to assign
globally.  It is a good thing, but it makes for a bit of work.  Thanks to
Jay too.  I appreciate everyone's help.

Have a good one,
Jonathan Duncan



Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 And what about $_SERVER[HTTPS], are you using it?

 PHP wrote:

  Jay, good guess, but wrong!  While register_globals does equal off, I am
  using $_GET['pagename']  to assign the value to $pagename before the
snippet
  of code that I sent.  Sorry I didn't mention that earlier.  I tried
putting
  the _GET in my header redirection directly, but that didn't help.  Any
other
  ideas?  Anyone else have an idea?
 
  Thanks,
  Jonathan Duncan
 
 
  Jay Blanchard [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  [snip]
  This used to work before I upgraded my PHP.
 
  [/snip]
 
  Let me guess, you upgraded without actually reading the README or update
  notes. I am going to guess that register_globals = off in php.ini. You
  can either fix the variables $_GET['pagename'] or turn RG back on.
 
  Jay Blanchard
 
 
  Jonathan Duncan [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 This is code that I have in my index that check whether or not SSL is
 
  being
 
 used when accessing certain pages and if not then it redirects to the
same
 address but with SSL.
 
 if ($pagename==login || $pagename==signup || $pagename==checkout)
{
  if (!$HTTPS) {
//header(Location:
 
 
 
https://.$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'].?pagename=$pagename);
 
exit;
 }
   }
 
 This used to work before I upgraded my PHP.  Now when I click on a link
 
  that
 
 matches my SSL checker it just hangs:
 
 http://www.routerbitworld.com/index.php?pagename=checkout
 
 If I change the header to redirect to a location without any variable
 directive like this
 
 http://www.routerbitworld.com/index.php
 
 ...works fine.  Why can't I send a variable this way?
 
 Thanks,
 Jonathan Duncan
 
 

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Jonathan Duncan
Jay,

Try replying to the group so that your contributions stay with the thread
instead of being orphaned and lost.

Regards,
Jonathan Duncan


Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
Jay, good guess, but wrong!  While register_globals does equal off, I am
using $_GET['pagename']  to assign the value to $pagename before the
snippet
of code that I sent.  Sorry I didn't mention that earlier.  I tried
putting
the _GET in my header redirection directly, but that didn't help.  Any
other
ideas?  Anyone else have an idea?
[/snip]

Can we see the line of code where you are making the assignment?

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



RE: [PHP] Re: Header won't redirect

2003-09-19 Thread Jay Blanchard
[snip]
Try replying to the group so that your contributions stay with the
thread
instead of being orphaned and lost.
[/snip]

I always do, did something weird happen? 

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Jonathan Duncan
Perhaps it is just Outlook Express but many of your replies are showing as
ophans.

Jonathan


Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
Try replying to the group so that your contributions stay with the
thread
instead of being orphaned and lost.
[/snip]

I always do, did something weird happen?

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Scott Fletcher
Well, I'm using Outlook Express and it looked fine for an hour or so now.
But not with the ones earlier in the morning.  Strange though!

Scott F.

Jonathan Duncan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Perhaps it is just Outlook Express but many of your replies are showing as
 ophans.

 Jonathan


 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 [snip]
 Try replying to the group so that your contributions stay with the
 thread
 instead of being orphaned and lost.
 [/snip]

 I always do, did something weird happen?

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Scott Fletcher
But Jay Blanchard situation wasn't the only one.  It's the same for other
people.

Scott Fletcher [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Well, I'm using Outlook Express and it looked fine for an hour or so now.
 But not with the ones earlier in the morning.  Strange though!

 Scott F.

 Jonathan Duncan [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Perhaps it is just Outlook Express but many of your replies are showing
as
  ophans.
 
  Jonathan
 
 
  Jay Blanchard [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
  [snip]
  Try replying to the group so that your contributions stay with the
  thread
  instead of being orphaned and lost.
  [/snip]
 
  I always do, did something weird happen?

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



Re: [PHP] Re: Header won't redirect

2003-09-19 Thread Curt Zirzow
* Thus wrote Jonathan Duncan ([EMAIL PROTECTED]):
 Jay,
 
 Try replying to the group so that your contributions stay with the thread
 instead of being orphaned and lost.

he did.

Curt
-- 
I used to think I was indecisive, but now I'm not so sure.

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



Re: [PHP] Re: header headers_sent BUG

2003-07-27 Thread Marek Kilimajer
read www.php.net/variables.scope

Eric Fleming wrote:
I am having some problems using variables in included files.  Can someone
please look at my code below and see how I might accomplish what I am trying
to do?
?php
 $subnav = home;
 include(incHeader.php);
?
!--- CONTENT AREA ---

The content would go here.

!--- END CONTENT AREA ---

?php include (incFooter.php); ?

Now, when I try to reference the subnav variable in the inHeader.php or
incFooter.php files, it comes up blank.  I am basically trying to adjust the
navigation on each page depending on the page I am on.  I am just learning
PHP, have programmed in ColdFusion for years and in ColdFusion this was not
a problem.  Any ideas?
Eric Fleming





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


Re: [PHP] Re: header headers_sent BUG

2003-07-23 Thread James M. Luedke
according to the php doc, online the headers are not affected by the 
Output Buffer,
so any functions that manipulate the OB should have no effect. flush I 
do not beleive
will fix this issue. (* I have tested it and it did not *)

Still need a good way to accomplish this.

Thanks, James

Ivo Fokkema wrote:

You might want to check whether or not your header output is getting
buffered. My suggestion is a flush() after the fist call. I'm not an expert
on this, it's just an idea.
HTH

--
Ivo Fokkema
PHP  MySQL programmer
Leiden University Medical Centre
Netherlands
James M. Luedke [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Hello all:
   I am having a hard time with a small piece of code. I was wondering
if someone may be able to explain why the following code will not work...
   

I
 

have been scratching my head for a few hours now and I am stumped.

?php

header(Location: http://someplace.com;);

if( ! headers_sent())
   header(Location: http://somplaceelse.com;);
?

So I would expect this  piece of code to direct me to somplace.com.
However it does not, and I always end up at somplaceelse.com.
I have done a tcpdump to assist with debugging here is the output below.
From the look of it the first header is getting ignored all toghether. Is
there some way to force changes I made to the headers, that will make
headers_sent return TRUE?
Thanks,

-James

---
GET /tracking/test.php HTTP/1.1
Host: dev.www.someplace.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0)
Gecko/20020623 Debian/1.0.0-0.woody.1
Accept:
   

text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,text/css,*/*;q=0.1
 

Accept-Encoding: gzip, deflate, compress;q=0.9
Accept-Charset: ISO-8859-1, utf-8;q=0.66, *;q=0.66
Keep-Alive: 300
Connection: keep-alive
Cookie: toolkitAccess=1
HTTP/1.1 302 Found
Date: Wed, 23 Jul 2003 10:04:55 GMT
Server: Apache/1.3.27 (Unix) mod_ssl/2.8.14 OpenSSL/0.9.6d PHP/4.3.1
mod_perl/1.27
X-Powered-By: PHP/4.3.1
Location: http://someplaceelse.com
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
---
   



 





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


RE: [PHP] Re: header(); Issue

2003-06-19 Thread Mike At Spy

I'll give one of the suggestions a whirl (or both).  I do have this same
sort of thing on a different server with a more recent version of PHP -
which is why I thought it might be a version issue. :)

-Mike


 -Original Message-
 From: Esteban Fernandez [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 19, 2003 12:41 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: header(); Issue


 Try

 header(Location: .$Relative./outstanding.php?pdd=1pddid=.$poid.);

 EF.


 Spyproductions Support Team [EMAIL PROTECTED] escribió en el
 mensaje news:[EMAIL PROTECTED]
 
  I have this in a script:
 
  header(Location: $Relative/outstanding.php?pdd=1pddid=$poid);
 
  It works fine elsewhere in the script without the variables.
 Does anyone
  know if php 4.06 has issues with this?  Or am I making a boneheaded
 mistake
  here?
 
  $Relative is from an include, and outputs fine.  :)
 
  Thanks!
 
  :)
 
  -Mike
 
 



 --
 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] Re: header()

2002-07-11 Thread Chris Hewitt

Richard Lynch wrote:


You can't upgrade somebody's stupid IE browser to Mozilla just by sending
them a new User-Agent header, no matter how attractive a solution it might
seem :-)

Now this is a Really Great Idea. Upgrade everyones' browser on the fly 
by code. We would only then have to decide on which browser...

:-)

Chris


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




Re: [PHP] Re: header()

2002-07-11 Thread Alberto Serra

ðÒÉ×ÅÔ!

 Richard Lynch wrote:

 You can't upgrade somebody's stupid IE browser to Mozilla just by sending
 them a new User-Agent header, no matter how attractive a solution it 
 might seem :-)

LOL sounds like having a supermodel pic sticked on the face of any girl 
you don't like :) Or boy, for what it matters :) Just make sure your 
glue holds properly :) Reality is not *that* virtual, yet...

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: header() and frames

2002-03-07 Thread Jason Wong

On Thursday 07 March 2002 19:49, Alan McFarlane wrote:
 Nope, that didn't work...

 Jim Winstead [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

  Alan McFarlane [EMAIL PROTECTED] wrote:
   header(location: index.php; target: _top);
 
  header(Location: index.php);
  header(Window-target: _top);

The location needs to be a full URL: 

 http://www.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
Too often I find that the volume of paper expands to fill the available
briefcases.
-- Governor Jerry Brown
*/

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




Re: [PHP] Re: header(Location:);

2001-10-30 Thread Steve Cayford


On Tuesday, October 30, 2001, at 11:41  AM, Henrik Hansen wrote:

 [EMAIL PROTECTED] (Alberto) wrote:

 Ok, it works fine for me, i can redirection, but I don't want the 
 browser to
 load another page, I want to IF A THEN RUN A.PHP, IF B THEN RUN 
 B.PHP, I
 know i can use include('a.php') or require('a.php') but I'm sure 
 theres a
 way to say php parser to run one or another script without changing 
 URL to
 the client.

 use include as you say or html frames.


Yeah, why not
if($A) {
include('a.php');
} elseif ($B) {
include('b.php');
}

 --
 Henrik Hansen

 --
 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]




Re: [PHP] Re: header function

2001-08-20 Thread speedboy

  header(Location:index.php);

header(Location: login.php);


-- 
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]