php-general Digest 8 May 2010 03:35:09 -0000 Issue 6732

Topics (messages 304981 through 305005):

Re: Can't find my error
        304981 by: Jan G.B.
        304984 by: Robert Cummings
        304985 by: tedd
        304986 by: Robert Cummings
        304987 by: tedd
        304988 by: Robert Cummings
        304989 by: Bob McConnell
        304999 by: David McGlone
        305002 by: David McGlone

Re: "åÐ-¡¨-¼·"å"|»®-åÉ|ó“-ñ@
        304982 by: Bill Guion

Re: Two color ... while iteration [X-PHP]
        304983 by: tedd

Re: Can't find my error [X-PHP]
        304990 by: tedd
        305000 by: David McGlone

Problem with IE7 caching
        304991 by: Charlene Wroblewski
        304992 by: Karl DeSaulniers
        304997 by: Charlene Wroblewski
        304998 by: Karl DeSaulniers
        305001 by: Phpster
        305003 by: Phpster
        305005 by: Charlene Wroblewski

Re: simplexml choking on apparently valid XML
        304993 by: Brian Dunning
        304994 by: Nathan Nobbe

Finding similar results with php from mysql
        304995 by: Merlin Morgenstern
        304996 by: Al
        305004 by: David McGlone

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 ---
2010/5/6 David McGlone <da...@dmcentral.net>:
> On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote:
>> On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote:
>> > On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote:
>> > > On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote:
>> > > > I've checked and checked and re-checked and I can't figure out what
>> > > > I've done wrong. I'm getting a parse error:
>>
>> <snip>
>>
>> > WOW!!!! I have spent at least 4 hours reading and re-reading it and it
>> > took you 3 seconds.
>> >
>> > That was the problem. How, how, how could I have overlooked that so many
>> > times????
>> >
>> > Thank you Ashley, I should have asked you 3 hours ago. ;-)
>>
>> Yeah, David, the rest of us are really disappointed in you. I mean, it's
>> not like that's ever happened to *us*. ;-}
>
> I've been studying PHP for at least 2 years straight now, after dabbling in it
> for about a year 6 years ago. So even though I've had my nose to the grind for
> a good 2 years now, I don't think I can call my mistake a "rookie mistake".
> Thats what's frustrating to me. LOL
>
> --
> Blessings,
> David M.

I would take this as a hint to prefer intval() instead of casts.
initval($foo) would have drawn a fatal error - can't be overseen. ;)

Regards

--- End Message ---
--- Begin Message ---
Jan G.B. wrote:
2010/5/6 David McGlone <da...@dmcentral.net>:
On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote:
On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote:
On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote:
On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote:
I've checked and checked and re-checked and I can't figure out what
I've done wrong. I'm getting a parse error:
<snip>

WOW!!!! I have spent at least 4 hours reading and re-reading it and it
took you 3 seconds.

That was the problem. How, how, how could I have overlooked that so many
times????

Thank you Ashley, I should have asked you 3 hours ago. ;-)
Yeah, David, the rest of us are really disappointed in you. I mean, it's
not like that's ever happened to *us*. ;-}
I've been studying PHP for at least 2 years straight now, after dabbling in it
for about a year 6 years ago. So even though I've had my nose to the grind for
a good 2 years now, I don't think I can call my mistake a "rookie mistake".
Thats what's frustrating to me. LOL

--
Blessings,
David M.

I would take this as a hint to prefer intval() instead of casts.
initval($foo) would have drawn a fatal error - can't be overseen. ;)

Casts are an order of magnitude faster than function calls.

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

--- End Message ---
--- Begin Message ---
At 6:40 AM -0400 5/7/10, David McGlone wrote:
On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
 Robert Cummings wrote:
 > David McGlone wrote:
 >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
 >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
 >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
 > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone <da...@dmcentral.net>
 > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
 >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
 > >>>>>>> <da...@dmcentral.net> wrote:
-snip- mindless chater

