OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
php-general Digest 13 May 2007 16:22:33 -0000 Issue 4789

php-general-digest-helplists.php.net
Date: Sun May 13 2007 - 11:22:33 CDT


php-general Digest 13 May 2007 16:22:33 -0000 Issue 4789

Topics (messages 254862 through 254898):

Re: Question
        254862 by: Robert Cummings
        254863 by: Robert Cummings
        254866 by: Richard Lynch

Re: Tag Cloud revisited
        254864 by: Richard Lynch

Re: Passing an array as a hidden variable
        254865 by: Richard Lynch

Re: Function Declared in Included File Not Being Found
        254867 by: Richard Lynch
        254868 by: Richard Lynch
        254887 by: Chris
        254894 by: Stut

Re: Processing a table of input fields
        254869 by: Richard Lynch

Re: self:: vs this
        254870 by: Richard Lynch

Application support both chinese and english lang
        254871 by: suresh kumar
        254881 by: Richard Lynch

Re: import dbf files
        254872 by: Richard Lynch

Re: finding next and prev record in mysql
        254873 by: Richard Lynch

Re: What is the best way to protect the PHP page that returns the AJAX data?
        254874 by: Richard Lynch

Re: What is the best way to protect the PHP page that returns the AJAX data? [solved]
        254875 by: Richard Lynch
        254895 by: Stut

Re: PHP & MySQL
        254876 by: Richard Lynch

php can do this
        254877 by: suresh kumar
        254880 by: Richard Lynch

Re: PHP sorting csv array output
        254878 by: Richard Lynch

Re: sqlite if query changes to empty on a loop
        254879 by: Richard Lynch

Re: GET variable unexpectedly assigned to session variable
        254882 by: Richard Lynch
        254883 by: Richard Lynch

Re: sorting via PHP or MySQL?
        254884 by: Richard Lynch

Re: scrolling HTML tables
        254885 by: Richard Lynch

Re: WSDL Generator class
        254886 by: Richard Lynch

Making code public -- What steps to take? GPL?
        254888 by: Micky Hulse
        254889 by: Micky Hulse
        254890 by: Daniel Brown
        254891 by: Tijnema !
        254892 by: Micky Hulse
        254893 by: Micky Hulse
        254896 by: Crayon Shin Chan
        254897 by: Daniel Brown

php5 include() problem
        254898 by: Al

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


On Sat, 2007-05-12 at 23:03 -0500, Richard Lynch wrote:
> On Sat, May 12, 2007 7:19 pm, Dusan Novakovic wrote:
> > Hi!
> > I need a script which will run pop-up menu with the "Save As" button
> > when I click on a link (e.g. <a href="file.txt">Click</a> ) so that I
> > could save that file on my computer. In the example I wrote file.txt
> > file opens in browser, which I don`t want to happen.
> > I would be very grateful if someone could send me a possible solution
> > to this problem.
>
> You may find this entertaining, and even useful:
> http://richardlynch.blogspoot.com

I'm sure Richard meant

    http://richardlynch.blogspot.com

Unless he's trying to promote bondage and S&M >:)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


On Sun, 2007-05-13 at 00:24 -0400, Robert Cummings wrote:
> On Sat, 2007-05-12 at 23:03 -0500, Richard Lynch wrote:
> > On Sat, May 12, 2007 7:19 pm, Dusan Novakovic wrote:
> > > Hi!
> > > I need a script which will run pop-up menu with the "Save As" button
> > > when I click on a link (e.g. <a href="file.txt">Click</a> ) so that I
> > > could save that file on my computer. In the example I wrote file.txt
> > > file opens in browser, which I don`t want to happen.
> > > I would be very grateful if someone could send me a possible solution
> > > to this problem.
> >
> > You may find this entertaining, and even useful:
> > http://richardlynch.blogspoot.com
>
> I'm sure Richard meant
>
> http://richardlynch.blogspot.com
>
> Unless he's trying to promote bondage and S&M >:)

BTW Richard, my Opera browser (9.10 linux) opened up this link as a page
containing text:

    http://l-i-e.com/blogger/download.php?filename=iwant.xyz

No download dialog. I want my cookie :)

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


On Sat, May 12, 2007 11:40 pm, Robert Cummings wrote:
> BTW Richard, my Opera browser (9.10 linux) opened up this link as a
> page
> containing text:
>
> http://l-i-e.com/blogger/download.php?filename=iwant.xyz

If Opera IGNORES the RFC-mandated application/octet-stream as forcing
a download, it's BROKEN.

This has been in every RFC since HTTP 1.0...

[ugugvideo junk]$ wget --server-response
http://l-i-e.com/blogger/download.php?
filename=iwant.xyz
--00:01:53-- http://l-i-e.com/blogger/download.php?filename=iwant.xyz
           => `download.php?filename=iwant.xyz.1'
Resolving l-i-e.com... done.
Connecting to l-i-e.com[67.139.134.202]:80... connected.
HTTP request sent, awaiting response...
 1 HTTP/1.1 200 OK
 2 Date: Sun, 13 May 2007 05:08:47 GMT
 3 Server: Apache/1.3.37 (Unix) DAV/1.0.3 PHP/4.4.1 mod_ssl/2.8.28
OpenSSL/0.9.8
b
 4 X-Powered-By: PHP/4.4.1
 5 Content-length: 50
 6 Keep-Alive: timeout=15, max=100
 7 Connection: Keep-Alive
 8 Content-Type: application/octet-stream
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
any http client that does't do a download here is just plain broken...

100%[====================================>] 50 48.83K/s
ETA 00:00

00:01:53 (48.83 KB/s) - `download.php?filename=iwant.xyz.1' saved [50/50]

