php-general Digest 9 Nov 2008 12:59:04 -0000 Issue 5781

Topics (messages 283102 through 283114):

Re: strtotime
        283102 by: Ashley Sheridan
        283106 by: Lester Caine
        283107 by: gilles
        283108 by: Thodoris

PHP - Web/list Question...
        283103 by: bruce
        283104 by: Wolf
        283105 by: Robert Cummings

Re: Secure redirection?
        283109 by: Martin Zvarík

It's Sunday, and I'm bored...
        283110 by: Richard Heyes
        283111 by: Ólafur Waage
        283113 by: Richard Heyes

Re: question about google maps
        283112 by: Kevin Waterson
        283114 by: Richard Heyes

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 ---
On Sat, 2008-11-08 at 18:57 -0600, Micah Gersten wrote:
> Bastien Koert wrote:
> > 2008/11/8 Maciek Sokolewicz <[EMAIL PROTECTED]>
> >
> >   
> >> gilles wrote:
> >>
> >>     
> >>> Avec la version 4 de php, strtotime("20080950") fonctionne correctement en
> >>> allant sur le mois d'octobre, alors qu'en version 5: 19700101.
> >>> Merci de votre aide
> >>>
> >>>
> >>>       
> >> This is an ENGLISH list, please rephrase your question in english and
> >> people might understand.
> >>
> >> Cette liste est une liste anglaise, reformulent svp votre question en
> >> anglais svp.
> >>
> >> merci,
> >>
> >> - Tul
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>     
> > I'll translate
> >
> > In PHP4, strtotime works fine
> >
> > in PHP5 strtotime gives a result of 19700101 when the data entered was
> > strtotime("20080950")
> >
> >   
> What does "work fine" mean?  "20080950" isn't normal, so what is the
> expected result?
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 
Well, for starts Micah is right, your date string will be interpreted as
the 50th of September, 2008, which isn't valid and defaults to the time
represented by the timestamp 0. If you want to turn 8-digit number
strings into timestamps, make sure of two things:

1.It's actually a string and not a number
2.The string is in the format yyyymmdd

The strings can be a variety of formats, all found at
http://www.gnu.org/software/shishi/manual/html_node/Date-input-formats.html 
which is a link available on the strtotime manual page.


Ash
www.ashleysheridan.co.uk


--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
I'll translate

In PHP4, strtotime works fine

in PHP5 strtotime gives a result of 19700101 when the data entered was
strtotime("20080950")

What does "work fine" mean?  "20080950" isn't normal, so what is the
expected result?

Well, for starts Micah is right, your date string will be interpreted as
the 50th of September, 2008, which isn't valid and defaults to the time
represented by the timestamp 0. If you want to turn 8-digit number
strings into timestamps, make sure of two things:

1.It's actually a string and not a number
2.The string is in the format yyyymmdd

The strings can be a variety of formats, all found at
http://www.gnu.org/software/shishi/manual/html_node/Date-input-formats.html 
which is a link available on the strtotime manual page.

I seem to remember a previous discussion about this 'bug' but I can't track the notes. Is it not the case that you can simply add days or months to the 'number' and then use strtotime to output the 'normalised' date. So adding 30 to 20th Sept would return 20th October. This very useful feature was corrected as a bug in the rewrite of Date in PHP5.1?
Reason for looking for the notes was to remember how one has to do it now ....

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/lsces/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
"Lester Caine" <[EMAIL PROTECTED]> a écrit dans le message de news: 
[EMAIL PROTECTED]
> Ashley Sheridan wrote:
>>>> I'll translate
>>>>
>>>> In PHP4, strtotime works fine
>>>>
>>>> in PHP5 strtotime gives a result of 19700101 when the data entered was
>>>> strtotime("20080950")
>>>>
>>>>
>>> What does "work fine" mean?  "20080950" isn't normal, so what is the
>>> expected result?
>
>> Well, for starts Micah is right, your date string will be interpreted as
>> the 50th of September, 2008, which isn't valid and defaults to the time
>> represented by the timestamp 0. If you want to turn 8-digit number
>> strings into timestamps, make sure of two things:
>>
>> 1.It's actually a string and not a number
>> 2.The string is in the format yyyymmdd
>>
>> The strings can be a variety of formats, all found at
>> http://www.gnu.org/software/shishi/manual/html_node/Date-input-formats.html 
>> which is a link available on the strtotime manual page.
>
> I seem to remember a previous discussion about this 'bug' but I can't 
> track the notes. Is it not the case that you can simply add days or months 
> to the 'number' and then use strtotime to output the 'normalised' date. So 
> adding 30 to 20th Sept would return 20th October. This very useful feature 
> was corrected as a bug in the rewrite of Date in PHP5.1?
> Reason for looking for the notes was to remember how one has to do it now 
> ....
>
> -- 
> Lester Caine - G8HFL
Thanks everybody for your answer. Yes, this is a very useful feature to add 
days in a date.
My version of PHP is 5.2.0....
Fx GILLES 



