php-windows Digest 1 Feb 2005 08:49:52 -0000 Issue 2560
Topics (messages 25492 through 25500):
Re: Date Help Needed
25492 by: Jason Barnett
25493 by: Jeremy Schreckhise
25495 by: Ron.Herhuth.tatumpartners.com
Re: Timed redirection
25494 by: Jeremy Schreckhise
Re: NT username detectable?
25496 by: winnesoup
25498 by: Wagner, Aaron
25499 by: winnesoup
Re: server problem
25497 by: winnesoup
create and download file from php through ssl
25500 by: Raul IONESCU
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Ron Herhuth wrote:
I am trying to construct a function where I feed it a number such as "x"
it returns the date "x" days ago.
<?php
$format = 'l dS of F Y h:i:s A';
/** Check that "now" relative time is ok, instead of midnight */
echo date($format, strtotime("now")) . "\n";
/** If now resolves correctly, then this should work */
$x = strtotime("-1 days");
echo date($format, $x);
?>
I tried checking out several resources that give you the difference
between two dates, but not exactly what I was looking for. I was just
hoping someone had a little algorithm in their bag of tricks.
Thanks,
Ron
--
Teach a man to fish...
NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
--- End Message ---
--- Begin Message ---
You could also do:
$daystosubtract = 3;
$mydate =
(date("m/d/y",mktime(0,0,0,date("m"),date("d")-$daystosubtract,date("Y"))));
Jeremy Schreckhise
"Jason Barnett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ron Herhuth wrote:
> > I am trying to construct a function where I feed it a number such as "x"
> > it returns the date "x" days ago.
>
> <?php
>
> $format = 'l dS of F Y h:i:s A';
>
> /** Check that "now" relative time is ok, instead of midnight */
> echo date($format, strtotime("now")) . "\n";
>
> /** If now resolves correctly, then this should work */
> $x = strtotime("-1 days");
> echo date($format, $x);
>
> ?>
>
> >
> > I tried checking out several resources that give you the difference
> > between two dates, but not exactly what I was looking for. I was just
> > hoping someone had a little algorithm in their bag of tricks.
> >
> > Thanks,
> > Ron
> >
>
>
> --
> Teach a man to fish...
>
> NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
> STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
> STFM | http://www.php.net/manual/en/index.php
> STFW | http://www.google.com/search?q=php
> LAZY |
>
http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins
--- End Message ---
--- Begin Message ---
Thanks...that did the trick very nicely!
i appreciate the help.
Ron
>From: Jeremy Schreckhise
>To: [email protected]
>Sent: 01/31/2005 12:56 PM
>You could also do:
> $daystosubtract = 3;
> $mydate =
>(date("m/d/y",mktime(0,0,0,date("m"),date("d")-$daystosubtract,date("Y"))
));
>
>Jeremy Schreckhise
>
>"Jason Barnett" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> Ron Herhuth wrote:
>> > I am trying to construct a function where I feed it a number such as
"x"
>> > it returns the date "x" days ago.
>>
>> <?php
>>
>> $format = 'l dS of F Y h:i:s A';
>>
>> /** Check that "now" relative time is ok, instead of midnight */
>> echo date($format, strtotime("now")) . "\n";
>>
>> /** If now resolves correctly, then this should work */
>> $x = strtotime("-1 days");
>> echo date($format, $x);
>>
>> ?>
>>
>> >
>> > I tried checking out several resources that give you the difference
>> > between two dates, but not exactly what I was looking for. I was
just
>> > hoping someone had a little algorithm in their bag of tricks.
>> >
>> > Thanks,
>> > Ron
>> >
>>
>>
>> --
>> Teach a man to fish...
>>
>> NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
>> STFA | http://marc.theaimsgroup.com/?l=php-general&w=2
>> STFM | http://www.php.net/manual/en/index.php
>> STFW | http://www.google.com/search?q=php
>> LAZY |
>>
>http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+p
lugins
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Try:
sleep(3);
$myurl = "http://jsfree.com";
print("<script language='JavaScript'>window.location = '$myurl';
</script>");
Works for me,
Jeremy Schreckhise
"Jim MacDiarmid" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a way to programmatically add timed redirection to a page? I
have
> a page with a form on it. Once it's submitted and the data is updated in
> the database correctly, I'd like to present a status page then wait for
say
> 3 seconds before redirecting them to some other URL.
>
> I know you can do this with window.location = 'targetURL' but not sure how
> to add it. I was thinking that it might have to be added to the header,
but
> I'm using the same header template for each page.
>
> Any ideas?
>
> TIA,
>
> Jim
>
--- End Message ---
--- Begin Message ---
It's unbelievable. This question is freaking me out for a year or so and
when I started looking again for a solution Manuel made this post. Hopefully
we will finally get to an answer!!!
The internet is FULL of "supposed to be solutions" to this questions, but so
far I came out with ZIP/ NADA. Nowhere a COMPLETE and exhaustive description
of sth that worked.
Manuel states it right. Why authenticate AGAIN if you are allready
authenticated by our beloved Microsoft network ? (NTLM).
Let's just kick some xss! Let us describe how to do it and place it as a
howto somewhere on the internet.
Think of configurations like
WebServer OS: WinXP
WebServer: Apache 2 (without NTLM authentication --> no .so file found from
authenNtlm and Mod_ntlm grumbl)
Clients: WinXP
Network: win 2003 with AD
I think Manuel has also something like this otherwise he would'nt be talking
about retrieving by COM.
I can give some hints that did not work for me:
- trying locally to read %USERNAME% --> did not get it read locally
(clientside)
- $obj = new COM ("ADSystemInfo") + echo $obj.Username ==> exception error
sth that MIGHT work:
- use an IIS server to get authenticated --> there are some server variables
that you can read in ASP
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/21b3be8f-d4ed-4059-8e21-6cba2c253006.asp
now try to pass the variables needed to PHP. Can be done by hidden field in
a form. Use javascript to submit the form onload
==> this is going to be my next adventure on this level........
But it all comes down to the following:
- if you are using apache webserver in windows network there are NO working
examples to be found on the internet for single signon (at least, not that I
found).
Somebody more ideas??
feedback greatly appreciated.
----- Original Message -----
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, January 29, 2005 9:05 PM
Subject: [PHP-WIN] Re: NT username detectable?
> Hello,
>
> "Christian Fersch" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > [EMAIL PROTECTED] wrote:
> >
> > > In the html headers, the server sees the clients OS, user agent, IP
> > > address etc. Is there a way on a local LAN a server might be able to
> know
> > > the username of the client that sends a request?
> > >
> > > I've checked all $_SERVER variables, PHP_AUTH_USER etc require the
auth
> > > box to be displayed. I'm thinking it might be possible to know which
> user
> > > is logged in when the request is made, possibly by using COM or even
> > > (gasp) .NET, without having to ask the user his username.
> > >
> > > Any ideas if this can be accomplished at all?
> > >
> > > Right now we have Firefox clients and Apache with PHP in an Active
> > > Directory domain with NT4 compatibility, but we can move to IE6 with
> > > IIS+PHP if that will work.
> >
> >
> > This isn't possible with php on its own (would be deep impact into your
> > privacy if it could, wouldn't it?). So you've got 2 choices:
> > switch to IE and use a security hole :>
>
> Mozilla and Firefox already support NTLM authentication on Windows.
>
> If you configure the Web servers (IIS or even Apache not necessariliy on
> Windows) to require NTLM authentication , either Internet Explorer or
> Mozilla or Firefox will dialog with the server to authenticate via NTLM
> and no password is asked to the user that has logged in the same Windows
> domain.
>
> A PHP script for a page that requires NTLM authentication can obtain the
> authenticated user name using GetEnv("LOGON_USER"); .
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: winnesoup [mailto:[EMAIL PROTECTED]
> Sent: January 30, 2005 18:16
> To: Manuel Lemos; [email protected]
> Subject: Re: [PHP-WIN] Re: NT username detectable?
>
>
> It's unbelievable. This question is freaking me out for a
> year or so and
> when I started looking again for a solution Manuel made this
> post. Hopefully
> we will finally get to an answer!!!
>
> The internet is FULL of "supposed to be solutions" to this
> questions, but so
> far I came out with ZIP/ NADA. Nowhere a COMPLETE and
> exhaustive description
> of sth that worked.
>
> Manuel states it right. Why authenticate AGAIN if you are allready
> authenticated by our beloved Microsoft network ? (NTLM).
>
> Let's just kick some xss! Let us describe how to do it and
> place it as a
> howto somewhere on the internet.
>
> Think of configurations like
> WebServer OS: WinXP
> WebServer: Apache 2 (without NTLM authentication --> no .so
> file found from
> authenNtlm and Mod_ntlm grumbl)
> Clients: WinXP
> Network: win 2003 with AD
>
> I think Manuel has also something like this otherwise he
> would'nt be talking
> about retrieving by COM.
>
> I can give some hints that did not work for me:
> - trying locally to read %USERNAME% --> did not get it read locally
> (clientside)
> - $obj = new COM ("ADSystemInfo") + echo $obj.Username ==>
> exception error
>
> sth that MIGHT work:
> - use an IIS server to get authenticated --> there are some
> server variables
> that you can read in ASP
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/iissdk/html/21b3be8f-d4ed-4059-8e21-6cba2c253006.asp
> now try to pass the variables needed to PHP. Can be done by
> hidden field in
> a form. Use javascript to submit the form onload
> ==> this is going to be my next adventure on this level........
>
> But it all comes down to the following:
> - if you are using apache webserver in windows network there
> are NO working
> examples to be found on the internet for single signon (at
> least, not that I
> found).
>
> Somebody more ideas??
>
> feedback greatly appreciated.
>
>
>
> ----- Original Message -----
> From: "Manuel Lemos" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Saturday, January 29, 2005 9:05 PM
> Subject: [PHP-WIN] Re: NT username detectable?
>
>
> > Hello,
> >
> > "Christian Fersch" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > [EMAIL PROTECTED] wrote:
> > >
> > > > In the html headers, the server sees the clients OS,
> user agent, IP
> > > > address etc. Is there a way on a local LAN a server
> might be able to
> > know
> > > > the username of the client that sends a request?
> > > >
> > > > I've checked all $_SERVER variables, PHP_AUTH_USER etc
> require the
> auth
> > > > box to be displayed. I'm thinking it might be possible
> to know which
> > user
> > > > is logged in when the request is made, possibly by
> using COM or even
> > > > (gasp) .NET, without having to ask the user his username.
> > > >
> > > > Any ideas if this can be accomplished at all?
> > > >
> > > > Right now we have Firefox clients and Apache with PHP
> in an Active
> > > > Directory domain with NT4 compatibility, but we can
> move to IE6 with
> > > > IIS+PHP if that will work.
> > >
> > >
> > > This isn't possible with php on its own (would be deep
> impact into your
> > > privacy if it could, wouldn't it?). So you've got 2 choices:
> > > switch to IE and use a security hole :>
> >
> > Mozilla and Firefox already support NTLM authentication on Windows.
> >
> > If you configure the Web servers (IIS or even Apache not
> necessariliy on
> > Windows) to require NTLM authentication , either Internet
> Explorer or
> > Mozilla or Firefox will dialog with the server to
> authenticate via NTLM
> > and no password is asked to the user that has logged in the
> same Windows
> > domain.
> >
> > A PHP script for a page that requires NTLM authentication
> can obtain the
> > authenticated user name using GetEnv("LOGON_USER"); .
> > --
> >
> > Regards,
> > Manuel Lemos
Try this site. I've set it up in a test environment and it seems to work
http://twiki.org/cgi-bin/view/Codev/WindowsInstallModNTLM
--- End Message ---
--- Begin Message ---
thnx Manuel for your reply.
Problem is, no "binary" found so far for mod_ntlm. And then it turns out you
need mod_auth_sspi for Apache 2.x
After more reading found this article at the internet:
http://twiki.org/cgi-bin/view/Codev.WindowsInstallModNTLM
points to apache on windows configurations. finally. Now trying to find the
time to try it out.
Problem with authentication is known as "transparent authentication".
----- Original Message -----
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: "winnesoup" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Monday, January 31, 2005 5:12 AM
Subject: Re: [PHP-WIN] Re: NT username detectable?
> Hello,
>
> on 01/30/2005 09:16 PM winnesoup said the following:
> > Manuel states it right. Why authenticate AGAIN if you are allready
> > authenticated by our beloved Microsoft network ? (NTLM).
>
> That is not exactly what I am saying. NTLM is the name of an
> authentication method used in many protocols including HTTP, SMTP, POP3.
> It is most common naturally under Windows, but you can also use it with
> non-Windows machines.
>
> What I am trying to tell you is that even when you are already logged on
> Windows, when you access to an HTTP server that requires NTLM
> authentication, there is an exchange of information between the server
> and client so your password is never sent over the network unencoded,
> even less in plain text.
>
> Internet Explorer (or Mozilla or Firefox) just uses information already
> obtained during the Windows logon to respond to the NTLM authentication
> HTTP request to the same Windows domain without asking your the same
> password again.
>
>
> > now try to pass the variables needed to PHP. Can be done by hidden field
in
> > a form. Use javascript to submit the form onload
> > ==> this is going to be my next adventure on this level........
>
> I don't know what you are suggesting but under PHP you just need to call
> GetEnv("LOGON_USER") to get the user name of a successfully
> authenticated user.
>
>
> > But it all comes down to the following:
> > - if you are using apache webserver in windows network there are NO
working
> > examples to be found on the internet for single signon (at least, not
that I
> > found).
>
> You just need to use mod_ntlm with Apache. The Apache does not even need
> to be running on Windows. You just need to configure mod_ntlm to let it
> know the Windows domain controllers for the domain of the users that you
> want to authenticate.
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
--- End Message ---
--- Begin Message ---
There is a PEAR package for this. Search for PEAR ping() at pear.php.net
good luck
----- Original Message -----
From: "Ross Hulford" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 26, 2005 7:09 PM
Subject: [PHP-WIN] server problem
> I want to write a script that will check if the server is down if it is I
> want to redirect the user to another site, the backup server.
>
> Similarly I want users who go on to the seondary site when the main server
> is UP to be redirected to the main site.
>
> Can this be done using PHP. If not can you point me in the right
direction?
>
> Kind regards,
>
>
> Ross Hulford
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Does anyone know how to output a file (which is automatically downloaded
under normally http protocol by using HTTP headers) through SSL?
I suppose by using CURL but Ia**m not sure how.
---------------------------------------------------------------
Posteaza gratuit anunturi de orice dimensiune si ai audienta de sute de mii,
lunar.
--- End Message ---