php-general Digest 16 Dec 2007 05:22:37 -0000 Issue 5183

Topics (messages 265929 through 265944):

Re: Multiple File Downloads
        265929 by: Richard Lynch
        265935 by: Al
        265942 by: David Giragosian

Re: how to handle inserting special characters into a mysql field
        265930 by: Richard Lynch
        265934 by: Børge Holen

Re: safe_mode_include_dir
        265931 by: Richard Lynch

Re: Help Sending Mail
        265932 by: Richard Lynch
        265939 by: Daniel Brown

Re: sftp connecting to remove server via php
        265933 by: Richard Lynch

php code compiles, produces good html output, but crashes when put through 
browser
        265936 by: Mary Anderson
        265937 by: Daniel Brown
        265944 by: Casey

Re: ezmlm warning
        265938 by: Daniel Brown

Re: [SOLVED] [PHP] FW: ezmlm warning
        265940 by: Andrés Robinet

Re: Generating Random Numbers with Normal Distribution
        265941 by: Richard Lynch
        265943 by: Daniel Brown

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 Fri, December 14, 2007 2:32 pm, David Giragosian wrote:
> Is there a way to download multiple files in one go, short of zipping
> them
> first into a single file?

No.

The HTTP protocol is "One Request, One Response Document"

Note that you can use PHP to dynamically build a zip file of whatever
documents the user chooses.
http://php.net/zlib

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
What are the files and what are you going to do with them at the client?

If they are to be an image mosaic, then compose it first and then send it.

If text docs, compose as a pdf and send it.

if just files, bundle them in a compressed file and let the user click on it to open the file.

David Giragosian wrote:
I've used Richard Lynch's Blog example for forcing the download of an
individual file.

Is there a way to download multiple files in one go, short of zipping them
first into a single file?

Concepts / directional shoves appreciated.

David


--- End Message ---
--- Begin Message ---
On 12/15/07, Al <[EMAIL PROTECTED]> wrote:
>
> What are the files and what are you going to do with them at the client?


They are going to be .csv files extracted from a DICOM treatment plan file.



> If they are to be an image mosaic, then compose it first and then send it.
>
> If text docs, compose as a pdf and send it.


That's a good idea.


if just files, bundle them in a compressed file and let the user click on it
> to
> open the file.


Probably the most expedient solution.


Thanks Al, and all.

David

--- End Message ---
--- Begin Message ---
On Fri, December 14, 2007 11:03 am, Adam Williams wrote:
> $query = sprintf("SELECT * FROM users WHERE user='%s' AND
> password='%s'",
>             mysql_real_escape_string($user),
>             mysql_real_escape_string($password));
>
> and I understand it uses the %s because of sprintf(), to indicate the
> data is a string.  However, thats not syntax I'm used to seeing.  If I
> rewrite the code to the following below, will it return the same
> results
> or error when queried?
>
> $user = mysql_real_escape_string($user);
> $password = mysql_real_escape_string($password)
> $query = "SELECT * FROM users WHERE user='$user' AND
> password='$password'";

Yes, you will get the same result.

You could have run both sets of code to try it faster than I typed
this answer.

:-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Saturday 15 December 2007 18:59:12 Richard Lynch wrote:
> On Fri, December 14, 2007 11:03 am, Adam Williams wrote:
> > $query = sprintf("SELECT * FROM users WHERE user='%s' AND
> > password='%s'",
> >             mysql_real_escape_string($user),
> >             mysql_real_escape_string($password));
> >
> > and I understand it uses the %s because of sprintf(), to indicate the
> > data is a string.  However, thats not syntax I'm used to seeing.  If I
> > rewrite the code to the following below, will it return the same
> > results
> > or error when queried?
> >
> > $user = mysql_real_escape_string($user);
> > $password = mysql_real_escape_string($password)
> > $query = "SELECT * FROM users WHERE user='$user' AND
> > password='$password'";
>
> Yes, you will get the same result.
>
> You could have run both sets of code to try it faster than I typed
> this answer.

lol, love those comment, but I'm horrible myself, to ask these kind of 
questions =D

>
> :-)
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?



-- 
---
Børge Holen
http://www.arivene.net