> No download dialog. I want my cookie :)

Here's your cookie:
http://l-i-e.com/cookie.php
:-)

PS
Does the one where I juke the URL to just be iwant.xyz work right at
least?...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Sat, May 12, 2007 11:46 am, tedd wrote:
> Sorry to get back to this so late, but I had some other pressing
> matters.

No worries.

It's not like I'm likely to disappear from here anytime soon :-)

>>Thanks to Tedd for answering the question I asked, I think, even
>>though I was asking the wrong question. :-)
>
> No problem, but you did ask the right question. You touched on
> something I think you intuitively knew, but have been sidetracked by
> an easy "solution".
>
> At 9:40 AM -0500 5/3/07, Richard Lynch wrote:
>>But as I realized last night, the data is ALREADY in that "curve" and
>>by simply breaking down in even increments from MIN to MAX, the
>>"curve" works itself out correctly.
>
> Sort of.
>
> If you are content with dividing the top 100 things into strict
> groups of 20 for a tag cloud distribution, then fine. However, the
> "20 items per group" rule is not defined in terms of the group's
> distribution, which would be a better representation of the data.
> Keep in mind you are trying to show which items are the most popular
> in a representative way.

I'm not dividing them into groups of 20.

I'm taking the min/max of the top 100, and dividing the SCALE into 5
equal chunks.

The scores themselves are weighted already, with only one or two in
the top 1/5th, a handful in the 2nd 1/5th, a goodly number in the 3rd
1/5th, a lot in the 4th 1/5th, and a buttload are down in that last
1/5th.

In other words, I took the Top 100, and graphed them on normal
cartesian graph paper -- What I was originally trying to do was graph
them on logarithmic paper.

> It's difficult to explain, so I'll show you:
>
> http://sperling.com/a/stdev/
>
> Each group (color -- could be tags) falls within a division based
> upon the standard deviation (SD) of the population. The cyan group is
> within one SD of the most popular -- the yellow group is within two
> SD of the most popular and so on.
>
> All members of each color group have more in common with each other
> than with those outside their color group. If you will note, the
> numbers of each color group change due to distribution of the
> population. Using a strict "20 items per group" rule does not reflect
> that. So, if you arbitrarily assign members of the population to a
> group based solely on a strict division, then you are not accurately
> representing the tag cloud.

If I took the first 20, second 20, etc, yeah, that would be way wrong
as well.

I didn't do that.

I just scaled my "grid" upon which to graph them in cartesian space at
an offset of MIN(top100) - MAX(top100) and then let the chips fall
where they may on graphing.

> Do you see what I mean?

Yes -- I think we ended up with pretty much the same result...

Well, not the *same*, but very similar shaped curves anyway.

But my way was "easier" as I just let the natural distribution of the
data on standard graph paper take care of distributing the points
where they belonged.

I suppose there is some merit to forcing the Standard Distribution
instead of living with whatever the "real" data is.

But I'm more happy living with the Reality of the data than applying a
Standard Distribution to data which, according to some experts, isn't
even a Standard Distribution at all, but a "long tail" or some other
terms they bandy about that mean the same thing as "long tail" as I
understand it...

I don't claim my way is "right" -- just that it "works" and is dead
easy and is data-driven rather than conforming to some statistical
model which may or may not be the correct model in the first place.

If somebody NEEDS a Standard Distribution, for sure use Tedd's stuff,
cuz that is what that is.

If you're just trying to "graph" the data that have, whatever it may
be, just graph it, scaled and offset, and see what kind of curve you
have.

PS
I'll post the actual tag cloud page link once it's out of QA and not
hidden from search engines behind HTTP Basic Auth. RSN, but
definiitely not until after php|tek:
http://phparch.com/tek

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 11:53 pm, Todd Cary wrote:
> When I use the following syntax, the 2 dimensional array loses
> it's contents. Can an array be passed this way?
>
> <? echo '<input type="hidden" name="attend_ary_save" value=' .
> $attend_ary_save .'>'; ?>

No.

You'll just get "Array" back.

You can do a few things:

<?php
  foreach($attend_ary_save as $k1 => $v1){
    foreach($v1 as $k2 => $v2){
      ?><input type="hidden" name="attend_ary_save[<?php echo
$k1?>][<?php echo $k2?>]" value="<?php echo $v2?>" /><?php
    }
  }
?>
Actually, you should wrap htmlentities() around each value being
echo-ed out.

Another option is to http://php.net/serialize the data before you send
it to HTML, and then (duh) unserialize it when it comes back.

Or, be REALLY smart, and use session_start() and just put the array in
$_SESSION and don't send data back-n-forth over HTTP, which is A)
expensive, and B) subject to user tampering, and C) inefficient.

Actually, A and C technically depend on your bandwidth versus hard
drive speed, or wherever you store you session data, so, in theory, it
could be cheaper or more efficient to use HTTP... But I sure doubt it
in any real world hardware setup.

PS Just FYI, internally, PHP's session data is just serialized the
same way you'd do it for HTTP.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 3:43 pm, Chris wrote:
> Hello,
>
> According to the PHP manual on functions (http://www.php.net/manual/
> en/language.functions.php):
>
> "In PHP 3, functions must be defined before they are referenced. No
> such requirement exists since PHP 4. Except when a function is
> conditionally defined..."

Does moving the require BEFORE the if/else change anything?