We are surely a different breed ;-)

--
Blessings,
David M.

To all:

Yes, the breed that finds such chatter assuming.

Careful, we might drool on our pocket protectors. :-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd wrote:
At 6:40 AM -0400 5/7/10, David McGlone wrote:
On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
 Robert Cummings wrote:
 > David McGlone wrote:
 >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
 >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
 >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
 > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone <da...@dmcentral.net>
 > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
 >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
 > >>>>>>> <da...@dmcentral.net> wrote:
-snip- mindless chater

We are surely a different breed ;-)

--
Blessings,
David M.

To all:

Yes, the breed that finds such chatter assuming.

Careful, we might drool on our pocket protectors. :-)

I have some duct tape that can help you with your drooling problem!

>:B

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

--- End Message ---
--- Begin Message ---
At 11:53 AM -0400 5/7/10, Robert Cummings wrote:
tedd wrote:
At 6:40 AM -0400 5/7/10, David McGlone wrote:
On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
 Robert Cummings wrote:
 > David McGlone wrote:
 >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
 >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
 >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
 > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone <da...@dmcentral.net>
 > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
 >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
 > >>>>>>> <da...@dmcentral.net> wrote:
-snip- mindless chater

We are surely a different breed ;-)

Yes, the breed that finds such chatter assuming.

Careful, we might drool on our pocket protectors. :-)

I have some duct tape that can help you with your drooling problem!

:B

Cheers,
Rob.


I use Duck tape.

It quacks me up .:-)

Cheers,

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---

tedd wrote:
At 11:53 AM -0400 5/7/10, Robert Cummings wrote:
tedd wrote:
At 6:40 AM -0400 5/7/10, David McGlone wrote:
On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
 Robert Cummings wrote:
 > David McGlone wrote:
 >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
 >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
 >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
 > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone <da...@dmcentral.net>
 > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
 >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
 > >>>>>>> <da...@dmcentral.net> wrote:
-snip- mindless chater

We are surely a different breed ;-)
Yes, the breed that finds such chatter assuming.

Careful, we might drool on our pocket protectors. :-)
I have some duct tape that can help you with your drooling problem!

:B
Cheers,
Rob.


I use Duck tape.

It quacks me up .:-)

You must be wealthy... It ruffles my feathers that it's way too expensive for practical use. I just can't foot the bill!

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

--- End Message ---
--- Begin Message ---
From: Robert Cummings

> tedd wrote:
>> At 6:40 AM -0400 5/7/10, David McGlone wrote:
>>> On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
>>>>  Robert Cummings wrote:
>>>>  > David McGlone wrote:
>>>>  >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
>>>>  >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
>>>>  >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
>>>  > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone
<da...@dmcentral.net>
>>>  > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
>>>>  >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
>>>  > >>>>>>> <da...@dmcentral.net> wrote:
>>> -snip- mindless chater
>>>
>>> We are surely a different breed ;-)
>>>
>> 
>> Yes, the breed that finds such chatter assuming.
>> 
>> Careful, we might drool on our pocket protectors. :-)
> 
> I have some duct tape that can help you with your drooling problem!

I use some 100-mile-an-hour tape my son left the last time he was home
on leave. That reminds me, I need to get some more from him when he gets
back from Baghdad next month.

Bob McConnell

