[PHP] Re: Same Page, Fundamentally Different Behavior OR is Firefox broken?

2009-06-12 Thread Manuel C.

Matt Neimeyer a écrit :

I'm at a complete loss... So I'm hoping someone can point me in the
right direction to even start looking.

We have an application written in PHP that lets users send out emails.
The basic process is as follows.

1. Go to start screen. (This resets anything currently in process
for the current logged in user)
2. Upload email addresses and other info (Names, etc)
3. Build Email
4. Send

In Step 3 the user can click a Live Preview button to see what the
email will look like with the merged data.

Here's the problem,  this works fine in all versions of IE, versions
1.5 or less of FireFox and versions 3 or less of Safari. However,
starting in FireFox 2, and now Safari 4, when you get to step four OR
click the live preview button in step three there is no more data in
the merge. In those browsers the system is acting like the end user
went BACK to the start page (in another window?) and reinitialized all
the data.

I immediately thought it might be pre-fetching so I tried using the
system before and after toggling the network.prefetch-next setting in
about:config with FireFox 2.0.0.20 and restarting the browser. No
luck. So I added code to my reset function to email me the output of
phpinfo() when the reset function is called. Using IE I get 1
notification. Using FF I get two notifications. This reinforces my
theory that FireFox is prefetching the menu item to start a new
mailing (just an a link...) from the top of the composer page. Even
still... I've disabled prefetch so it SHOULDN'T even be considering
those links right? I've also tried adding artificial
?now=timestamp fakes to the end of all menu links since I read
somewhere (don't remember where) that FireFox only prefetches pages
with no query section in the address.

Has anyone run into this behavior before? Any recommendations on how
to stop it? Preferably from the server with code of some sort...

Thanks in advance.

Matt




Hi Matt,

Have you tried to put this two lines in the HEAD section of your HTML pages :
META http-equiv=Cache-Control content=no-cache
META http-equiv=Pragma content=no-cache

Hope it helps you.

BR


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



[PHP] socket_write return wrong data length

2009-06-09 Thread Manuel C.

Hi all,

I'm writting a little telnet client, but I've a problem with the socket_write 
function

public function send($data){
$datalen = strlen($data);
$datawritten = 0;
do {
$datawritten = socket_write($this-_tnsocket, $data, 
$datalen);
if( $datawritten === FALSE) {
echo __METHOD__. : 
.socket_strerror(socket_last_error()).\n;
return (FALSE);
}
echo Bytes written : .$datawritten.\n;
$data = substr($data, $datawritten);
$datalen = strlen($data);
} while($datawritten  $datalen);

return (TRUE);
}


When I use this function for writting a sample message of 4526 Bytes it returns 
:
Bytes written : 4526
But it really wrotes only 1460 Bytes (verified with Wireshark).

So my question is why socket_write returns me a wrong data length ?

Thanks


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