> If that is true then why does the following not work as I expect?

Not sure, really...

Seems like you're right, but maybe I'm also missing something.

If you take out the 'require' statements, and just put c inside a,
does it work?

> I expect the result to be "Function was called!" but it actually is
> "Function test() does not exist!".

Perhaps the if (function_exists()) business is trying to be "smart"
and is run because at the time it was compiled, the function didn't
exist, so you could define the function there -- which is a much more
common idiom than what you are doing, truth to tell...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 6:15 pm, jekillen wrote:
> One reason I believe is that including a file in an included file will
> not work.
> file a includes file b wnich includes file c, code in file c will not
> register. (if
> I remember the manual correctly)

I dunno what you were reading, but almost for sure, you've interpreted
it incorrectly... :-)

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Richard,

Neither removing the if/else nor the function_exists() not call worked.

If I declared the function in the same file I called it works even
when defining it after the call.

If the function is declaring in a different file than the one I call
it in and I include the files after the call, it simply doesn't work.
Unless I did something subtly wrong or am back on the drugs.

This SEEMS contrary to the documentation.

The "issue" occurs in PHP-CLI 4.4.4, PHP 5.2.1, and PHP 5.2.2.

I'll files a bug report in the hope of an explanation but I'm pretty
sure that it isn't considered a bug.

Chris

On May 13, 2007, at 1:38 AM, Richard Lynch wrote:

> On Fri, May 11, 2007 3:43 pm, Chris wrote:
>> Hello,
>>
>> According to the PHP manual on functions (http://www.php.net/manual/
>> en/language.functions.php):
>>
>> "In PHP 3, functions must be defined before they are referenced. No
>> such requirement exists since PHP 4. Except when a function is
>> conditionally defined..."
>
> Does moving the require BEFORE the if/else change anything?
>
>> If that is true then why does the following not work as I expect?
>
> Not sure, really...
>
> Seems like you're right, but maybe I'm also missing something.
>
> If you take out the 'require' statements, and just put c inside a,
> does it work?
>
>> I expect the result to be "Function was called!" but it actually is
>> "Function test() does not exist!".
>
> Perhaps the if (function_exists()) business is trying to be "smart"
> and is run because at the time it was compiled, the function didn't
> exist, so you could define the function there -- which is a much more
> common idiom than what you are doing, truth to tell...
>
> --
> 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/browse/from/lynch
> Yeah, I get a buck. So?
>
>

attached mail follows:


Chris wrote:
> Richard,
>
> Neither removing the if/else nor the function_exists() not call worked.
>
> If I declared the function in the same file I called it works even when
> defining it after the call.
>
> If the function is declaring in a different file than the one I call it
> in and I include the files after the call, it simply doesn't work.
> Unless I did something subtly wrong or am back on the drugs.
>
> This SEEMS contrary to the documentation.
>
> The "issue" occurs in PHP-CLI 4.4.4, PHP 5.2.1, and PHP 5.2.2.
>
> I'll files a bug report in the hope of an explanation but I'm pretty
> sure that it isn't considered a bug.

It's not contrary to the documentation. The docs say that a function
does not need to be declared before use - this is true, so long as it's
declared in the same file.

When PHP parses a file it first looks through it looking for
declarations and adds them to the global scope. It then goes through it
again executing the code. Require/include and their _once versions don't
get executed until the second pass, and they get done at the point where
they're called.

So, if you're going to use functions in an included file, you need to
include that file before trying to use them. If you're using functions
in the same file, the order of things in that file does not matter.

This is *not* a bug!!

Hope that clears it up.

-Stut

> On May 13, 2007, at 1:38 AM, Richard Lynch wrote:
>
>> On Fri, May 11, 2007 3:43 pm, Chris wrote:
>>> Hello,
>>>
>>> According to the PHP manual on functions (http://www.php.net/manual/
>>> en/language.functions.php):
>>>
>>> "In PHP 3, functions must be defined before they are referenced. No
>>> such requirement exists since PHP 4. Except when a function is
>>> conditionally defined..."
>>
>> Does moving the require BEFORE the if/else change anything?
>>
>>> If that is true then why does the following not work as I expect?
>>
>> Not sure, really...
>>
>> Seems like you're right, but maybe I'm also missing something.
>>
>> If you take out the 'require' statements, and just put c inside a,
>> does it work?
>>
>>> I expect the result to be "Function was called!" but it actually is
>>> "Function test() does not exist!".
>>
>> Perhaps the if (function_exists()) business is trying to be "smart"
>> and is run because at the time it was compiled, the function didn't
>> exist, so you could define the function there -- which is a much more
>> common idiom than what you are doing, truth to tell...
>>
>> --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/browse/from/lynch
>> Yeah, I get a buck. So?
>>
>>
>
> --PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

attached mail follows:


Use name="attend[<?php echo $user_id?>]"

This will simplify life immensely on the processing side where you can
just iterate through $_POST['attend'] as an array and have the
$user_id.

Ditto for the pay[<?php echo $user_id?>] and other fields.

Note that the checkboxes will ONLY send in keys/values for the checked
ones -- You get nothing for the unchecked ones -- which is fine, you
assume they weren't there if they weren't checked.