--- End Message ---
--- Begin Message ---
On Friday 07 May 2010 12:10:50 tedd wrote:
> At 11:53 AM -0400 5/7/10, Robert Cummings wrote:
> >tedd wrote:
> >>At 6:40 AM -0400 5/7/10, David McGlone wrote:
> >>>On Thursday 06 May 2010 23:47:23 Jim Lucas wrote:
> >>>>  Robert Cummings wrote:
> >>>>  > David McGlone wrote:
> >>>>  >> On Thursday 06 May 2010 20:49:47 Jason Pruim wrote:
> >>>>  >>> On May 5, 2010, at 9:02 PM, David McGlone wrote:
> >>>>  >>>> On Wednesday 05 May 2010 13:12:58 Dan Joseph wrote:
> >>>  > >>>>> On Wed, May 5, 2010 at 1:06 PM, David McGlone
> >>>  > >>>>> <da...@dmcentral.net>
> >>>  > >>>>>
> >>>  > >>>>>> On Wednesday 05 May 2010 12:59:07 Dan Joseph wrote:
> >>>  > >>>>>>
> >>>>  >>>>>>> On Wed, May 5, 2010 at 12:55 PM, David McGlone
> >>>>  >>>>>>>
> >>>  > >>>>>>> <da...@dmcentral.net> wrote:
> >>>
> >>>-snip- mindless chater
> >>>
> >>>We are surely a different breed ;-)
> >>
> >>Yes, the breed that finds such chatter assuming.
> >>
> >>Careful, we might drool on our pocket protectors. :-)
> >
> >I have some duct tape that can help you with your drooling problem!
> >
> >>:B
> >
> >Cheers,
> >Rob.
>
> I use Duck tape.
>
> It quacks me up .:-)

Oh Jeeeez! that one did quack me up!!!
-- 
Blessings,
David M.

--- End Message ---
--- Begin Message ---
On Friday 07 May 2010 11:26:56 Robert Cummings wrote:
> Jan G.B. wrote:
> > 2010/5/6 David McGlone <da...@dmcentral.net>:
> >> On Wednesday 05 May 2010 16:19:35 Paul M Foster wrote:
> >>> On Wed, May 05, 2010 at 01:03:41PM -0400, David McGlone wrote:
> >>>> On Wednesday 05 May 2010 12:51:00 Ashley Sheridan wrote:
> >>>>> On Wed, 2010-05-05 at 12:55 -0400, David McGlone wrote:
> >>>>>> I've checked and checked and re-checked and I can't figure out what
> >>>>>> I've done wrong. I'm getting a parse error:
> >>>
> >>> <snip>
> >>>
> >>>> WOW!!!! I have spent at least 4 hours reading and re-reading it and it
> >>>> took you 3 seconds.
> >>>>
> >>>> That was the problem. How, how, how could I have overlooked that so
> >>>> many times????
> >>>>
> >>>> Thank you Ashley, I should have asked you 3 hours ago. ;-)
> >>>
> >>> Yeah, David, the rest of us are really disappointed in you. I mean,
> >>> it's not like that's ever happened to *us*. ;-}
> >>
> >> I've been studying PHP for at least 2 years straight now, after dabbling
> >> in it for about a year 6 years ago. So even though I've had my nose to
> >> the grind for a good 2 years now, I don't think I can call my mistake a
> >> "rookie mistake". Thats what's frustrating to me. LOL
> >>
> >> --
> >> Blessings,
> >> David M.
> >
> > I would take this as a hint to prefer intval() instead of casts.
> > initval($foo) would have drawn a fatal error - can't be overseen. ;)
>
> Casts are an order of magnitude faster than function calls.

Ok y'all lost me waaaaaaaay back there... LOL

Is there some type of function I can write to catch up?         

-- 
Blessings,
David M.

--- End Message ---
--- Begin Message ---
At 8:26 PM -0400 5/6/10, Robert Cummings wrote:

Ashley Sheridan wrote:
[/snip]

If only I could speak Chinese and was gullible I'd love to take them up
on the offer for whatever it is.

Thanks,
Ash
http://www.ashleysheridan.co.uk

My Chinese is a bit rusty, but I think it says, please reply on-list to this spam message!

:|

Cheers,
Rob.

:)

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

Boy, its a good thing no one on this list would fall for something like that.

     -----===== Bill =====-----
--

Don't find fault. Find a remedy. - Henry Ford

--- End Message ---
--- Begin Message ---
On 6 May 2010 17:47, tedd <<mailto:tedd.sperl...@gmail.com>tedd.sperl...@gmail.com> wrote:


Michiel:

