[PHP] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Michael Jurgens

Hi,
Now that register_globals is (or will be) OFF by default (just like
error_reporting) I'm facing a huge rewrite of existing code if my hosting
provider decides that he wants to upgrade his php (and believe me, he will
use default settings)

Is there any way to override register_globals and error_reporing runtime in
your PHP script?
(there is no way that I can use .htaccess to override :-((

Any help would be much appreciated!




-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Jack Dempsey

a quick and inelegant hack
4.1 includes an array that has all of the data sent to the script...(or use
the different ones like $_GET etc if need be) then write a globalize function
that extracts the vars and declares them global...then use this snippet in an
auto_prepend file to magically register the vars
there's probably a much easier way, including asking your hosting provider to
change one little config var...

jack

Michael Jurgens wrote:

 Hi,
 Now that register_globals is (or will be) OFF by default (just like
 error_reporting) I'm facing a huge rewrite of existing code if my hosting
 provider decides that he wants to upgrade his php (and believe me, he will
 use default settings)

 Is there any way to override register_globals and error_reporing runtime in
 your PHP script?
 (there is no way that I can use .htaccess to override :-((

 Any help would be much appreciated!

 --
 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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Richard Heyes

 a quick and inelegant hack
 4.1 includes an array that has all of the data sent to the 
 script...(or use
 the different ones like $_GET etc if need be) then write a 
 globalize function
 that extracts the vars and declares them global...then use this 

Or use extract().

-- 
Richard Heyes
If you have any trouble sounding condescending,
find a Unix user to show you how it's done. - Scott Adams 

-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Michael Jurgens

Thank you for your answers.
The hack seems the way to go, but I haven't found anything like this on the
net. Presumably because the 'problem' is so new...

I have absolutely no control over my hosting providers settings, and I wish
PHP 4.10 would just understand something like set_register_globals

I haven't got that much experience with playing with variables at this
level.
What would do the trick is something like this:

for all in $_GET
{
$[varname] = $_GET[varname]
}

Could anyone give me some pointers in actually programming this?

Many thanks,
Michael


Richard Heyes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  a quick and inelegant hack
  4.1 includes an array that has all of the data sent to the
  script...(or use
  the different ones like $_GET etc if need be) then write a
  globalize function
  that extracts the vars and declares them global...then use this

 Or use extract().

 --
 Richard Heyes
 If you have any trouble sounding condescending,
 find a Unix user to show you how it's done. - Scott Adams



-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Jack Dempsey

exactly...in the function you'd have to extract the variables then globalize
them...
or you could loop through the arrays and store the keys and values in the
globals array...that loop should be simple...

jack

-Original Message-
From: Richard Heyes [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 4:54 PM
To: Jack Dempsey; Michael Jurgens
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] PHP 4.10: any way to override register_globals = OFF


 a quick and inelegant hack
 4.1 includes an array that has all of the data sent to the
 script...(or use
 the different ones like $_GET etc if need be) then write a
 globalize function
 that extracts the vars and declares them global...then use this

Or use extract().

--
Richard Heyes
If you have any trouble sounding condescending,
find a Unix user to show you how it's done. - Scott Adams


-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Richard Heyes

 for all in $_GET
 {
 $[varname] = $_GET[varname]
 }
 
 Could anyone give me some pointers in actually programming this?

extract($_GET);

-- 
Richard Heyes
If you have any trouble sounding condescending,
find a Unix user to show you how it's done. - Scott Adams 

-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Charles Williams

Jack

$_GET is automatically global to all scopes.  No need to globalize.

chuck

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Michael Jurgens [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 10:49 PM
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


 a quick and inelegant hack
 4.1 includes an array that has all of the data sent to the script...(or
use
 the different ones like $_GET etc if need be) then write a globalize
function
 that extracts the vars and declares them global...then use this snippet in
an
 auto_prepend file to magically register the vars
 there's probably a much easier way, including asking your hosting provider
to
 change one little config var...

 jack

 Michael Jurgens wrote:

  Hi,
  Now that register_globals is (or will be) OFF by default (just like
  error_reporting) I'm facing a huge rewrite of existing code if my
hosting
  provider decides that he wants to upgrade his php (and believe me, he
will
  use default settings)
 
  Is there any way to override register_globals and error_reporing runtime
in
  your PHP script?
  (there is no way that I can use .htaccess to override :-((
 
  Any help would be much appreciated!
 
  --
  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]



-- 
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Jack Dempsey

i understand that, but if he extracts inside a function, those variables
will be in that scope.
if his auto_prepend file is simply 'extract($_GET)' then that'd be fine as
well

jack

-Original Message-
From: Charles Williams
[mailto:[EMAIL PROTECTED]]
Sent: Monday, December 17, 2001 5:59 PM
To: Jack Dempsey; Michael Jurgens
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


Jack

$_GET is automatically global to all scopes.  No need to globalize.

chuck

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Michael Jurgens [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, December 17, 2001 10:49 PM
Subject: Re: [PHP] PHP 4.10: any way to override register_globals = OFF


 a quick and inelegant hack
 4.1 includes an array that has all of the data sent to the script...(or
use
 the different ones like $_GET etc if need be) then write a globalize
function
 that extracts the vars and declares them global...then use this snippet in
an
 auto_prepend file to magically register the vars
 there's probably a much easier way, including asking your hosting provider
to
 change one little config var...

 jack

 Michael Jurgens wrote:

  Hi,
  Now that register_globals is (or will be) OFF by default (just like
  error_reporting) I'm facing a huge rewrite of existing code if my
hosting
  provider decides that he wants to upgrade his php (and believe me, he
will
  use default settings)
 
  Is there any way to override register_globals and error_reporing runtime
in
  your PHP script?
  (there is no way that I can use .htaccess to override :-((
 
  Any help would be much appreciated!
 
  --
  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]



--
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] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread Michael Jurgens

Hey Guys,
Thanks a lot, I allways use some config files that I include in every page,
and with
extract ($_REQUEST); added to one of those files, almost all of my
problems are history.
I'm now working on getting $PHP_SELF etc back working, but that should work
out.

Amazing this newsgroup, thank you all,
Greetz,
Michael

Richard Heyes [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  for all in $_GET
  {
  $[varname] = $_GET[varname]
  }
 
  Could anyone give me some pointers in actually programming this?

 extract($_GET);

 --
 Richard Heyes
 If you have any trouble sounding condescending,
 find a Unix user to show you how it's done. - Scott Adams



-- 
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: Re: [PHP] PHP 4.10: any way to override register_globals = OFF

2001-12-17 Thread David

 you can do this to get what u want:

foreach($_GET as $key = $val){
$$key = $val;
}

this is what u want to do, right? :)
for all in $_GET 
{ 
$[varname] = $_GET[varname] 
} 

-- 
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] Is there a way to Unset environment variables ?

2001-12-14 Thread J.F.Kishor

hello all,

I have got a problem I want to remove one or more evvironment variables
from those passed by apache authentication.

 eg : $PHP_AUTH_USER, $PHP_AUTH_PW, REMOTE_USER and similar ones

I went through apache documentation and I found some options like

PassEnv, SetEnv and UnsetEnv, is there anything as such in php to do
 similar jobs. please help me out to solve this problem.

Thanks a lot for spending time for my mail.

with regards,
- JFK
kishor
Nilgiri Networks








-- 
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] Re: Any easy way of finding yesterday...?

2001-11-13 Thread Harry Lau

Following is a solution...

$now = getdate();
$today = date(d-m-Y);
$yesterday =
date(d-m-Y,mktime(0,0,0,$today['mon'],$today['mday']-1,$today['year']);
echo(Today is  . $today . and yesterday was  . $yesterday);

Harry Lau [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It is easy to use the function getDate() to obtain the date of today.
 But instead of writing plenty of conditions,
 is there any easy way to get the date of yesterday?
 Thank you.





-- 
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] Re: Any easy way of finding yesterday...?

2001-11-13 Thread Harry Lau

Oh what a big mistake...sorry!

$now = getdate();
$today = date(d-m-Y);
$yesterday =
date(d-m-Y,mktime(0,0,0,$now['mon'],$now['mday']-1,$now['year']);
echo(Today is  . $today . and yesterday was  . $yesterday);

Harry Lau [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Following is a solution...

 $now = getdate();
 $today = date(d-m-Y);
 $yesterday =
 date(d-m-Y,mktime(0,0,0,$today['mon'],$today['mday']-1,$today['year']);
 echo(Today is  . $today . and yesterday was  . $yesterday);

 Harry Lau [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  It is easy to use the function getDate() to obtain the date of today.
  But instead of writing plenty of conditions,
  is there any easy way to get the date of yesterday?
  Thank you.
 
 





-- 
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] Re: Any easy way of finding yesterday...?

2001-11-13 Thread Henrik Hansen

[EMAIL PROTECTED] (Harry Lau) wrote:

  It is easy to use the function getDate() to obtain the date of today.
  But instead of writing plenty of conditions,
  is there any easy way to get the date of yesterday?

echo date(m-d-Y, mktime(0,0,0,date(n), date(d)-1, date(Y)));

-- 
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] Re: Any easy way of finding yesterday...?

2001-11-13 Thread _lallous

strtotime('yesterday') should work!

Harry Lau [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It is easy to use the function getDate() to obtain the date of today.
 But instead of writing plenty of conditions,
 is there any easy way to get the date of yesterday?
 Thank you.





-- 
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] Is there a way not to pop up the default login window?

2001-11-01 Thread Zhu George-CZZ010


If we are using the default Apache/PHP authentication, it will always pop up the 
default login window for login user ID /password.   Is there a method to redirect to a 
customized PHP login page instead of the default pop up window?

Thanks ahead.

-- 
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] Is there a way not to pop up the default login window?

2001-11-01 Thread Jon Haworth

Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
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] Is there a way not to pop up the default login window?

2001-11-01 Thread Zhu George-CZZ010


Thanks for the suggestion. I think I didn't explain it clearly, what I really want to 
do is: whenever someone types any of the secured URL (it might be any secured php page 
or other files), how can we configure the server to automatically redirect to a 
customized PHP login page instead of popping up the default login window?

Regards.



-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 11:36 AM
To: 'Zhu George-CZZ010'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?


Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or confidentiality'

**

-- 
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] Is there a way not to pop up the default login window?

2001-11-01 Thread Jon Haworth

if (!isset ($PHP_AUTH_USER)) { 
header (Location: http://mydomain.com/mypage;);
}

would probably do the trick

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:51
To: Jon Haworth; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?



Thanks for the suggestion. I think I didn't explain it clearly, what I
really want to do is: whenever someone types any of the secured URL (it
might be any secured php page or other files), how can we configure the
server to automatically redirect to a customized PHP login page instead of
popping up the default login window?

Regards.



-Original Message-
From: Jon Haworth [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 11:36 AM
To: 'Zhu George-CZZ010'; [EMAIL PROTECTED]
Subject: RE: [PHP] Is there a way not to pop up the default login
window?


Yep. Design your own form, and feed the data from that to $PHP_AUTH_USER and
$PHP_AUTH_PW. Don't send the header() for the 403.

Cheers
Jon


-Original Message-
From: Zhu George-CZZ010 [mailto:[EMAIL PROTECTED]]
Sent: 01 November 2001 17:18
To: [EMAIL PROTECTED]
Subject: [PHP] Is there a way not to pop up the default login window?



If we are using the default Apache/PHP authentication, it will always
pop up the default login window for login user ID /password.   Is there a
method to redirect to a customized PHP login page instead of the default pop
up window?

Thanks ahead.


**
'The information included in this Email is of a confidential nature and is 
intended only for the addressee. If you are not the intended addressee, 
any disclosure, copying or distribution by you is prohibited and may be 
unlawful. Disclosure to any party other than the addressee, whether 
inadvertent or otherwise is not intended to waive privilege or
confidentiality'

**

-- 
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] is there a way of using fnctl locks from php?

2001-10-29 Thread Richard Hollis

flock does not work because works differently.

is there a way to access fnctl locking directly from 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]




[PHP] Best [non-PHP] way to redirect a browser

2001-10-26 Thread René Fournier

This is really I guess a non-PHP question, so please excuse...

What is the most reliable, browser-safe way to redirect the browser from a
default index.html to, say, index.php?  The I'm doing it now is with the
following javascript:

script type=text/javascript language=Javascript
document.location=index.php
/script

And it works, but I wanted to know if any of you are using a better [more
compatible] way of redirecting the browser (say, if it doesn't have
JavaScript (!?)).

...Rene

---
Rene Fournier
[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] Best [non-PHP] way to redirect a browser

2001-10-26 Thread Richard S. Crawford

You might try META tags.  Put this in the head section of your index.html file:

  meta http-equiv=refresh content=0; url=index.php 

If the user has JavaScript disabled, you're probably best off using a link 
and letting the user click through.

You may also be able to adjust your Apache or IIS or whatever configuration 
to load index.php by default, and even eliminated index.html 
altogether.  That's what I wound up doing, and I have experienced no problems.


At 10:25 AM 10/26/2001, René Fournier wrote:
This is really I guess a non-PHP question, so please excuse...

What is the most reliable, browser-safe way to redirect the browser from a
default index.html to, say, index.php?  The I'm doing it now is with the
following javascript:

script type=text/javascript language=Javascript
document.location=index.php
/script

And it works, but I wanted to know if any of you are using a better [more
compatible] way of redirecting the browser (say, if it doesn't have
JavaScript (!?)).

...Rene

---
Rene Fournier
[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]


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
It is only with the heart that we see rightly; what is essential is 
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!


--
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] Best [non-PHP] way to redirect a browser

2001-10-26 Thread Mike Eheler

Before any of your HTML code, put in:

header('Location: index.php');

If anything has been sent to the browser yet (through echo/print/etc, or 
through code outside of the ?php ? tags), though, you will get an error.

Mike

René Fournier wrote:

This is really I guess a non-PHP question, so please excuse...

What is the most reliable, browser-safe way to redirect the browser from a
default index.html to, say, index.php?  The I'm doing it now is with the
following javascript:

script type=text/javascript language=Javascript
document.location=index.php
/script

And it works, but I wanted to know if any of you are using a better [more
compatible] way of redirecting the browser (say, if it doesn't have
JavaScript (!?)).

...Rene

---
Rene Fournier
[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] Best [non-PHP] way to redirect a browser

2001-10-26 Thread Ashley M. Kirchner

René Fournier wrote:

 And it works, but I wanted to know if any of you are using a better [more
 compatible] way of redirecting the browser (say, if it doesn't have
 JavaScript (!?)).

If you're using Apache, add 'index.php' to the DirectoryIndex option in
httpd.conf.  Then you can remove index.html all together

--
W | I haven't lost my mind; it's backed up on tape somewhere.
  +
  Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
  IT Director / SysAdmin / WebSmith . 800.441.3873 x130
  Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
  http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A.



-- 
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] Best [non-PHP] way to redirect a browser

2001-10-26 Thread Kurt Lieber

On Friday 26 October 2001 10:25, you wrote:
 What is the most reliable, browser-safe way to redirect the browser from a
 default index.html to, say, index.php?  The I'm doing it now is with the
 following javascript:

The most reliable, browser-safe, non-PHP way to redirect mail is to do it 
server-side.  If you're using Apache, check out mod_rewrite -- it will do 
exactly what you're looking for.  Otherwise, I believe IIS has similar 
facilities built into it.

--kurt

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




[Fwd: [PHP] Best [non-PHP] way to redirect a browser]

2001-10-26 Thread Mike Eheler

Right. My bad.

Heh, I have an excuse.. it's before noon here ;)

Definitely go with the meta approach, then:

Example:

html
head
meta http-equiv=refresh content=0; url=index.php /
/head
body
a href=index.phpClick here to enter the site/a
/body
/html

Mike




this wouldn't work from an index.html page unless html pages were set up to 
parse as php file...

At 10:35 AM 10/26/2001 -0700, you wrote:
Before any of your HTML code, put in:

header('Location: index.php');

If anything has been sent to the browser yet (through echo/print/etc, or 
through code outside of the ?php ? tags), though, you will get an error.

Mike

René Fournier wrote:

This is really I guess a non-PHP question, so please excuse...

What is the most reliable, browser-safe way to redirect the browser from a
default index.html to, say, index.php?  The I'm doing it now is with the
following javascript:

script type=text/javascript language=Javascript
document.location=index.php
/script

And it works, but I wanted to know if any of you are using a better [more
compatible] way of redirecting the browser (say, if it doesn't have
JavaScript (!?)).

...Rene

---
Rene Fournier
[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 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] Is there a way to override safe mode to be able to read a etc/passwd file

2001-09-22 Thread Richard Kurth

How can I read the /etc/passwd file when safe mode is turned on. is
there a work around on this. Hear is a function I use to check if a
username is already in use on the system. This works fine when safe
mode is off but when it is on it gives this error.
Warning: SAFE MODE Restriction in effect. The script whose uid is 110 is not allowed 
to access /etc/passwd
owned by uid 0 in /home/sites/home/inc/function.inc on line 462
Warning: file(/etc/passwd) - Success in /home/sites/home/inc/function.inc on line 462


function pass() {
$pass=file(/etc/passwd);
for ($i=0; $icount($pass); $i++) {
  $pwentries=explode(:,$pass[$i]);
  if ($username == $pwentries[0]) {
 print_error(
h2The Username $Username is already being used on this system/h2 );
   exit;
}}
}








Best regards,
 Richard  
mailto:[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] Programming PHP in a modular way

2001-04-30 Thread Andreas Pucko

Hello,

I am a newi in PHP. Currently I am creating my first site.

I would like to programm it modularly. I tryed it, but I came to the point,
that I have everything in one file with a huge amount of tables.

What would be the best way to build a site with a navigation on the left and
content on the right.

The question is.. what is the proper syntax to open the next content from
the menu. Open it in
the same file, or open a new one??

Thanks

Andy


-- 
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] Programming PHP in a modular way

2001-04-30 Thread Jason Beebe

---This is header.php
html
head
titleMy Site/title
/head
body
table width=100% border=0
trtd colspan=2
img src=images/mybanner.gif//this is the banner/header img
/td/tr
trtd width=175   //this is where the left navigation
goes
a href=about.phpAbout Us/abr  // a link
more links here
/td
td
 end header.php---

---start footer.php 

/td
/tr
/table
table width=100%
trtd
center Footer Here, Copyright Etc.
/td
/tr
/table
/body
/html

 end footer.php -

---index.php (or any other page) 
?
include('header.php');  //include the header
?

the body (large space right of the nav) goes here.

?
include('footer.php'); //include the footer
?
 end index.php -

easy cheesey. just break up the html logically. you don't need it all in one
file. break up pages like you would static html. hope this was what you were
wanting to know.

 -Original Message-
 From: Andreas Pucko [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 30, 2001 4:08 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Programming PHP in a modular way


 Hello,

 I am a newi in PHP. Currently I am creating my first site.

 I would like to programm it modularly. I tryed it, but I came to
 the point,
 that I have everything in one file with a huge amount of tables.

 What would be the best way to build a site with a navigation on
 the left and
 content on the right.

 The question is.. what is the proper syntax to open the next content from
 the menu. Open it in
 the same file, or open a new one??

 Thanks

 Andy


 --
 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] Programming PHP in a modular way

2001-04-30 Thread Michael Hall


Use include();

Mick

On Mon, 30 Apr 2001, Andreas Pucko wrote:

 Hello,
 
 I am a newi in PHP. Currently I am creating my first site.
 
 I would like to programm it modularly. I tryed it, but I came to the point,
 that I have everything in one file with a huge amount of tables.
 
 What would be the best way to build a site with a navigation on the left and
 content on the right.
 
 The question is.. what is the proper syntax to open the next content from
 the menu. Open it in
 the same file, or open a new one??
 
 Thanks
 
 Andy
 
 
 -- 
 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]




[PHP] Newsletter on the way..stuck in the moment!

2001-04-06 Thread Dhaval Desai

Hi!

Well, I want to send an email to about 300 people. The
problem is that if I use  this method people can see
all the email address of the people whoever it is sent
to.


?php

$connect = mysql_connect();
$query = "select email from news";
$execute = mysql_db_query("uaegraduate", $query);
while($r = mysql_fetch_array($execute))
{
$email = $r['email'];
$add .= $email . ",";
}


$headers = "From:
[EMAIL PROTECTED][EMAIL PROTECTED]\n";
$headers .= "Content-Type: text/html;
charset=iso-8859-1\n"; 

$subject = "hey";
$to = "$add";
$mailmessage = "hey this is the message";

$mailsomeone = mail($to, $subject, $mailmessage,
$headers);

if($mailsomeone)
{
echo "Success";
}

?


If I use the above method, all the email  address will
apear in the to: like this:-
To:[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED] 

and goes on for 300 entries.


Is there any way I can stop this from happening yet
the mails reaching their destination.


Thank You

Cheers!~
Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

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




Re: [PHP] Newsletter on the way..stuck in the moment!

2001-04-06 Thread Steve Werby

"Dhaval Desai" [EMAIL PROTECTED] wrote:
 Well, I want to send an email to about 300 people. The
 problem is that if I use  this method people can see
 all the email address of the people whoever it is sent
 to.

Add the addresses to the bcc: field instead of the to: field.  I believe
this is covered in an example right in the manual.  See mail() in the manual
online.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




RE: [PHP] Newsletter on the way..stuck in the moment!

2001-04-06 Thread Boaz Yahav

300 recipients is allot. I would not use a script for so many.
Why don't you use a program that was designed to send
many emails such as Group Mail : 

http://www.sellshareware.com/CustomView.asp?PrID=34604AfID=2407PageID=1

I use it to send mail to tens of thousands of recipients and it's great.

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.
 

-Original Message-
From: Steve Werby [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 06, 2001 8:41 PM
To: Dhaval Desai; [EMAIL PROTECTED]
Subject: Re: [PHP] Newsletter on the way..stuck in the moment!


"Dhaval Desai" [EMAIL PROTECTED] wrote:
 Well, I want to send an email to about 300 people. The
 problem is that if I use  this method people can see
 all the email address of the people whoever it is sent
 to.

Add the addresses to the bcc: field instead of the to: field.  I believe
this is covered in an example right in the manual.  See mail() in the manual
online.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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

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




Re: [PHP] Newsletter on the way..stuck in the moment!

2001-04-06 Thread Miles Thompson


BCC - blind carbon copy
Miles

At 11:23 AM 4/6/01 -0700, Dhaval Desai wrote:
Hi!

Well, I want to send an email to about 300 people. The
problem is that if I use  this method people can see
all the email address of the people whoever it is sent
to.


?php

$connect = mysql_connect();
$query = "select email from news";
$execute = mysql_db_query("uaegraduate", $query);
while($r = mysql_fetch_array($execute))
{
$email = $r['email'];
$add .= $email . ",";
}


$headers = "From:
[EMAIL PROTECTED][EMAIL PROTECTED]\n";
$headers .= "Content-Type: text/html;
charset=iso-8859-1\n";

$subject = "hey";
$to = "$add";
$mailmessage = "hey this is the message";

$mailsomeone = mail($to, $subject, $mailmessage,
$headers);

if($mailsomeone)
{
echo "Success";
}

?


If I use the above method, all the email  address will
apear in the to: like this:-
To:[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]

and goes on for 300 entries.


Is there any way I can stop this from happening yet
the mails reaching their destination.


Thank You

Cheers!~
Dhaval Desai

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

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


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




Re: [PHP] is there a way to set apache's auth_user from php?

2001-02-23 Thread Richard Lynch

 I would like to have the authenticated user name
 appear in my apache access web logs but I am not using
 HTTP authentication.  I am using phplib to have better
 control over the authentication process.
 Is there a way to set this apache api variable
 from php code so that apache will log these user names?

I think not.

That variable is sent/set by the *browser* to Apache on each URL request.

What you *could* do is log stuff yourself from PHP using
http://php.net/error-log

You could log the time, their IP, and their user_agent using that, and then
later mix-and-match those entries with Apache entries to figure out who
asked for what.

For that matter, you could turn off Apache logging, and use PHP's to log
everything you need.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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] is there a way to set apache's auth_user from php?

2001-02-22 Thread Bob Mroczka

I would like to have the authenticated user name
appear in my apache access web logs but I am not using
HTTP authentication.  I am using phplib to have better
control over the authentication process.
Is there a way to set this apache api variable
from php code so that apache will log these user names?

Bob

-- 
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] Is there a way to call php functions in perl? and vice versa

2001-02-08 Thread Richard Lynch

 Is there a way to call php functions in perl? or call perl functions from
 PHP codes?

?php
exec("/full/path/to/script.pl", $output, $error);
while (list(,$line) = each($output)){
echo $line, "BR\n";
}
if ($error){
echo "OS Error: $error.  Usually path/permissions.BR\n";
}
?

Perl could call PHP the same way it calls anything (which I can say blithely
since I have no clue how that is), but you'll need to install PHP as a
stand-alone binary (aka CGI) or make Perl call wget or lynx to surf to a PHP
page.

[It's kinda like if you had mod_perl installed but *not* Perl itself... PHP
compiled as "CGI" is akin to Perl itself.  Except better, of course. :-)]

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
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] Is there a way to call php functions in perl? and vice versa

2001-02-06 Thread david klein

Is there a way to call php functions in perl? or call perl functions from 
PHP codes?

Thanks,
David
_
Get your FREE download of MSN Explorer at http://explorer.msn.com


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




Re: [PHP] Programming the Hard Way?

2001-01-27 Thread Rasmus Lerdorf

 Am I programming the hard way?

 I *always* parse my strings like this...

 mysql_query("SELECT * FROM table WHERE id='".$id."'");

 Could I just do this?

 mysql_query("SELECT * FROM table WHERE id='$id'");

 If so, is this compatable across all platforms and versions of PHP?

Yes


-- 
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] Programming the Hard Way?

2001-01-27 Thread Steve Werby

"[ rswfire ]" [EMAIL PROTECTED] wrote"
 Am I programming the hard way?
 mysql_query("SELECT * FROM table WHERE id='".$id."'");

 Could I just do this?
 mysql_query("SELECT * FROM table WHERE id='$id'");

Yes.  And if $id is always numeric you could simplify it even more.  Quotes
are only needed around strings.  They aren't needed around numbers.  If you
surround a number in quotes it's treated as a string which will result in
different behavior when doing sorting and  or  comparisons.

mysql_query( "SELECT * FROM table WHERE id=$id " );

--
Steve Werby
COO
24-7 Computer Services, LLC
Tel: 804.817.2470
http://www.247computing.com/


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




<    1   2   3   4   5