On Fri, May 11, 2007 1:22 pm, Todd Cary wrote:
> I create a table of input fields so the user (secretary at a
> Rotary meeting) can check mark if the person attended and how
> much they paid for lunch. Each input field name has the user ID
> as part of it. What is the best way to process the table when
> the submit button is pressed? There are about 50 rows in the table.
>
> Sample of one row for member 590:
>
> <tr>
> <td><input type="checkbox" name="590_attend" value="1">
> </td>
> <td>05/11/2007</td><td>Theressa</td><td>Bryant</td><td><input
> type="text" name="590_pay" value="16" size="5" maxlength="4"></td>
> <td><input type="text" name="590_charge" value="16" size="5"
> maxlength="4"></td>
> <td><input type="text" name="590_note"" size="26"
> maxlength="25"></td>
> </tr>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 12:28 pm, Eric Butera wrote:
> On 5/11/07, M.Sokolewicz <tularisphp.net> wrote:
>> statically:
>> Class Foo {
>> static $a = 1;
>> static function Bar() {
>> self::a++;
>> }
>> }

Use self:: only when you don't have an actual instance handy, is a
general rule, I think...

self:: is kinda like using the Plato-like "ideal" of the class --
there's no actual instantiated real-world "thing" to work on.

You're working with an abstract non-existant idealized non-object.

$x (or $this) you are working with an actual real-life instantiated
"object".

Disclaimer:
This is how I thought of it in C++, rather than a ton of experience in
PHP...

PS
PHP 6 may become more "strict" about using / not using self:: where it
"should" be used... Depends on how the Internals 'discussions' pan
out...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hi,
   
      I am developing one application using PHP and MySQL.Right now my application supports English language.i like to integrate chinese language in my application.i like to implement similar to this website.
   
      http://www.dynasign.net.cn/dynasign/login.do
   
      'Language' combo box contain 'English' and 'chinese',when user select 'English'.i like to display the page details in english and when he select 'chinese' i like to display page details in 'chinese'.
   
    i set the <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> .but chinese font is not displaying.i think we need to do some PHP programatic unicode conversion.I dont know how to proceed .
   
     I am looking for some help from you guys.
   
                                                                        A.suresh
   
   

       
---------------------------------
 Office firewalls, cyber cafes, college labs, don't allow you to download CHAT? Here's a solution!

attached mail follows:


A) Try the i18n list on php.net
B) I think Chinese might need UTF-16... Or maybe simplified Chinese
doesn't can be done in UTF-8... I'm just guessing wildly at this
point...

On Sun, May 13, 2007 1:02 am, suresh kumar wrote:
> Hi,
>
> I am developing one application using PHP and MySQL.Right now my
> application supports English language.i like to integrate
> chinese language in my application.i like to implement similar
> to this website.
>
> http://www.dynasign.net.cn/dynasign/login.do
>
> 'Language' combo box contain 'English' and 'chinese',when user
> select 'English'.i like to display the page details in english
> and when he select 'chinese' i like to display page details in
> 'chinese'.
>
> i set the <META HTTP-EQUIV="Content-type" CONTENT="text/html;
> charset=UTF-8"> .but chinese font is not displaying.i think we
> need to do some PHP programatic unicode conversion.I dont know how
> to proceed .
>
> I am looking for some help from you guys.
>
> A.suresh
>
>
>
>
> ---------------------------------
> Office firewalls, cyber cafes, college labs, don't allow you to
> download CHAT? Here's a solution!

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 8:23 am, Bosky, Dave wrote:
> My goal is to be able to import dbf files into MySQL on a nightly
> basis.
>
> Can I enable dbase support by uncomment the dbase extension entry in
> the
> php.ini file or is there more to it?

On Windows, assuming you have the dbase DLL matching your PHP version
in the extensions directory, that's almost all there is to enabling
dbase, I presume -- that's how all the other extensions work...

You also have to re-start Apache, or IIS, or the whole machine,
depending on what you are running and how MS feels that day.

> Are there any working examples available that read and import dbf
> files?

Can you export dbf to something like CSV or tab-delimited?

There are usually stock tools for that, which are efficient and
well-tested.

Importing a CSV or tab-delimited is also stock/easy/efficient/robust.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 11:54 pm, Richard Kurth wrote:
> How would I find the next id and the prev id in sql statement like the
> one
> below. The id number is not going to be in order so I can't do a < or
> >
> limit 1 on the search
>
> SELECT id FROM contacts WHERE category = '5' AND subcategory = '1' AND
> members_id= '8' ORDER BY lastname

You really really shouldn't be using an ID field for any kind of
"order" involving next/prev... It's just a Bad Idea from the
get-go...

An ID is supposed to be more abstract than that, really.

That said, the IDs in MOST dbs *are* in order, and you *can* just
write a query using the result from the one you already have with <
and get the previous, and another query with > to get the next. Limit
1 on both queries.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 10:18 pm, Daevid Vincent wrote:
> Like most sites, someone needs to join up to use mine.

Errr.

To be pedantic, I don't think "most" sites require registration,
actually... :-)

I'm not saying it's "bad" or anything, just that there's still way
more HTML pages out there with free access and no registration than
pages that require registration -- and I do think that fact that
there's more "free" stuff than "requires registration" stuff is a very
good thing, on the whole.

> I'm using a wee-bit-o-AJAX to pull some results from a database and
> display them dynamically.
>
> For the AJAX to work, it has to hit a script that's accessible from
> the htdocs tree right?

Well...

It has to be accessible from *SOME* htdocs tree *somewhere*.

Doesn't *have* to be the same doctree, nor even the same server.

Though the browser might warn the user that you're maybe trying to
"fool" them if the feeds don't all come from the same domain, and if
you don't jump through Javascript hoops to explicitly allow yourself
to use multiple domains...