Considerate? Being Inconsiderate is what the government does for a living.

Additionally, what you said above is *your* opinion -- as *you* presented in a public forum. Who's opinion is more appropriate for this list is subject to debate.

As for me, I'll say whatever I want as the topic permits. If you will review this thread you will see that I was offering my code free to everyone except government. That's not an opinion but rather a statement of requirement for the code I'm providing. My second post to this thread contained the reason WHY the requirement.

If you don't like my requirements, and reasons for them, then please forward my postings to the trash and don't use my code.


Cheers,

tedd



It appears as though I struck a wrong chord. I honestly did not mean to upset you. :) My point was that we should not be overtly confrontational towards one another, but it seems that only exacerbated the situation. My sincerest apologies.

Regards,
Michiel

Michiel:

Don't worry -- I forgot about what was said already.

Granted, I am passionate about the government, but that's because I think it's important and I see it headed in the wrong direction. Much like witnessing a child running into the street, while others sit back and don't raise alarm because they might be accused of being politically incorrect, I see there's more at risk here than that.

Cheers,

tedd

PS: Please note, the Subject line did have [X-PHP] which typically means that the content may be not PHP related.

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
At 12:49 PM -0400 5/7/10, Bob McConnell wrote:
I use some 100-mile-an-hour tape my son left the last time he was home
on leave. That reminds me, I need to get some more from him when he gets
back from Baghdad next month.

Bob McConnell

Bob :

When he arrives home, tell him "Thanks for his service" from a Vietnam Vet (something that was lacking for us at the time).

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
On Friday 07 May 2010 13:45:37 tedd wrote:
> At 12:49 PM -0400 5/7/10, Bob McConnell wrote:
> >I use some 100-mile-an-hour tape my son left the last time he was home
> >on leave. That reminds me, I need to get some more from him when he gets
> >back from Baghdad next month.
> >
> >Bob McConnell
>
> Bob :
>
> When he arrives home, tell him "Thanks for his service" from a
> Vietnam Vet (something that was lacking for us at the time).

And thanks from me, an ordinary citizen who can't serve his country due to 
being hearing impaired.
-- 
Blessings,
David M.

--- End Message ---
--- Begin Message --- I have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways:

   * I make a minor change to a php program, but you can't see it in
     IE7, but can in FF.  CTRL-Refresh does not make it work.
   * I modify data using a form in IE7.  When I click on a link to
     return to the form the old data is still there, but if I hit
     CTRL-Refresh the new values are there.

I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines:

  $now = time ();
  $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT';
  $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT';
   // Backwards Compatibility
   header ("Last Modified: $prety_lmtime");
   header ("Expires: $prety_emtime");
   // HTTP/1.1 Support
   header ("Cache-Control: private, max-age=$interval,s-maxage=0");

I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db.

Charlene

--- End Message ---
--- Begin Message ---
Try,
header('Cache-control: private, no-cache, must-revalidate');
header('Expires: 0');

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html



On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

header ("Cache-Control: private, max-age=$interval,s-maxage=0");

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message --- I tried this and it doesn't work. I still have to do the CTRL-Refresh to get it to refresh the page.

On May 7, 2010, at 2:27 PM, Karl DeSaulniers wrote:

Try,
header('Cache-control: private, no-cache, must-revalidate');>
header('Expires: 0');

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

header ("Cache-Control: private, max-age=$interval,s-maxage=0");




--- End Message ---
--- Begin Message ---
On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

I have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways:

   * I make a minor change to a php program, but you can't see it in
     IE7, but can in FF.  CTRL-Refresh does not make it work.
   * I modify data using a form in IE7.  When I click on a link to
     return to the form the old data is still there, but if I hit
     CTRL-Refresh the new values are there.

I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines:

  $now = time ();
  $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT';
  $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT';
   // Backwards Compatibility
   header ("Last Modified: $prety_lmtime");
   header ("Expires: $prety_emtime");
   // HTTP/1.1 Support
   header ("Cache-Control: private, max-age=$interval,s-maxage=0");