--- End Message ---
--- Begin Message ---
On Thu, December 13, 2007 1:49 pm, Nisse Engström wrote:
> On Wed, 12 Dec 2007 15:43:28 -0500, "Daniel Brown" wrote:
>
>>     Is there a specific reason you're using require_once() instead
>> of
>> include_once() ?  There actually is a difference.... include() and
>> include_once() will only include the file if that line of code is
>> executed, whereas require() and require_once() will include the file
>> even if the line is inside of an if() {} block for which the
>> condition(s) are never matched.
>
> Is that still the case?
>
> <http://se2.php.net/manual/en/function.require.php>:
>
>    "require() and include() are identical in every way except
>     how they handle failure."
>
>    "Note: Prior to PHP 4.0.2, the following applies: require()
>     will always attempt to read the target file, even if the
>     line it's on never executes."

The manual is correct.

The only real difference these days is that require issues an E_ERROR
(which halts processing) and include issues an E_WARNING (which lets
your script continue)

In olden times, the differences were bigger and more subtle, such as
order of compilation etc.  Few folks grokked it, and even fewer (like,
none) needed it, so it got simplified.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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

On Tue, December 11, 2007 4:24 pm, Daniel Brown wrote:
> On Dec 11, 2007 12:20 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> I dunno if RFC822 specifies which ending but I *do* know that this
>> breaks the current PEAR mimePart.php code.
>
>     RFC 822 has been obsolete since RFC 2822 was introduced in 2001.
>
>     We (that is, myself and other members of the IETF) are working on
> a new BIS/Draft for a new RFC that will revise (obsolete certain parts
> of) 822 and 2822.  However, it's already been mentioned that headers
> should remain as standardized in 2822 (which I think will most likely
> be the case).

822, 2822, whatever.

Just tell GMail to fix their dang code or get the PEAR guys to fix
theirs so it works!

:-) :-) :-)

PS
I don't even know what the standard *IS* for newlines in email headers
anymore.
I just plain gave up on it, as nobody is following it.
A standard nobody follows isn't a standard; It's a waste of paper.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Dec 15, 2007 1:09 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> A standard nobody follows isn't a standard; It's a waste of paper.

    Only if you printed it out in the first place.  ;-P

    That aside, I completely agree with you.  It's sort of like the ^M
versus \n versus \r\n line terminators and how they differ across
operating systems.  I fail to see the necessity in changing something
so fundamental.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
On Tue, December 11, 2007 2:01 pm, blackwater dev wrote:
> I have to write a script that will connect to a remove server using
> sftp and
> pull in specific files for processing.  Currently I can get to the
> server by
> just using sftp [EMAIL PROTECTED]  How can I open these files via php?
> Is the
> only way to use fopen with the PECL sftp, ssh2 modules?

You could probably re-write all that code yourself, so it's not the
ONLY way, but, yeah, the only simple way, probably...

It should be pretty easy, really...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
Hi,
  Need some help with debugging procedures.

This is a postgresql/PHP running with PHP 5. I have used both IE7 and mozilla 5.0 with this file. The postgres part works fine, and the html that is generated is OK, but the .php file hangs when I run it through the browser.

I have two tables -- data_series and data_sets with a 1-many relation between the data_series and data_sets. My page first displays the data_series in a <select>. Then it pulls the data_sets belonging to user selected data_series and displays them in a select. There are links to .php files to process the selected data_set.



My code

http://demog.berkeley.edu/~maryfran/memdev/get_data_set.php

compiles OK when I run php on it from the shell. It produces html forms which will load into the browser and run as expected. However when I try to run the .php file in the browser it parses the head, displays the title, and then hangs. No error messages are displayed, even though I have called error_reporting(E_ALL) at the very top of the .php file. I had an echo statement on each line of php code. None were printed out. I checked permissions on the .php file. Changing them did not improve the situation.

I need some basic debugging tools that I don't have to figure out what is going on. Alas, I think this code would hang before it got to the debugger! Any advice is appreciated. At this point I am clueless.

Mary Anderson