> Effectively it's just a (JavaScript initiated) GET URL request
> correct?

Yes.

Or it could be POST, I presume, if you wanted.

Technically, I suppose it could even be HEAD or PUT or something even
more esoteric...

> For example, index.html calls
> http://example.com/gimmedata.php?query=foo
> That in turn returns a JS formatted array which is eval() in JS and
> rendered on the page.

You don't HAVE to return actual JS code.

You could return XML and have JS process the XML.

Or there's some nifty JSON data form expressly made-up for AJAX, as I
understand it.
http://php.net/json

> My question is, how do you protect gimmedata.php since it's sitting
> out there sans normal web headers and stuff?

Well, you definitely won't protect it at all if it's "out there"
without requiring the login, so don't do that.

Require the login, then figure out how to get the JS to be
authenticated, without exposing the user's password in the process.

> Can it include session_start() and do all that wonderful checking to
> make sure the user is logged in before just happily doling out
> my precious data?

Sure. But then your JS has to be ready to send the cookies and all
that...

I presume that's the grunge stuff the AJAX framework thingies handle
for you.

Or you can find JS code to do it in seconds of googling.

It's not exactly rocket science.

AJAX is just like curl, only not, and on the browser side from
JavaScript instead of server-side from PHP, if that helps. :-)

> What is the proper, secure, sanctioned and AJAX/PHP blessed way to do
> this?

How secure is "secure enough"?

Are you passing around financial instruments -- actual money?

Is it medical data?

Confidential peronsal information?

Super-expensive subscription data worth thousands of dollars?

Nobody can answer this for you until you explicitly state just how
secure is secure enough, and for all of the above, the answer might be
"just don't do that"...

If it's not *that* sensitive, then a standard cookie session should be
enough for *most* uses.

Maybe you'll want to use SSL to protect the data in transit.

> I could set up a test environment and hack up something I'm sure --
> and probably will if I get too impatient, but nobody seems to
> address this issue in any examples, they just do it as if information
> is *gasp* free. I'm a PHP guru, but I am also an AJAX novice.
> From what I gather, the return is really in XML transport format and
> all the magic of converting to/from XML is transparent to me. I
> worry that putting other headers or whatever may "corrupt" that?

The AJAX thingies I've seen are using XmlHttpRequest object, which is
*expecting* an HTTP response...

So it's expecting the usual headers you're thinking of.

So if you don't have them, or at least some of them, it most likely
won't work at all.

Whether it will handle the cookies or HTTP Basic Auth properly or not
is up the the AJAX framework or your XmlHttpRequest-handling code...

You either send the cookies or Auth credentials, or it won't work.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Fri, May 11, 2007 9:59 pm, heavyccaseygmail.com wrote:
> Set ajaxObject.setRequestHeader("User-Agent","SecretName"); in
> Javascript and check for it in PHP. Not fool-proof, but the average
> person wouldn't be able to get in.

Unless the user "View Source" and read your AJAX code...

This is not going to stop any serious attempt, but as one more
defense-in-depth mechanism, it wouldn't hurt.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Richard Lynch wrote:
> On Fri, May 11, 2007 9:59 pm, heavyccaseygmail.com wrote:
>> Set ajaxObject.setRequestHeader("User-Agent","SecretName"); in
>> Javascript and check for it in PHP. Not fool-proof, but the average
>> person wouldn't be able to get in.
>
> Unless the user "View Source" and read your AJAX code...
>
> This is not going to stop any serious attempt, but as one more
> defense-in-depth mechanism, it wouldn't hurt.

Unless the user is using a browser or going through a proxy that strips
or replaces the User-Agent header.

-Stut

attached mail follows:


On Thu, May 10, 2007 3:42 pm, Jason Pruim wrote:
> I know this isn't strictly a PHP question, and I apologize in advance
> for that. I'm trying to setup a website for some of my customers that
> would allow them to update a database on their schedule, making it
> easier for us to have the most up to date info, and taking some of
> the work off of us.
>
> Right now, the question I have is, how would I be able to select
> certain records to be deleted (Or moved to another table called
> "deleted")? Is it as simple as looping through the database, having
> them check a checkbox, and then hit a "remove" button?

Yes, it is that easy, if you want to make it that easy.

> As I go, I will be adding a login screen to it, and hopefully
> protecting against SQL injection attacks... But right now, I'm still
> just learning and trying.

Do the SQL injection defense FIRST.

Do the login screen SECOND.

Then write the delete code.

Writing it backwards from that is just too risky.

Unless your dev boxes are all behind a firewall and inaccessible to
the public in the first place...

> The SQL syntax is easy enough for me to figure out, but the php is
> throwing me off right now...

Read any PHP/MySQL tutorial or textbook you like.

99% of what you need is handed to you on a platter in those.

> Currently here is the code I'm working with on the page to display it:
>
> $link = mysql_connect($server, $username, $password)
> or die('Could not connect: ' . mysql_error());
> echo 'Connected successfully <BR>';
> mysql_select_db('legion') or die('Could not select database' .
> mysql_error());
> echo 'DB selected <BR>';
>
>
>
> $result = mysql_query("SELECT * FROM current") or die(mysql_error());
> while($row = mysql_fetch_array($result)) {
> $FName = $row["FName"];
> $LName = $row["LName"];
> $Add1 = $row["Add1"];
> $Add2 = $row["Add2"];
> $City = $row["City"];
> $State = $row["State"];
> $Zip = $row["Zip"];
> $Date = $row["Date"];
>
>
> echo "$FName, $LName, $Add1, $Add2, $City, $State, $Zip, $Date<BR>";
> };
>
> I'm sure there is an easier way to do that as well... But this way
> worked :)

