php-general Digest 1 Jun 2011 00:51:17 -0000 Issue 7337
Topics (messages 313259 through 313284):
Re: iPhone sadness
313259 by: Jay Blanchard
313260 by: Govinda
313263 by: Robert Cummings
Re: php causes HTTP 500, but results in blank page in apache
313261 by: Sean Greenslade
313262 by: Stephon Chen
Re: iPhone sadness WOT
313264 by: Jay Blanchard
313266 by: Mike Mackintosh
How to change list settings
313265 by: Alexis
313267 by: Jay Blanchard
313268 by: Alexis
313269 by: Daniel Brown
313270 by: Alexis
313271 by: Jay Blanchard
313272 by: Jay Blanchard
313273 by: Ashley Sheridan
313279 by: tedd
smart auto download file
313274 by: Ali Asghar Toraby Parizy
313275 by: jean-baptiste verrey
313277 by: Ali Asghar Toraby Parizy
313278 by: Ashley Sheridan
313281 by: jean-baptiste verrey
313282 by: Stuart Dallas
313283 by: Geoff Shang
Re: phpsadness
313276 by: Daniel Brown
313280 by: Robert Cummings
313284 by: Jim Lucas
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 ---
[snip]
I can remember when it first started, no moaning about this or that,
just pure PHP, and no sarcastic comments either, bring back the good old
days :)
[/snip]
I beg to differ - the sarcastic remarks have been here since day one.
--- End Message ---
--- Begin Message ---
> Is there any way that we could simply ban these ridiculous top-posting vs
> bottom-posting threads that seem to come along every few weeks? I frankly
> don't care where a person writes a reply - I'm quite able to scan through an
> email message to find the relevant points regardless. Maybe we could add a
> [posting position rant] tag onto emails that discuss this topic so those of
> us who couldn't care less could simply have them directed straight to the
> trash can?
My favorite response is when Dan jumps in and reminds that this list's rules
are not open to debate or opinion (in the sense that the opinions do not affect
the rules). On this topic the rule of this list is "do not top post". It
anyone top posts they are ignorant of the rules, or choosing to ignore them.
- Govinda
--- End Message ---
--- Begin Message ---
On 11-05-31 07:15 AM, Jay Blanchard wrote:
[snip]
I can remember when it first started, no moaning about this or that,
just pure PHP, and no sarcastic comments either, bring back the good old
days :)
[/snip]
I beg to differ - the sarcastic remarks have been here since day one.
Yeah *SHEEEEEEEESH* What was he thinking?!
;)
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
Have you checked your apache settings for generating error pages? How is it
configured to handle 500 errors?
On May 30, 2011 4:51 AM, "Stephon Chen" <[email protected]> wrote:
> Hello all,
>
> I use a test script below to generate HTTP 500 status:
>
> <?php
> header('HTTP/1.1 500 Internal Server Error');
> ?>
>
> It causes HTTP 500 in apache log, but apache shows blank page instead of
> HTTP 500 error page
> But 403, 404 works correctly.
>
> Why this thing occurs? And is there any soultion?
>
> My platform is FreeBSD 8.2, PHP 5.3.6, and Apache 2.2.18, which running
php
> as php-cgi mode.
>
> Thanks a lot
> --
> stephon
--- End Message ---
--- Begin Message ---
Hello Sean,
Here is my apache config for error handling.
403, 404 works fine, but 500 shows blank page
Alias /errorpage/ "/usr/local/www/apache22/errorpage/"
<Directory "/usr/local/www/apache22/errorpage/">
AllowOverride None
Options -Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
#
ErrorDocument 403 /errorpage/403.html
ErrorDocument 404 /errorpage/404.html
ErrorDocument 500 /errorpage/500.html
thanks a lot
--
stephon
On Tue, May 31, 2011 at 21:08, Sean Greenslade <[email protected]>wrote:
> Have you checked your apache settings for generating error pages? How is it
> configured to handle 500 errors?
> On May 30, 2011 4:51 AM, "Stephon Chen" <[email protected]> wrote:
> > Hello all,
> >
> > I use a test script below to generate HTTP 500 status:
> >
> > <?php
> > header('HTTP/1.1 500 Internal Server Error');
> > ?>
> >
> > It causes HTTP 500 in apache log, but apache shows blank page instead of
> > HTTP 500 error page
> > But 403, 404 works correctly.
> >
> > Why this thing occurs? And is there any soultion?
> >
> > My platform is FreeBSD 8.2, PHP 5.3.6, and Apache 2.2.18, which running
> php
> > as php-cgi mode.
> >
> > Thanks a lot
> > --
> > stephon
>
--- End Message ---
--- Begin Message ---
[snip]
> I beg to differ - the sarcastic remarks have been here since day one.
Yeah *SHEEEEEEEESH* What was he thinking?!
;)
[/snip]
I know huh? Whatevs.
I added something to the subject so that those who don't want to read
these can send them to /dev/null appropriately.
--- End Message ---
--- Begin Message ---
Thanks
:P
Sent from my iPhone
On May 31, 2011, at 9:54, "Jay Blanchard" <[email protected]> wrote:
> [snip]
>> I beg to differ - the sarcastic remarks have been here since day one.
>
> Yeah *SHEEEEEEEESH* What was he thinking?!
>
> ;)
> [/snip]
>
> I know huh? Whatevs.
>
> I added something to the subject so that those who don't want to read
> these can send them to /dev/null appropriately.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
How do I change my email settings to digest please as I am fed up with
receiving all this individual crap that has nothing to do with PHP
whatsoever.
--- End Message ---
--- Begin Message ---
[snip]
How do I change my email settings to digest please as I am fed up with
receiving all this individual crap that has nothing to do with PHP
whatsoever.
[/snip]
http://lmgtfy.com/?q=php+mailing+list
--- End Message ---
--- Begin Message ---
And how exactly does that TELL me how to change settings? I have already
used the automated emzlm help system but that does not say a thing on
the subject
On 31/05/11 08:47, Jay Blanchard wrote:
[snip]
How do I change my email settings to digest please as I am fed up with
receiving all this individual crap that has nothing to do with PHP
whatsoever.
[/snip]
http://lmgtfy.com/?q=php+mailing+list
--- End Message ---
--- Begin Message ---
On Tue, May 31, 2011 at 10:49, Alexis <[email protected]> wrote:
> And how exactly does that TELL me how to change settings? I have already
> used the automated emzlm help system but that does not say a thing on the
> subject
If you looked well enough, you'd not only see how to do it, but
also that top-posting is against the mailing list rules. ;-P
Go to http://php.net/mailinglists and select the PHP General User
List as "Normal" and scroll to the bottom. Enter your email address,
and click Unsubscribe, then verify your unsubscription request. Then,
select the "Digest" option, add your email address again (if
necessary), and click the Subscribe button. Verify your email
address, and voila! You should be good to go.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
Thanks for that straight forward response, shame other people cannot do
likewise ;)
On 31/05/11 08:56, Daniel Brown wrote:
On Tue, May 31, 2011 at 10:49, Alexis<[email protected]> wrote:
And how exactly does that TELL me how to change settings? I have already
used the automated emzlm help system but that does not say a thing on the
subject
If you looked well enough, you'd not only see how to do it, but
also that top-posting is against the mailing list rules. ;-P
Go to http://php.net/mailinglists and select the PHP General User
List as "Normal" and scroll to the bottom. Enter your email address,
and click Unsubscribe, then verify your unsubscription request. Then,
select the "Digest" option, add your email address again (if
necessary), and click the Subscribe button. Verify your email
address, and voila! You should be good to go.
--- End Message ---
--- Begin Message ---
[snip]
Yes I did. Perhaps you can show me the bit that I have missed that tells
me where I change my settings from receiving individual messages to
receiving a digest format, rather than just sending out these links to
something I have already said I looked at.
[/snip]
1. Look next to the list you wish to receive the digest (php-general)
from and you will find 2 radio selectors.
2. Scroll down to the bottom of the page and enter your email address.
3. Click subscribe.
Now you must unsubscribe from the full version of the list. In order to
do that you must click the following link and, read and follow the
instructions.
http://www.php.net/unsub.php
FROM THE ORIGINAL E-MAIL -
-----Original Message-----
From: Alexis Antonakis [mailto:[email protected]]
Sent: Tuesday, May 31, 2011 9:56 AM
To: Jay Blanchard
Subject: Re: [PHP] How to change list settings
On 31/05/11 08:51, Jay Blanchard wrote:
> Did you even read it? http://php.net/mailing-lists.php
>
> -----Original Message-----
> From: Alexis Antonakis [mailto:[email protected]]
> Sent: Tuesday, May 31, 2011 9:49 AM
> To: Jay Blanchard
> Subject: Re: [PHP] How to change list settings
>
> And how exactly does that TELL me how to change settings? I have
already
>
> used the automated emzlm help system but that does not say a thing on
> the subject
>
> On 31/05/11 08:47, Jay Blanchard wrote:
>> [snip]
>> How do I change my email settings to digest please as I am fed up
with
>> receiving all this individual crap that has nothing to do with PHP
>> whatsoever.
>> [/snip]
>>
>> http://lmgtfy.com/?q=php+mailing+list
>>
>>
>>
>
>
--- End Message ---
--- Begin Message ---
[snip]
Thanks for that straight forward response, shame other people cannot do
likewise ;)
[/snip]
The real shame is that folks cannot RTFI :)
--- End Message ---
--- Begin Message ---
On Tue, 2011-05-31 at 10:07 -0500, Jay Blanchard wrote:
> [snip]
> Thanks for that straight forward response, shame other people cannot do
> likewise ;)
> [/snip]
>
> The real shame is that folks cannot RTFI :)
>
The real shame was that he was still top-posting even after Dan picked
him up on it, and after he was complaining so much about the thread
which was mainly about the whole top-posting issue!
--
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
At 5:31 PM +0100 5/31/11, Ashley Sheridan wrote:
On Tue, 2011-05-31 at 10:07 -0500, Jay Blanchard wrote:
[snip]
Thanks for that straight forward response, shame other people cannot do
likewise ;)
[/snip]
The real shame is that folks cannot RTFI :)
The real shame was that he was still top-posting even after Dan picked
him up on it, and after he was complaining so much about the thread
which was mainly about the whole top-posting issue!
--
Thanks,
Ash
Some people never learn no matter how well things are presented to them.
Cheers,
tedd
--
-------
http://sperling.com/
--- End Message ---
--- Begin Message ---
I want to build a web page for file auto download like cnet.download.
A page that tells user "Your download will begin in a moment..." and
after a few seconds download starts.
How can I do that by php
thanks for any help.
--
Ali Asghar Torabi
--- End Message ---
--- Begin Message ---
it's made in JavaScript, by creating an iframe loading the file, but their
downloader might use something like a php file to force download such as
<?php
$filePath='/var/wwwblablah.zip';
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="azipfile.zip"');
readfile($filePath);
?>
On 31 May 2011 18:02, Ali Asghar Toraby Parizy
<[email protected]>wrote:
> I want to build a web page for file auto download like cnet.download.
> A page that tells user "Your download will begin in a moment..." and
> after a few seconds download starts.
> How can I do that by php
> thanks for any help.
>
> --
> Ali Asghar Torabi
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi
thanks for your help jean
I've used this code before. But I want a little different thing.
I need to tell something to the user before starting download.
something like "Your download will begin in a moment..." . So header
couldn't help me. If I try to echo anything header doesn't work!
On Tue, May 31, 2011 at 10:01 PM, jean-baptiste verrey
<[email protected]> wrote:
> it's made in JavaScript, by creating an iframe loading the file, but their
> downloader might use something like a php file to force download such as
> <?php
> $filePath='/var/wwwblablah.zip';
> header('Content-type: application/octet-stream');
> header('Content-Disposition: attachment; filename="azipfile.zip"');
> readfile($filePath);
> ?>
>
> On 31 May 2011 18:02, Ali Asghar Toraby Parizy <[email protected]>
> wrote:
>>
>> I want to build a web page for file auto download like cnet.download.
>> A page that tells user "Your download will begin in a moment..." and
>> after a few seconds download starts.
>> How can I do that by php
>> thanks for any help.
>>
>> --
>> Ali Asghar Torabi
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
--
Ali Asghar Torabi
--- End Message ---
--- Begin Message ---
On Wed, 2011-06-01 at 00:08 +0430, Ali Asghar Toraby Parizy wrote:
> Hi
> thanks for your help jean
> I've used this code before. But I want a little different thing.
> I need to tell something to the user before starting download.
> something like "Your download will begin in a moment..." . So header
> couldn't help me. If I try to echo anything header doesn't work!
>
> On Tue, May 31, 2011 at 10:01 PM, jean-baptiste verrey
> <[email protected]> wrote:
> > it's made in JavaScript, by creating an iframe loading the file, but their
> > downloader might use something like a php file to force download such as
> > <?php
> > $filePath='/var/wwwblablah.zip';
> > header('Content-type: application/octet-stream');
> > header('Content-Disposition: attachment; filename="azipfile.zip"');
> > readfile($filePath);
> > ?>
> >
> > On 31 May 2011 18:02, Ali Asghar Toraby Parizy <[email protected]>
> > wrote:
> >>
> >> I want to build a web page for file auto download like cnet.download.
> >> A page that tells user "Your download will begin in a moment..." and
> >> after a few seconds download starts.
> >> How can I do that by php
> >> thanks for any help.
> >>
> >> --
> >> Ali Asghar Torabi
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
>
>
>
> --
> Ali Asghar Torabi
>
That's why Jean mentioned the use of Javascript and an Iframe. You have
the iframe point to your PHP script, and the rest of the page is what
you use for your message, etc. The Iframe can be hidden with CSS, and it
will still issue the call to download the file.
--
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
gosh, I should have read before answering for the downloader thing.
BUT you actually need javascript if you want to do it.
You create an hidden iframe somewhere on your page, you give him the url of
your file and pop it is downloaded, and you need simply to use javascript
function setInterval to do that after a couple of seconds!
On 31 May 2011 20:38, Ali Asghar Toraby Parizy
<[email protected]>wrote:
> Hi
> thanks for your help jean
> I've used this code before. But I want a little different thing.
> I need to tell something to the user before starting download.
> something like "Your download will begin in a moment..." . So header
> couldn't help me. If I try to echo anything header doesn't work!
>
> On Tue, May 31, 2011 at 10:01 PM, jean-baptiste verrey
> <[email protected]> wrote:
> > it's made in JavaScript, by creating an iframe loading the file, but
> their
> > downloader might use something like a php file to force download such as
> > <?php
> > $filePath='/var/wwwblablah.zip';
> > header('Content-type: application/octet-stream');
> > header('Content-Disposition: attachment; filename="azipfile.zip"');
> > readfile($filePath);
> > ?>
> >
> > On 31 May 2011 18:02, Ali Asghar Toraby Parizy <
> [email protected]>
> > wrote:
> >>
> >> I want to build a web page for file auto download like cnet.download.
> >> A page that tells user "Your download will begin in a moment..." and
> >> after a few seconds download starts.
> >> How can I do that by php
> >> thanks for any help.
> >>
> >> --
> >> Ali Asghar Torabi
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
> >
>
>
>
> --
> Ali Asghar Torabi
>
--- End Message ---
--- Begin Message ---
On Tue, May 31, 2011 at 8:49 PM, jean-baptiste verrey <
[email protected]> wrote:
> gosh, I should have read before answering for the downloader thing.
> BUT you actually need javascript if you want to do it.
> You create an hidden iframe somewhere on your page, you give him the url of
> your file and pop it is downloaded, and you need simply to use javascript
> function setInterval to do that after a couple of seconds!
>
You do not need javascript to do this, or an iframe. Use a meta refresh tag.
http://en.wikipedia.org/wiki/Meta_refresh
Sometimes I miss the way the web was before javascript :/
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
On 31 May 2011 20:38, Ali Asghar Toraby Parizy
> <[email protected]>wrote:
>
> > Hi
> > thanks for your help jean
> > I've used this code before. But I want a little different thing.
> > I need to tell something to the user before starting download.
> > something like "Your download will begin in a moment..." . So header
> > couldn't help me. If I try to echo anything header doesn't work!
> >
> > On Tue, May 31, 2011 at 10:01 PM, jean-baptiste verrey
> > <[email protected]> wrote:
> > > it's made in JavaScript, by creating an iframe loading the file, but
> > their
> > > downloader might use something like a php file to force download such
> as
> > > <?php
> > > $filePath='/var/wwwblablah.zip';
> > > header('Content-type: application/octet-stream');
> > > header('Content-Disposition: attachment; filename="azipfile.zip"');
> > > readfile($filePath);
> > > ?>
> > >
> > > On 31 May 2011 18:02, Ali Asghar Toraby Parizy <
> > [email protected]>
> > > wrote:
> > >>
> > >> I want to build a web page for file auto download like cnet.download.
> > >> A page that tells user "Your download will begin in a moment..." and
> > >> after a few seconds download starts.
> > >> How can I do that by php
> > >> thanks for any help.
>
--- End Message ---
--- Begin Message ---
On Wed, 1 Jun 2011, Ali Asghar Toraby Parizy wrote:
I need to tell something to the user before starting download.
something like "Your download will begin in a moment..." . So header
couldn't help me. If I try to echo anything header doesn't work!
Couldn't you just do an HTML redirect?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>File Download</title>
<meta http-equiv="REFRESH"
content="10;url=http://www.example.net/download"></HEAD>
<BODY>
<P>Your download will start in a few seconds.</P>
<P>If your download fails to start automatically,
<A HREF="http://www.example.net/download">click here</A>.</P>
</BODY>
</HTML>
Of course, this is the resulting HTML you want to produce (or something
like it). You'll obviously get PHP to echo the appropriate URL.
This approach has the benefit that it'll work on anything. My prefered
browser does not support javascript, so you look me out of your site if
you use it.
Geoff.
--- End Message ---
--- Begin Message ---
On Sun, May 29, 2011 at 14:56, Robert Cummings <[email protected]> wrote:
>
> Personally, I prefer the exception. Logically, I can take 0 from something
> an infinite number of times... zero seems a far cry from this. To properly
> determine the intent of a division by zero, I think the programmer SHOULD
> have to handle it.
>
> Personally, I don't see 0 as acceptable. It suggests improper boundary
> checking.
I'd like to see a patch against the core, or perhaps a PECL
module, that allows the use of explode() with empty parameters, which
will then cause the physical machine on which the code is hosted to
detonate itself. Unfortunately, it's unlikely we'll see that in the
5.3 branch.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
--- End Message ---
--- Begin Message ---
On 11-05-31 02:54 PM, Daniel Brown wrote:
On Sun, May 29, 2011 at 14:56, Robert Cummings<[email protected]> wrote:
Personally, I prefer the exception. Logically, I can take 0 from something
an infinite number of times... zero seems a far cry from this. To properly
determine the intent of a division by zero, I think the programmer SHOULD
have to handle it.
Personally, I don't see 0 as acceptable. It suggests improper boundary
checking.
I'd like to see a patch against the core, or perhaps a PECL
module, that allows the use of explode() with empty parameters, which
will then cause the physical machine on which the code is hosted to
detonate itself. Unfortunately, it's unlikely we'll see that in the
5.3 branch.
Sounds like feature blowt!
Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.
--- End Message ---
--- Begin Message ---
On 5/28/2011 12:34 PM, Andre Polykanine wrote:
> Hello Nathan,
>
> Do you mean $x{8}?
> That is good but not for all situations.
> I need sometimes to make an array with letters as keys and numbers as
> values, like this (I give English alphabet just as an example, so
> please don't suggest str_split):
> $alphabet="abcdefghijklmnopqrstuvwxyz";
> // I wish that worked
> $alphabet_array=explode('', $alphabet);
> $letter_numbers=array_flip($alphabet_array);
>
> this is just one case I encountered some time ago. Yes, I made this by
> separating letters with commas... but it's not the unique case when I
> need it.
Why not do it the other way around...
$alphabet_array=range('a','z');
$alphabet=join($alphabet_array);
$letter_numbers=array_flip($alphabet_array);
Jim Lucas
--- End Message ---