--- End Message ---
--- Begin Message ---
O/H Bastien Koert ??????:
2008/11/8 Maciek Sokolewicz <[EMAIL PROTECTED]>

gilles wrote:

Avec la version 4 de php, strtotime("20080950") fonctionne correctement en
allant sur le mois d'octobre, alors qu'en version 5: 19700101.
Merci de votre aide


This is an ENGLISH list, please rephrase your question in english and
people might understand.

Cette liste est une liste anglaise, reformulent svp votre question en
anglais svp.

merci,

- Tul


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


I'll translate

In PHP4, strtotime works fine

Define "works  fine".

in PHP5 strtotime gives a result of 19700101 when the data entered was
strtotime("20080950")


Linux
PHP version 5.1.6
Apache 2

This strtotime("20080950") returns nothing.

---
Thodoris




--- End Message ---
--- Begin Message ---
Hi.

I've got a question/issue that I want to bounce off the list.

I have a list that extends over multiple pages. there might be 200 items,
and i don't want to have the items listed on the same page as it would be
too long. i can break the list up, so i can have it be displayed over
multiple pages. however, i want the user to select different items from the
list. given that the selected items might be over different pages, what's
the best way of keeping a running track of the items that have been
selected??

I could have each page be a form, and do a post/get where i then keep track
of the selected items from page to page, but that would appear to get ugly.
i'm looking for pointers to other sites/code that might have already
implemented this kind of scenario.

thoughts/pointers would be appreciated...


thanks

--- End Message ---
--- Begin Message ---
---- bruce <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I've got a question/issue that I want to bounce off the list.
>
> I have a list that extends over multiple pages. there might be 200 items,
> and i don't want to have the items listed on the same page as it would be
> too long. i can break the list up, so i can have it be displayed over
> multiple pages. however, i want the user to select different items
from the
> list. given that the selected items might be over different pages, what's
> the best way of keeping a running track of the items that have been
> selected??
>
> I could have each page be a form, and do a post/get where i then keep
track
> of the selected items from page to page, but that would appear to get
ugly.
> i'm looking for pointers to other sites/code that might have already
> implemented this kind of scenario.

You use a database, form on each page adds to a temp table on the
database, when they have verified them all (if that is something they
can do) OR have finished whatever form/survey you have them doing, then
you write the temp table info to the one you want to keep.

You could do some of that with ajax as well, but if you want to break up
a 200 item list, you are looking at a database to store the info in the
most efficient manner possible.

You could also do it with sessions, but if they get stuck and need to
come back, then if they had to login their session might be different
and they'd have to start over again.

HTH,
Wolf


--- End Message ---
--- Begin Message ---
On Sat, 2008-11-08 at 20:26 -0800, bruce wrote:
> Hi.
> 
> I've got a question/issue that I want to bounce off the list.
> 
> I have a list that extends over multiple pages. there might be 200 items,
> and i don't want to have the items listed on the same page as it would be
> too long. i can break the list up, so i can have it be displayed over
> multiple pages. however, i want the user to select different items from the
> list. given that the selected items might be over different pages, what's
> the best way of keeping a running track of the items that have been
> selected??
> 
> I could have each page be a form, and do a post/get where i then keep track
> of the selected items from page to page, but that would appear to get ugly.
> i'm looking for pointers to other sites/code that might have already
> implemented this kind of scenario.
> 
> thoughts/pointers would be appreciated...