It's fine so far, as a start.

You can quibble over using different ways to get all those variables,
but you haven't messed up yet.

Except for not calling http://php.net/htmlentities on all the data you
send to the browser, in case, say, $Add1 contains "Main & State".

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hi,
     I want to know whether its possible to implement this functionality in PHP and MySQL.. I will allow web users to download one .bat file from my Application.
   
     This .bat contains something like this 'c:\\program files\Internet Explorer\iexplore.exe' http://xxxxx.com/download.php"
   
     download.php file will contain images for downloading.
   
     when he execute this .bat file from his local machine. I need to download some image files from the server to his local hard drive.i want to download automatically to this hard drive.
  
   (I don't want 'save as' dialog box where user can select the location to download.)
  
   In PHP code(server).Is there any way where i can tell the images to get download automatically to the local user desktop.
  
   I searched google.but i can't able to find any solution
   
     i am looking for some help from you guys.
   
                                                                    A.suresh

               
---------------------------------
 Office firewalls, cyber cafes, college labs, don't allow you to download CHAT? Here's a solution!

attached mail follows:


On Sun, May 13, 2007 1:43 am, suresh kumar wrote:
> Hi,
> I want to know whether its possible to implement this
> functionality in PHP and MySQL.. I will allow web users to
> download one .bat file from my Application.
>
> This .bat contains something like this 'c:\\program
> files\Internet Explorer\iexplore.exe'
> http://xxxxx.com/download.php"
>
> download.php file will contain images for downloading.
>
> when he execute this .bat file from his local machine. I need to
> download some image files from the server to his local hard
> drive.i want to download automatically to this hard drive.
>
> (I don't want 'save as' dialog box where user can select the
> location to download.)
>
> In PHP code(server).Is there any way where i can tell the images to
> get download automatically to the local user desktop.
>
> I searched google.but i can't able to find any solution
>
> i am looking for some help from you guys.

If you can find users dumb enough to download and execute a .bat file
from your site, that .bat file can do *anything* *it* *wants*...

You'll have to ask on some kind of .bat list (or perhaps .bat cave)
how to download a file without prompting, but it's got nothing to do
with PHP at that point...

Good luck!

PS *NOBODY* should be downloading your .bat file and running it in the
first place...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


If you are going to sort it by various fields, I'd just throw it into
a database...

That said, http://php.net/usort should be able to do whatever you want.

On Thu, May 10, 2007 2:18 pm, Anna Vester wrote:
> Hello all,
>
> I have a question concerning .CSV array sorting. I have tried googling
> for an answer and have tried different techniques, but nothing seems
> to works as I would like it to work. Here is my situation:
> Test file is located here: http://veanndesign.com/test.php
>
> I would like to be able to sort the output by the Time Zone (or any
> other fields). Here is how my code looks like:
> http://veanndesign.com/test.html
>
> I believe that I need to get all the data from the .csv file dumped
> into 1 array, and I guess I am struggling at that point. I have tried
> using foreach inside of the while loop, but it doesn't seem to work.
> So what is the best and/or right way to sort this type of data?
>
> Hopefully, this email makes sense.
>
> Thanks in advance.
>
> --
> Anna Vester
> Web Designer
> http://www.veanndesign.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 2:55 pm, chrisaquanuke.com wrote:
> Hello,
>
> I have a loop on an sqlite query which checks $domain until the status
> of
> $domain changes and then it deletes $domain.
>
> However when all the $domain items have been deleted I need the script
> to
> stop.. regardless of how many querys the loop
> still has to run. So I want to detect when its empty and then stop.
>
> I have this... which does not work.
>
> <?
> $db = sqlite_open("whois.sqlite");
>
> $x = 0;
> while ($x < 9000) {
>
> $result = sqlite_query($db, "SELECT * FROM whois ORDER BY id");
>
> // if (!$result) {
> if (empty($result)) {
>
> echo "No data";

I dunno for sure what empty() is gonna do with $result, but I suspect
that this message should say "query failed" rather than "no data"

No data returned is not an error, it's just an empty set, which is
very common.

> } else {
>
> while ($row = sqlite_fetch_array($result)) {
>
> $domain = $row['name'];
>
> echo "$domain";

The quotes is kinda silly here...

> $x++;
> usleep(400000);
> }
> }
> }
> sqlite_close($db);
> ?>

You said you were deleting things...?

Where?

What are you actually trying to do?

"delete from whois" springs to mind as a MUCH better way from what you
described, but not what you coded...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 1:51 pm, Armando Acosta wrote:
> Problem is, that, once the page "usr_frm.php" have been hit, the
> session variable $_SESSION["usr_type"] gets changed (unexpectedly) to
> exactly the same value passed to the script via GET variable "typ".
>
> But even worse: this code works perfectly well on my developer machine
> (Windows) but in doesn't on the actual server (Linux).
>
> I realized that the server uses a different PHP configuration,
> specially: "register_globals" set to ON. I already got them to change
> this value to OFF... but this did not solve the problem.

It should have solved it, unless you've messed up your session data
with the previous script already...

Are you SURE they turned it OFF? Check phpinfo again.

If all else fails, just change the variable name to something else in
the usr_frm.php script, so they don't "collide" with session data...

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 2:00 pm, Robert Cummings wrote:
> BTW, what's the point of abbreviating short words like "user" to "usr"
> and "type" to "typ"?

Mayb his 'e' ky is brokn?

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 1:00 pm, James Tu wrote:
> (I've cross posted at the MySQL list as well)
>
> Here's an example with a simple table:
>
> describe collection;
>
> +------------------+---------------------+------+-----
> +---------------------+----------------+
> | Field | Type | Null | Key |
> Default | Extra |
> +------------------+---------------------+------+-----
> +---------------------+----------------+
> | id | bigint(20) unsigned | | PRI |
> NULL | auto_increment |
> | receiver_id | bigint(20) unsigned | | MUL |
> 0 | |
> | set_type_id | int(2) unsigned | | |
> 0 | |
> | card_id | int(3) unsigned | | |
> 0 | |
> | completed_set_id | bigint(20) unsigned | | |
> 0 | |
> | created_on_gmt | datetime | | | 0000-00-00
> 00:00:00 | |
> +------------------+---------------------+------+-----
> +---------------------+----------------+
>
>
> I want to end up with two PHP arrays. One for set_type_id = 22 and
> one for set_type_id=21.
>
> (1) one query method:
> SELECT * from collection WHERE set_type_id=22 OR set_type_id=21;
> ...do query...
> while( $row = $this->db->fetch_array_row() ){

/*
> if ($row['set_type_id'] == 21){
> $array_a[] = $row;
> } else {
> $array_b[] = $row;
> }
*/
$array[$row['set_type_id']][] = $row;

> }

var_dump($array);

You'll have one array of all the 21s, and one of all the 22s.

> Which method is better? Take a hit using MySQL or take a hit using
> PHP?

Honestly, is really doesn't make a damn bit of difference unless you
have ZILLIONS of records in the first place, in which case you
shouldn't be sucking them all down at once anyway...

So write whatever you can figure out what's going on next month/year
without beating your head against the wall trying to read your own
code.

Worry about optimizing only after you identify bottlenecks.

Anything else is optimize-wankery.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


On Thu, May 10, 2007 11:45 am, C.R.Vegelin wrote:
> I hope it's not the wrong place to ask, but has anyone experience with
> scrolling HTML tables ?

Actually, it *is* the wrong place to ask... :-v

> According http://www.w3schools.com/tags/tag_thead.asp
> "The thead, tfoot and tbody elements enable you to group rows in a
> table.
> When you create a table, you might want to have a header row, some
> rows with data, and a row with totals at bottom.
> This division enables browsers to support scrolling of table bodies
> independently of the table header and footer."
>
> I don't want to reinvent the wheel in own software.
> Or is it better to ignore these tags because of bad browser support ?

I've never seen any browser do anything useful with these goofy tags...

But the Designers seem to luv them...

If you really want scrolling, you'd better put them in a DIV or
IFRAME, I think.

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


IIRC, the nuSoap.php did what you want, and PHP's nifty new SOAP class
does everything else better...

So run nuSoap once to get the WSDL thingie, and use PHP 5 SOAP for the
rest.

YMMV

I may be out-dated (again) on my PHP knowledge.

Or should I say "still"?

On Thu, May 10, 2007 10:10 am, Brice wrote:
> Hello all,
>
> I'am looking for an WSDL generator class. The aim is to generate an
> wsdl
> file to use with the soap extension. The generator will look at the
> included
> classes and print all functions (except maybe abstract or private) in
> a
> correct xml format.
>
> I tried this one which is great :
> http://www.schlossnagle.org/~george/blog/index.php?/archives/234-WSDL-Generation.htmlbut
> i have to modify a lot of code and it appears it's not maintained.
>
> So what do you do in order to create WSD?
>
> Is the soap extension or a PEAR classes will include this kind of
> function?
>
> Thanks
> Brice
>

--
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/browse/from/lynch
Yeah, I get a buck. So?

attached mail follows:


Hi,

I am in the process of writing a simple but useful plugin for a blogging
application....

Long story short, I want to give-back to the community (i.e. free
plugin), but would like to make an attempt at retaining some credit if
folks port/use to/in other scripts/blogs/cms apps.

Any tips or links ya'll could share with me?

Anyone have any /* comment blocks */ I could put in my code?

Something like this, for example:

/*
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
** OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
** LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
** FITNESS FOR A PARTICULAR PURPOSE AND
** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
** OR OTHER LIABILITY, WHETHER IN AN ACTION OF
** CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
** OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
** OTHER DEALINGS IN THE SOFTWARE.
*/

Different verbiage, of course...

Or, should I just not worry about this?

Lol! I hope I am phrasing my question right... I have been up all night
coding, so my brain is kinda mushy right about now. :D

Many TIA's!
Cheers,
Micky

--
Wishlists: <http://snipurl.com/1gqpj>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>

attached mail follows:


Micky Hulse wrote:
> Or, should I just not worry about this?

Well shux! I love it when I answer my own questions:

<http://www.phpfreaks.com/tutorials/19/0.php>

I blame it on lack of sleep!

The GNU GPL License sounds like what I need. :D

Cheers,
M

--
Wishlists: <http://snipurl.com/1gqpj>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>

attached mail follows:


    If you want to retain some credit but don't care about
distribution/modification/redistribution, check out the MIT license (more
commonly referred to as the X or X11 license). We're using it in a project
that combines PHP and text-to-speech technology. It allows people to
improve (or degrade) our code, but says that we should still get our names
at the top as the original authors.

On 5/13/07, Micky Hulse <mickyambiguism.com> wrote:
>
> Micky Hulse wrote:
> > Or, should I just not worry about this?
>
> Well shux! I love it when I answer my own questions:
>
> <http://www.phpfreaks.com/tutorials/19/0.php>
>
> I blame it on lack of sleep!
>
> The GNU GPL License sounds like what I need. :D
>
> Cheers,
> M
>
>
>
> --
> Wishlists: <http://snipurl.com/1gqpj>
> Switch: <http://browsehappy.com/>
> BCC?: <http://snipurl.com/w6f8>
> My: <http://del.icio.us/mhulse>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


On 5/13/07, Daniel Brown <parasanegmail.com> wrote:
> If you want to retain some credit but don't care about
> distribution/modification/redistribution, check out the MIT license (more
> commonly referred to as the X or X11 license). We're using it in a project
> that combines PHP and text-to-speech technology. It allows people to
> improve (or degrade) our code, but says that we should still get our names
> at the top as the original authors.

You know more than me daniel :P

All current releases aren't packed with any license, and in
sourceforge the PHP license is selected i believe :P

I'd say, don't worry too much about the license, just put your name on
top of the code, and some other nonsense, like:
You're allowed to use this code, as long as you leave above lines
intact., where above your credit is listed of course.

Tijnema
>
>
> On 5/13/07, Micky Hulse <mickyambiguism.com> wrote:
> >
> > Micky Hulse wrote:
> > > Or, should I just not worry about this?
> >
> > Well shux! I love it when I answer my own questions:
> >
> > <http://www.phpfreaks.com/tutorials/19/0.php>
> >
> > I blame it on lack of sleep!
> >
> > The GNU GPL License sounds like what I need. :D
> >
> > Cheers,
> > M
> >
> >
> >
> > --
> > Wishlists: <http://snipurl.com/1gqpj>
> > Switch: <http://browsehappy.com/>
> > BCC?: <http://snipurl.com/w6f8>
> > My: <http://del.icio.us/mhulse>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>

attached mail follows:


Daniel Brown wrote:
> If you want to retain some credit but don't care about
> distribution/modification/redistribution, check out the MIT license (more
> commonly referred to as the X or X11 license). We're using it in a project

Ah, great tip! :D

I will definitely read-up on the MIT license after I get some zzZZzz's!

It sure does sounds like what I am looking for. ;)

> that combines PHP and text-to-speech technology. It allows people to
> improve (or degrade) our code, but says that we should still get our names
> at the top as the original authors.

Oh, wow! That sounds like a great project... and it is cool to hear what
you/your team decided to use for licensing. :)