I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db.

Charlene

Sounds like you need attach the data somehow when hitting that return link. Maybe an array
$newData = array();//fill this array with the new values

On your form page, set up a

if(isset($newData)){
//fill form fields
}

I did notice that on your header, you did not have "no-cache".

header ("Cache-Control: private, no-cache, max-age=$interval,s- maxage=0");

HTH


Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---


On May 7, 2010, at 8:06 PM, Charlene Wroblewski <cwemagazi...@charter.net > wrote:

I tried this and it doesn't work. I still have to do the CTRL- Refresh to get it to refresh the page.

On May 7, 2010, at 2:27 PM, Karl DeSaulniers wrote:

Try,
header('Cache-control: private, no-cache, must-revalidate');>
header('Expires: 0');

http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html

On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

header ("Cache-Control: private, max-age=$interval,s-maxage=0");




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


A lot depend on the really 'helpful' IE settings. You actually have to configure the POS to always check for a new version.

Also if there are any proxy servers in the middle, then it gets tough. One of my clients has had serious issues with proxies that required me to work with their internal IT teams to allow exceptions for the app.

Bastien

Sent from my iPod

--- End Message ---
--- Begin Message ---

On May 7, 2010, at 8:41 PM, Karl DeSaulniers <k...@designdrumm.com> wrote:

On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

I have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways:

  * I make a minor change to a php program, but you can't see it in
    IE7, but can in FF.  CTRL-Refresh does not make it work.
  * I modify data using a form in IE7.  When I click on a link to
    return to the form the old data is still there, but if I hit
    CTRL-Refresh the new values are there.

I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines:

 $now = time ();
 $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT';
 $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT';
  // Backwards Compatibility
  header ("Last Modified: $prety_lmtime");
  header ("Expires: $prety_emtime");
  // HTTP/1.1 Support
  header ("Cache-Control: private, max-age=$interval,s-maxage=0");

I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db.

Charlene

Sounds like you need attach the data somehow when hitting that return link. Maybe an array
$newData = array();//fill this array with the new values

On your form page, set up a

if(isset($newData)){
//fill form fields
}

I did notice that on your header, you did not have "no-cache".

header ("Cache-Control: private, no-cache, max-age=$interval,s- maxage=0");

HTH


Karl DeSaulniers
Design Drumm
http://designdrumm.com


One other option is to fool the browser by appending a time variable to the end of the URL to get around caching.

Bastien

Sent from my iPod


--- End Message ---
--- Begin Message ---
Karl DeSaulniers wrote:
On May 7, 2010, at 2:06 PM, Charlene Wroblewski wrote:

I have a problem with IE7. It has a tendency to cache output produced by PHP. It occurs in a few ways:

   * I make a minor change to a php program, but you can't see it in
     IE7, but can in FF.  CTRL-Refresh does not make it work.
   * I modify data using a form in IE7.  When I click on a link to
     return to the form the old data is still there, but if I hit
     CTRL-Refresh the new values are there.

I have set up some caching to try to fix the second issue, but I'm not sure if I've chosen the right header lines:

  $now = time ();
  $prety_lmtime = gmdate ('D, d M Y H:i:s', $now). ' GMT';
  $prety_emtime = gmdate ('D, d M Y H:i:s', $now + $interval). ' GMT';
   // Backwards Compatibility
   header ("Last Modified: $prety_lmtime");
   header ("Expires: $prety_emtime");
   // HTTP/1.1 Support
   header ("Cache-Control: private, max-age=$interval,s-maxage=0");

I got this code from a book. I don't want to prevent caching completely because I want to be able to go back to the form when there is an error in validation of fields before entering it into the db. But I do want to be able to see the new data after it is entered in the db.

Charlene

Sounds like you need attach the data somehow when hitting that return link. Maybe an array
$newData = array();//fill this array with the new values

On your form page, set up a

if(isset($newData)){
//fill form fields
}