Accumulate them in the session. When done, and before final action you
could let them view a summary of selected items and allow deletion of
any entries they don't want.

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


--- End Message ---
--- Begin Message ---
I might have not read your post thorougly,
but it's important to know, that Header sends a HTTP request to the browser - you are not hiding the destination URL.

So, calling header("location: in PHP is basically same as redirect using JS.

Martin


Zoran Bogdanov napsal(a):
Hi,

I'm building a login system with AJAX/PHP/MySQL.

I have worked everything out... AJAX is sending request to a php login script (login.php) who if authentication passes initializes the session and sends the header using header("Location : registered_user_area.php");

The whole system works great without AJAX, but when I put AJAX in the story I ahve one problem:

1.When the user is successfully authenticated the login.php sends the header, but the AJAX XMLHttpRequest call is still in progress waiting for a PHP response. So when PHP using the header function redirects to another page that page is outputed to the login form...

My PHP login snippet is:
if ($res_hash == $u_pass) {

    $logged_user = $sql_execution->last_query_result->user;

    $sql_execution->exec_query("DELETE FROM seeds",false);

    $sql_execution->db_disconnect();

    session_start();

    $_SESSION['user'] = $logged_user;

    $host = $_SERVER['HTTP_HOST'];

    $url = rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . '/mpls/index.php';

header("Location: http://$host$url";); //--That page ($host$url) is outputed in the login form...

    exit();

}

else {

    $sql_execution->exec_query("DELETE FROM seeds WHERE id=$row->id",false);

    $sql_execution->db_disconnect();

echo 'BLS'; //--This is sent when the password/username is wrong

    exit();

}

???

Any help greatly appreciated

Thank you!



--- End Message ---
--- Begin Message ---
Hi,

I just looked at my commit diff that I need to check - 1500 lines (!).
Uhhh... Maybe that policy of committing frequently wouldn't be so
terrible after all...

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 1st)

--- End Message ---
--- Begin Message ---
Commit Early Commit Often. :P

On Sun, Nov 9, 2008 at 11:03 AM, Richard Heyes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just looked at my commit diff that I need to check - 1500 lines (!).
> Uhhh... Maybe that policy of committing frequently wouldn't be so
> terrible after all...
>
> --
> Richard Heyes
>
> HTML5 Graphing for FF, Chrome, Opera and Safari:
> http://www.rgraph.org (Updated November 1st)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
> Commit Early Commit Often. :P

That's for wimps... :-)

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 1st)

--- End Message ---
--- Begin Message ---
This one time, at band camp, Sudhakar <[EMAIL PROTECTED]> wrote:

> hi
> 
> how do i go about displaying an address which appears on google maps for a
> business on a web page.
> 
> what are the steps.
> 
> if some one knows about this please let me know.

http://www.phpro.org/classes/Phproogle.html

and some docs at

http://www.phpro.org/classes/Phproogle-Docs.html

example code can be found at
http://www.phpro.org/examples/Google-Maps-With-PHP-And-Phproogle.html


Kevin


-- 
This email message (and any accompanying file attachments) may contain 
confidential or privileged information and is intended for the sole use of the 
addressee(s) named above. If you are not the intended recipient, or the person 
responsible for delivering this message to the intended recipient, please 
notify [EMAIL PROTECTED] immediately and destroy any copies of the original 
message.


Any unauthorised review, use, alteration, disclosure or distribution of this 
email (including any attachments) is prohibited.

--- End Message ---
--- Begin Message ---
> You are trapped on a desert island with the Baldwin Brothers.
> The food and rum have run out and you have a gun with a
> single bullet. Who do you shoot?

Line them all up and shoot them in a oner... ;-)

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 1st)

--- End Message ---

Reply via email to