Many thanks Daniel! I really appreciate the help and advice.

Have a great day,
Cheers,
Micky

--
Wishlists: <http://snipurl.com/1gqpj>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>

attached mail follows:


Hey! Tijnema! Thanks for the quick reply. :)

Tijnema ! wrote:
> I'd say, don't worry too much about the license, just put your name on
> top of the code, and some other nonsense, like:
> You're allowed to use this code, as long as you leave above lines
> intact., where above your credit is listed of course.

Ah, well, that does sound good too. I a mainly looking to keep my
name/website somewhere in the comments. :D

Whichever route I end-up taking, it is definitely nice to hear what the
pros prefer. ;)

Thanks again Tijnema!

Have a great day.
Cheers,
Micky

--
Wishlists: <http://snipurl.com/1gqpj>
    Switch: <http://browsehappy.com/>
      BCC?: <http://snipurl.com/w6f8>
        My: <http://del.icio.us/mhulse>

attached mail follows:


On Sunday 13 May 2007 21:17, Micky Hulse wrote:

> I will definitely read-up on the MIT license after I get some zzZZzz's!

Don't forget the MIT license allows people to incorporate your code into
commercial products and sell for profit without having to give anything
back (money/improved code/etc).

--
Crayon

attached mail follows:


    Right, I alluded to that, but perhaps I should've said that exactly, as