--- End Message ---
--- Begin Message ---
On Dec 15, 2007 4:55 PM, Mary Anderson <[EMAIL PROTECTED]> wrote:
>
> My code
>
> http://demog.berkeley.edu/~maryfran/memdev/get_data_set.php
>

    Mary,

    Can you provide the actual code for the page?  None of us can
really help you out too much without seeing more than a blank page.


-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
Comment out all Javascript.



On Dec 15, 2007, at 2:00 PM, "Daniel Brown" <[EMAIL PROTECTED]> wrote:

On Dec 15, 2007 4:55 PM, Mary Anderson <[EMAIL PROTECTED]> wrote:

My code

http://demog.berkeley.edu/~maryfran/memdev/get_data_set.php


   Mary,

   Can you provide the actual code for the page?  None of us can
really help you out too much without seeing more than a blank page.


--
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

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


--- End Message ---
--- Begin Message ---
On Dec 15, 2007 12:10 PM, Andrés Robinet <[EMAIL PROTECTED]> wrote:
> I've just got this message... I also see no updates here
> http://news.php.net/php.general/ since Friday. Any clues on what's going
> on??

    Looks to me like there was some reason that the emails being sent
to you were bouncing, Rob.  As for the news page, I just sent a help
response a few moments ago and that's already archived at the bottom
of the page, so that seems to be working fine.

-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---
--- Begin Message ---
I know what's the issue now. The mailing list software was sending me a
notification about some bounces, dated Dec 4th (which I didn't notice at
first). That's ok since we had an issue with Exim and we stopped it some
time for maintenance.

I thought it was a recent issue, because I got this message today. Since
yesterday we've enabled RBL checking in Exim I thought it was that, but then
I went to the online version of the list and I noticed there were no posts
for today, so the list could also be the problem. Now I know it's neither of
them, it's just a delayed warning.

Thank you all,

Rob

Andrés Robinet | Lead Developer | BESTPLACE CORPORATION
5100 Bayview Drive 206, Royal Lauderdale Landings, Fort Lauderdale, FL 33308
| TEL 954-607-4207 | FAX 954-337-2695
Email: [EMAIL PROTECTED]  | MSN Chat: [EMAIL PROTECTED]  |  SKYPE:
bestplace |  Web: http://www.bestplace.biz | Web: http://www.seo-diy.com

> -----Original Message-----
> From: Daniel Brown [mailto:[EMAIL PROTECTED]
> Sent: Saturday, December 15, 2007 7:04 PM
> To: Andrés Robinet
> Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-
> [EMAIL PROTECTED]
> Subject: Re: [PHP] FW: ezmlm warning
> 
> On Dec 15, 2007 12:10 PM, Andrés Robinet <[EMAIL PROTECTED]>
> wrote:
> > I've just got this message... I also see no updates here
> > http://news.php.net/php.general/ since Friday. Any clues on what's
> going
> > on??
> 
>     Looks to me like there was some reason that the emails being sent
> to you were bouncing, Rob.  As for the news page, I just sent a help
> response a few moments ago and that's already archived at the bottom
> of the page, so that seems to be working fine.
> 
> --
> Daniel P. Brown
> [Phone Numbers Go Here!]
> [They're Hidden From View!]
> 
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
On Wed, December 12, 2007 11:07 pm, Robert Cummings wrote:
> Once again, we're not trying to prove order. Order obviously exists.

I'm not sure I'd agree that order exists in the first place, much less
randomness or disorder.  They could all be solely our human incorrect
interpretation.

And I've also never claimed to be sane either.

So there.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
On Dec 15, 2007 6:10 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Wed, December 12, 2007 11:07 pm, Robert Cummings wrote:
> > Once again, we're not trying to prove order. Order obviously exists.
>
> I'm not sure I'd agree that order exists in the first place, much less
> randomness or disorder.  They could all be solely our human incorrect
> interpretation.
>
> And I've also never claimed to be sane either.
>
> So there.

    That's good, because no one here would believe you if you did.

    Order, disorder, chaos, stability, randomness, et cetera, are all
just relative definitions so that we can wrap the bone in our heads
around concepts and theories under the weight of which we'd otherwise
collapse.


-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

--- End Message ---

Reply via email to