I did notice that on your header, you did not have "no-cache".

header ("Cache-Control: private, no-cache, max-age=$interval,s-maxage=0");
Actually, I should have looked at which caching code I was using for the second problem. This is the code:

               header ("Expires: 0");
               header ("pragma: no-cache");
               // HTTP/1.1 Support
header ("Cache-Control: no-cache,no-store,max-age=0,s-maxage=0, must-revalidate");

About storing the values, I really would rather the browser keep track of form input if I can. It could get confusing trying to store temporary information, especially since the form is being used to modify a client profile as well as create a new password for the first time in the application (not my choice - I'd rather do passwords first and then allow them to modify info).

Charlene



--- End Message ---
--- Begin Message ---
This time simplexml-load-string also gave me the same error on the following 
line:

<first_name>Charlie &amp; Brady</first_name>

Can anyone confirm whether simplexml-load-string will or will not accept or 
allow XML-encoded characters? It seems that it should and would be pretty 
surprising if it wouldn't.



On May 6, 2010, at 5:02 PM, Brian Dunning wrote:

> Hey all -
> 
> I'm using simplexml-load-string just to validation a string of XML, and 
> libxml-get-errors to return any errors. It's always worked before, but today 
> it's choking on this line in the XML:
> 
> <client_orderitem_number>Basketball Personalized Notebook - 
> Jeff&apos;s</client_orderitem_number>
> 
> It's returning "Premature end of data in tag client_orderitem_number line 90" 
> but as far as I can tell, Jeff&apos;s is properly XML encoded. I can't debug 
> this. Any suggestions?
> 
> I have run the XML through a couple of online validators and it does come 
> back as valid with no errors found.
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
On Fri, May 7, 2010 at 4:32 PM, Brian Dunning <br...@briandunning.com>wrote:

> This time simplexml-load-string also gave me the same error on the
> following line:
>
> <first_name>Charlie &amp; Brady</first_name>
>
> Can anyone confirm whether simplexml-load-string will or will not accept or
> allow XML-encoded characters? It seems that it should and would be pretty
> surprising if it wouldn't.


hmm, both the strings seem to work fine on my laptop:

php > var_dump(simplexml_load_string('<first_name>Charlie &amp;
Brady</first_name>'));
object(SimpleXMLElement)#1 (1) {
  [0]=>
  string(15) "Charlie & Brady"
}
php > var_dump(simplexml_load_string('<client_orderitem_number>Basketball
Personalized Notebook - Jeff&apos;s</client_orderitem_number>'));
object(SimpleXMLElement)#1 (1) {
  [0]=>
  string(41) "Basketball Personalized Notebook - Jeff's"
}


-nathan

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

I am searching for a way to show the user similar records from the mysql database. A functionality like "this could also be of interest to you".

Does anybody know if this is there is a standard functionality to do this, or a good way on retrieving this with the help of PHP?

Kind regards, Merlin

--- End Message ---
--- Begin Message ---


On 5/7/2010 7:37 PM, Merlin Morgenstern wrote:
Hi there,

I am searching for a way to show the user similar records from the mysql
database. A functionality like "this could also be of interest to you".

Does anybody know if this is there is a standard functionality to do
this, or a good way on retrieving this with the help of PHP?

Kind regards, Merlin


Biggest problem is defining "similar" Even Google hasn't mastered it yet.

--- End Message ---
--- Begin Message ---
On Friday 07 May 2010 19:37:32 Merlin Morgenstern wrote:
> Hi there,
>
> I am searching for a way to show the user similar records from the mysql
> database. A functionality like "this could also be of interest to you".
>
> Does anybody know if this is there is a standard functionality to do
> this, or a good way on retrieving this with the help of PHP?
>
> Kind regards, Merlin

I have some code that makes suggestions on items that one might be interested 
in based on what they are buying or did buy in the past using PHP.

Is this what your interested in?

-- 
Blessings,
David M.

--- End Message ---

Reply via email to