it may bother some people. In my case, it doesn't bother me in the least,
just as I use LAMP (all open source) to make a living.

On 5/13/07, Crayon Shin Chan <crayon.shin.chan.ukgmail.com> wrote:
>
> On Sunday 13 May 2007 21:17, Micky Hulse wrote:
>
> > I will definitely read-up on the MIT license after I get some zzZZzz's!
>
> Don't forget the MIT license allows people to incorporate your code into
> commercial products and sell for profit without having to give anything
> back (money/improved code/etc).
>
> --
> Crayon
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

attached mail follows:


I've got a cgi file in my cgi-bin folder that I'm calling with include(). It worked with php4.

My shared host just upgraded to my server to php5.2.0 and the function doesn't work. I can't tell if the problem is a
php5 or server configuration [which may have changed during the upgrade] issue.

If I call the file as a URL directly, it works.
http://www.foo.org/cgi-bin/file.cgi?dir=/test&perms=0755

file.cgi chmods the designated directory's permissions. It's a cgi with a php shebang #!/usr/bin/php

A simple file_exists() shows the file exists OK, TRUE.

I've tried using both syntaxes.

include("/home/foo/public_html/cgi-bin/file.cgi?dir=test&perms=0755");

include("www.foo.org/cgi-bin/file.cgi?dir=test&perms=0755");

Here is the error msg:
> Warning: include(/home/foo/public_html/cgi-bin/file.cgi?dir=/test&perms=0755)
[function.include]: failed to open stream: No such file or directory in /home/foo/public_html/EditPage/cgi_file_test.php
on line 15

Bottom line: It appears include() is not working right, for whatever reason.

Anyone have any ideas?

Thanks, Al........