php-general Digest 11 Jul 2012 16:39:38 -0000 Issue 7883
Topics (messages 318418 through 318424):
Re: Session Checking
318418 by: Tedd Sperling
Re: Quem esta por dentro de PSR?
318419 by: Daniel Brown
318420 by: Volmar Machado
318421 by: Daniel Brown
Re: exec to launch putty.exe for telnet
318422 by: Hans Ã
hlin
Re: [PHP-DEV] SQLite - Unwanted values using group-by
318423 by: Simon Schick
Find match of string if only at end of string
318424 by: Marc Guay
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On Jul 9, 2012, at 2:40 PM, Floyd Resler <fres...@adex-intl.com> wrote:
> I want to have an alert pop up to let the user know their session is about to
> expire. Would the best approach be to do a timer in Javascript or check it
> in PHP. I'm storing session data in a MySQL database so I can know when a
> session will expire. If I check it through PHP will the session expiration
> refresh when I check it?
>
> Thanks!
> Floyd
Floyd:
If this was my problem, my solution would be:
1. A PHP script that recorded (via MySQL) the date/time when the user
successfully accessed something private (i.e., password protected).
2. The next time the user requested protected-access again, I would have the
script look at the last time the user accessed this data and see IF the time
period between accesses (then and now) exceeded an established time limit. If
so, then deny access. If not, then reset the timer and allow access.
That's the way it would work on the server-side.
However, the server-side really has no efficient way to notify the user their
session is "about" to expire -- instead that should take place client-side and
without question, you'll need a client-side JavaScript timer.
The client-side timer simply preforms a count-down and notifies the user when
their session is about to expire.
The important thing to realize here is that the client-side and server-side
scripts have no communication between each other nor is any needed other than
when to start the count-down. The two scripts are separate, but are working in
"apparent" concert.
The server-side script will be the ultimate decider of IF the user's session
has timed out or not. The client-side script only notifies the user of the
count-down and nothing else.
HTH's
tedd
PS: Arby's?
_____________________
t...@sperling.com
http://sperling.com
--- End Message ---
--- Begin Message ---
2012/7/10 Volmar Machado <qi.vol...@gmail.com>:
> Nao sei se sabem, mas tem uma galera implemantendo PSR-X, que sao
> padroes para desenvolvimento em PHP. Gostaria de saber o que pensam
> disso :)
Eu não sei, mas não é realmente uma questão de PHP, e isso é
realmente apenas uma lista de discussão Inglês.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
Sorry, I sent to wrong list :/
Em 10 de julho de 2012 11:05, Daniel Brown <danbr...@php.net> escreveu:
> 2012/7/10 Volmar Machado <qi.vol...@gmail.com>:
>> Nao sei se sabem, mas tem uma galera implemantendo PSR-X, que sao
>> padroes para desenvolvimento em PHP. Gostaria de saber o que pensam
>> disso :)
>
> Eu não sei, mas não é realmente uma questão de PHP, e isso é
> realmente apenas uma lista de discussão Inglês.
>
>
> --
> </Daniel P. Brown>
> Network Infrastructure Manager
> http://www.php.net/
--- End Message ---
--- Begin Message ---
2012/7/10 Volmar Machado <qi.vol...@gmail.com>:
> Sorry, I sent to wrong list :/
No apologies necessary.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
2012/7/3 Devang Patel <devan...@gmail.com>
> Hello Experts,
>
> I have putty.exe on my desktop so if I will go to command prompt and then
> to C:\Documents and Settings\user\Desktop location and execute following
> command it will launch the Putty window of telnet connection to server
> specified:
>
> putty.exe telnet://10.3.215.15/
>
>
>
> I am trying to launch the putty to telnet to specific server using
> following but its not working for me:
>
> <?php
> $securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe
> telnet://
> 10.3.215.15/ ";
>
>
> exec($securecrt);
> ?>
>
> If I try following then it launches the putty application but will have to
> provide the host name or IP to login:
>
> <?php
> $securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe ";
>
>
> exec($securecrt);
> ?>
>
> Not sure if I am missing something very basic, It will be great if someone
> can help with this.
>
> Thanks,
> Devang
>
Try Putting an extra " at the beginning and the end of the string. you have
a white space in the exec call and it will chop of the string after it.
$securecrt = "\"C:\\Documents and Settings\\user\\Desktop\\putty.exe
telnet://
10.3.215.15/\"";
--
**********************************************
Hans Åhlin
Tel: +46761488019
icq: 275232967
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
--- End Message ---
--- Begin Message ---
On Sun, Jul 8, 2012 at 12:33 AM, Matijn Woudt <tijn...@gmail.com> wrote:
>
> Both of the results are valid outcomes. I think you don't understand
> the GROUP BY clause well enough. The parameters in the SELECT clause,
> should be either
> 1) an aggregate function (like the max function you're using)
> 2) one of the parameters in the GROUP BY clause.
> If not one of the above, it will return 'random' values for r.month
> and r.year. (probably the first it finds, which might differ in your
> test cases)
>
> - Matijn
Hi, Matijn
But I think you get what I mean, when I say that max() should only
point to one row, in this case the one with the latest date ;)
How is it possible to, for sure, get the data of this rows?
Btw: Here's someone talking about that ... Out of reading this, it
should work as expected.
http://stackoverflow.com/questions/1752556/is-it-safe-to-include-extra-columns-in-the-select-list-of-a-sqlite-group-by-quer#answers
Bye
Simon
--- End Message ---
--- Begin Message ---
Hi folks,
I'm trying to compare two strings in order to determine whether or not
the site is just switching languages on the same page or whether the
link is pointing to an entirely different page. Things were fine
until I realized I was getting false positives for subpages, where the
URLs matched.
Previous code example:
if (strpos('http://domain.com/fr/about/page/', '/about/page/') > -1){
$same_page = true;
}
As you can see this logic is not strong enough to deal with:
if (strpos(http://domain.com/about/page/subpage/', '/about/page/') > -1){
$same_page = true;
}
As it is not the same page. I've looked into strrpos() and tried to
use the negative offset as the length of the needle, but unfortunately
it searches backwards from the offset and not forwards. Any ideas?
Marc
--- End Message ---