Re: [PHP] libcurl (cookies across cURL session). . .?

2006-09-22 Thread Michael Williams

Robert,

Thanks.  The thing is that lots of cookies are set regularly.  Are  
you suggesting that every time I receive a "Set-Cookie:" to  1)parse  
that line out 2)append it to a file 3) retrieve it when necessary?   
I'm not terribly familiar with the proper format for a cookie, but  
I'll look into it.  I'd appreciate *any* insights you have.


Regards,
Mike

On Sep 23, 2006, at 2:28 AM, Robert Cummings wrote:


On Sat, 2006-09-23 at 02:10 -0400, Michael Williams wrote:

Hi all,

Is there any way at all by which to persist cookies across cURL
sessions?  Basically I have a login page that sets cookies and looks
for them for "logged in" status so that the user may use the site to
their heart's content.  The problem with cURL, however, appears that
after the initial login, any further attempts are foiled by the fact
that the cookies don't remain.  How exactly should I go about doing
this?


You should be able to retrieve the cookies from the response headers.
Then you just need to resend them. There may be an option for cURL  
to do

this automatically. Search for cookie at the following link (check the
user comments also):

http://ca.php.net/manual/en/ref.curl.php

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.  |
`'





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



Re: [PHP] libcurl (cookies across cURL session). . .?

2006-09-22 Thread Robert Cummings
On Sat, 2006-09-23 at 02:10 -0400, Michael Williams wrote:
> Hi all,
> 
> Is there any way at all by which to persist cookies across cURL  
> sessions?  Basically I have a login page that sets cookies and looks  
> for them for "logged in" status so that the user may use the site to  
> their heart's content.  The problem with cURL, however, appears that  
> after the initial login, any further attempts are foiled by the fact  
> that the cookies don't remain.  How exactly should I go about doing  
> this?

You should be able to retrieve the cookies from the response headers.
Then you just need to resend them. There may be an option for cURL to do
this automatically. Search for cookie at the following link (check the
user comments also):

http://ca.php.net/manual/en/ref.curl.php

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.  |
`'

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



[PHP] libcurl (cookies across cURL session). . .?

2006-09-22 Thread Michael Williams

Hi all,

Is there any way at all by which to persist cookies across cURL  
sessions?  Basically I have a login page that sets cookies and looks  
for them for "logged in" status so that the user may use the site to  
their heart's content.  The problem with cURL, however, appears that  
after the initial login, any further attempts are foiled by the fact  
that the cookies don't remain.  How exactly should I go about doing  
this?


Thanks,
Mike

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



Re: [PHP] Yahoo! HackDay

2006-09-22 Thread Micky Hulse

Rasmus Lerdorf wrote:

More info on it at the following links:
http://yuiblog.com/blog/2006/09/22/yahoo-devday-schedule/
http://nate.koechley.com/blog/2006/09/22/hookytime-yahoo-developer-day-hack-day-on-sept-29th-and-30th/ 
http://del.icio.us/chadd/yhackday


This too:


Shit, sounds fun. Wish I could go! :(



--
 Wishlist: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] File Upload Security and chmod

2006-09-22 Thread Andy Hultgren

For whatever reason when I ftp in using WinFtp I don't see public_html
(it's hidden, don't know why; if I make a directory called
".public_html" it gets created and then disappears), but I can see my
file structure from my host's website and so I know that when I ftp in
to myDomain.com this is what is "there":

index.htm
page1.htm
page2.htm
.public_html/
images/
etc. etc.

Currently nothing is stored in my .public_html directory since it is
not my root (and my website loads just fine when browsed to).

I don't ftp in from DreamWeaver and it isn't an issue of going
straight to public_html just to skip the cd step.  public_html just
isn't set up as my root directory and I have no directories accessable
that are higher than my root.

So, since I have no access to directories outside of my root, do you
really think I should change that before allowing file uploads?
(either by changing servers or just bugging my server adminstrator
until he changes it).  I currently check extension type and then image
type using get_image_size(); and also files with image extensions are
not executable on the server.  However, from what I've read I
understand that those steps are the minimum in terms of file upload
security.

Also, I'd be curious still to hear why I can browse to a file in a
directory that has been set with chmod 0100.  I really didn't expect
that.

Thanks again very much for your thoughts,

Andy


On 9/22/06, Richard Lynch <[EMAIL PROTECTED]> wrote:



I may have hit "send" too soon...

Like, when you do FTP, do you see:

index.htm
page2.htm
page3.htm

right away?

*OR*, do you see:
public_html

And then you do "cd public_html" and THEN you see the files?

If you don't do "cd public_html" then I really don't think accepting
file uploads is a Good Idea, unless you have access to /tmp or
something to put the files in...

If you do "cd public_html" then you actually HAVE space outside your
webtree.  Just do "mkdir uploads" and "chmod 777 uploads" *BEFORE* you
do "cd public_html" and you'll have an uploads dir outside the webtree
where you can put stuff.

NOTE:
Some fancy FTP tools like DreamWeaver and whatnot will convince you to
put "public_html" into some input box somewhere, to give you the
convenience of not needing to "cd public_html" -- which then means you
never *SEE* that you have space outside your webtree...  Stop doing
that.  An extra click or whatever to get into public_html is not that
big of a deal.

On Fri, September 22, 2006 7:21 pm, Andy Hultgren wrote:
> So pretty much there's nothing to be done about it?  If I can get the
> chmod thing to make it so that you can't surf to your uploaded image
> afterwards and view it, I'd be happy with that solution.  I'd like to
> stick with this host if I could.
>
> On 9/22/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Fri, September 22, 2006 3:58 pm, Andy Hultgren wrote:
>> > that as my root directory is simply www.myDomain.com and not
>> > ".public_html/" and I am on a shared server where my root cannot
>> be
>>
>> I got two words for you:
>>
>> Change Hosts
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Like Music?
http://l-i-e.com/artists.htm





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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 7:40 pm, Rory Browne wrote:
> The script must be web based, and ask the user to enter a number. The
> script
> must then calculate the lowest Prime Number above that number.

I would like to have one point clarified:

By "above that number" do you literally mean > or would >= be deemed
the correct interpretation?

E.g. for an input of '2' do you expect '2' or '3' as the answer?

Or is our ability to correctly interpret this as > part of the
exercise?...

Ooops.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Object Memory Leakage...

2006-09-22 Thread Jon Anderson

Richard Lynch wrote:

If you get no satisfaction on  PHP-General, PHP-Internals may be able
to help...
  
Might have to give that a shot...Subscribing to one more mailing list 
can't hurt I guess. :-)


Thanks for the suggestion.

You really need to specify PHP version and platform and all that,
though, as what you are seeing may not be universal.
Linux 2.6.14.(something), PHP 5.1.6 (dotdeb), Apache 2.0.54, Debian 
Sarge i386. All that running on dual Opterons with a couple gigs of ECC 
with a couple hundred gigs of mirrored hardware SCSI raid. The kernel is 
x86-64, but most of userland is 32-bit.


Cheers,

jon

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



[PHP] how to get server response with ftp extension?

2006-09-22 Thread Robin Kunde
is there a reason why php's built-in ftp extension does not have a 
function that returns the last message the ftp server sent? for example, 
it would be nice to know whether i can't create a directory because it 
already exists or because i don't have permission. am i missing 
something obvious here?



regards,

RK

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



Re: Re: [PHP] PHP5 object construct

2006-09-22 Thread Chris Boget

PHP has __set and __get in some versions...
I think that's what you are looking for.


Yes, but exactly.  They'll do if there is no other way (as below)...


If you told us which particular feature in that pile of code you're
asking about, it would help...


the ability to set an accessor like such:

  public $Bob {
set( $var ) {
  $this->bob = $var;

}
get() {
  return $this->bob;

}
  }

thnx,
Chris

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



Re: [PHP] PHP5 object construct

2006-09-22 Thread Chris Boget

ok, so if we were talking Java, perhaps you are looking for
information that allows you to build 'accessor' and 'mutator' methods?


Yes, exactly.  I was flipping through a PHP5 book (possibly a magazine, but 
it was definitely about PHP5 and not Java) and I saw this new language 
construct.  Since I've done a bit of dabbling in C#, have used it there and 
found it useful, I thought it was really cool that PHP5 had implemented it.


thnx,
Chris 


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



Re: Re: [PHP] PHP5 object construct

2006-09-22 Thread Richard Lynch


PHP has __set and __get in some versions...

I think that's what you are looking for.

If you told us which particular feature in that pile of code you're
asking about, it would help...

I still wouldn't know the answer, as I don't do OOP in PHP much, but
somebody might.

On Fri, September 22, 2006 7:32 pm, Chris Boget wrote:
>> well, perhaps I'm not seeing what it is that you're looking for.
>
> No, I'm not sure you are.  Take a look at my sample code again.  Pay
> particular attention to how both $bob and $Bob are defined.
>
> class MyClass {
>
>   private $bob;
>
>   public $Bob {
> set( $var ) {
>   $this->bob = $var;
>
> }
> get() {
>   return $this->bob;
>
> }
>   }
> }
>
> thnx,
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] File Upload Security and chmod

2006-09-22 Thread Richard Lynch


I may have hit "send" too soon...

Like, when you do FTP, do you see:

index.htm
page2.htm
page3.htm

right away?

*OR*, do you see:
public_html

And then you do "cd public_html" and THEN you see the files?

If you don't do "cd public_html" then I really don't think accepting
file uploads is a Good Idea, unless you have access to /tmp or
something to put the files in...

If you do "cd public_html" then you actually HAVE space outside your
webtree.  Just do "mkdir uploads" and "chmod 777 uploads" *BEFORE* you
do "cd public_html" and you'll have an uploads dir outside the webtree
where you can put stuff.

NOTE:
Some fancy FTP tools like DreamWeaver and whatnot will convince you to
put "public_html" into some input box somewhere, to give you the
convenience of not needing to "cd public_html" -- which then means you
never *SEE* that you have space outside your webtree...  Stop doing
that.  An extra click or whatever to get into public_html is not that
big of a deal.

On Fri, September 22, 2006 7:21 pm, Andy Hultgren wrote:
> So pretty much there's nothing to be done about it?  If I can get the
> chmod thing to make it so that you can't surf to your uploaded image
> afterwards and view it, I'd be happy with that solution.  I'd like to
> stick with this host if I could.
>
> On 9/22/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Fri, September 22, 2006 3:58 pm, Andy Hultgren wrote:
>> > that as my root directory is simply www.myDomain.com and not
>> > ".public_html/" and I am on a shared server where my root cannot
>> be
>>
>> I got two words for you:
>>
>> Change Hosts
>>
>> --
>> Like Music?
>> http://l-i-e.com/artists.htm
>>
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: Re: Re: [PHP] PHP5 object construct

2006-09-22 Thread Joe Wollard

ok, so if we were talking Java, perhaps you are looking for
information that allows you to build 'accessor' and 'mutator' methods?
If so, then your example should work (syntax aside). Here's another
'test' example that I just whipped up and tested that shows you can
use any method name you wish.

thing = $val;
 }


 function getThing() {
   return $this->thing;
 }

}

$t = new test;

// Show that thing is empty
print $t->getThing() . "\n";

// Set thing to 'Thing'
$t->setThing('Thing');

// show that thing contains 'Thing'
print $t->getThing() . "\n";
?>


If I'm still on the wrong path I apologize. I probably shouldn't be
trying to provide advice on cold medicine ;-)



On 9/22/06, Chris Boget <[EMAIL PROTECTED]> wrote:

> well, perhaps I'm not seeing what it is that you're looking for.

No, I'm not sure you are.  Take a look at my sample code again.  Pay
particular attention to how both $bob and $Bob are defined.

class MyClass {

  private $bob;

  public $Bob {
set( $var ) {
  $this->bob = $var;

}
get() {
  return $this->bob;

}
  }
}

thnx,
Chris





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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Rory Browne

That aside, I think that it would be very beneficial to the community as a
whole if a contest was started that encouraged readability and good
practices.

The scoring and judging could be done by a panel, but I think that it
would be more fun if the community itself was able to vote on various
attributes; readability, efficiency, general approach, originality, etc.
Allow people to comment on each entry. I don't know about the winner
getting anything besides bragging rights, but it if gets large enough
maybe there can be a few corporate sponsors giving away licenses or
something. Who knows?



Fair enough.
Prime Number Script Competition ( for Bragging Rights ).

I challenge the readers of this list to produce the necessary code to find
the lowest prime number higher than a certain inputted number.

The script must be web based, and ask the user to enter a number. The script
must then calculate the lowest Prime Number above that number.

Scripts will be rated on Functional Accuracy ( the program must correctly
perform its required function ), Code Maintainability(eg Presence of
Comments, etc ), Ease of Use, and Code Efficiency, in that order. Brownie
points may be earned through use interesting or original ideas or
methodologies, provided they do not compromise the previous four criteria.

The submitted script will be rated by volunteers from this list. Submitting
an entry disqualifys you as a volunteer judge, whilst judging someone elses
code disqualifys you as a candidate. Deadline for submissions is 12:00
(Noon) (CEST UTC + 2 Hours) on Friday 29 September.

Interesting to see (a) if anyone enters, and (b) what the code will be like.




I think it would be a lot of fun if well executed.





Re: [PHP] Reverse of date("w")

2006-09-22 Thread Richard Lynch
On Mon, September 18, 2006 5:09 pm, Kevin Murphy wrote:
> I'm looking for something that will convert a the opposite of the date
> ("w") function. In other words, if I have the number "3", I would
> like it to return "Wednesday". Is there such a beast out there
> besides writing a switch or array or something?

I always just put:
$daynames = array_flip(array('Sunday', 'Monday', 'Tuesday',
'Wednesday', 'Thursday', 'Friday', 'Saturday'));
in my globals include file or whatever and use that...
[shrug]

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] symlink

2006-09-22 Thread Richard Lynch
On Mon, September 18, 2006 4:53 pm, Ross wrote:
> Can someone explain how and why you would use a symlink in php?

A symlink is the Un*x version of a Windows "shortcut" or the Mac's
"alias"

The difference being that a symlink actually *works* and a Windows
"shortcut" is useless for anything except their crappy desktop app...

As far as usefulness goes, it's pretty wide-open, and not at all tied
into PHP, per se, in a general sense...

I mean, any time you've got some long complicated
/path/to/somewhere/deep/in/your/system and you want to get there with
out typing all that you can do:
ln -s /path/to/somewhere/deep/in/your/system short
Now you can just use 'short' instead of all that other stuff.
[Assuming you start in the same dir where 'short' lives.]

There is *ONE* thing I've been doing that's very PHP specific that I
think is useful for a symlink...


cd public_html
ln -s . edit


Now, in the PHP code, I do like this:


   


What's the point, you ask?

Well, *NOW* instead of having an ugly non-intuitive layout for the CMS
for the site owner, they see the SAME layout, with everyting in the
SAME place, except they have INPUT boxes instead of just text.

This makes it MUCH more intuitive for them to edit their site, as they
just surf to /edit/ and then navigate to what they want to edit, the
same as it is on their site.

The whole thing looks exactly the same, except that they have bits
they can edit, that everybody else just sees as text.

I don't have duplicate code for layout for the site and the edit site,
so I've got very high code re-use, and don't have to make parallel
changes.

Combine this with some nice CSS and a clean layout, and it gets very
very nice.

It drastically cuts down (like, to zero) the confusion over how to
change what in the site -- and they never have to contact me to ask
how to change this or that, or what this little bit here over in
"admin" actually does.  They *see* what it does, because they see it
just like it is in their public site.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: Re: [PHP] PHP5 object construct

2006-09-22 Thread Chris Boget

well, perhaps I'm not seeing what it is that you're looking for.


No, I'm not sure you are.  Take a look at my sample code again.  Pay 
particular attention to how both $bob and $Bob are defined.


class MyClass {

 private $bob;

 public $Bob {
   set( $var ) {
 $this->bob = $var;

   }
   get() {
 return $this->bob;

   }
 }
}

thnx,
Chris 


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



Re: [PHP] PHP5 object construct

2006-09-22 Thread Chris Boget

Any particular place on that page I should be looking?  I've read it
several
times and didn't see anything like the above.  The closest thing I saw
were
actual methods called setBob() and getBob(), which isn't exactly what I'm
looking for...

Check here:
http://us2.php.net/manual/en/language.oop5.magic.php


So the only way I can do anything like this is by implementing the __get() 
and __set() methods?  There is no attribute/property construct that is 
similar to the sample code in my OP?


thnx,
Chris 


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



Re: [PHP] PHP5 object construct

2006-09-22 Thread Martin Marques

On Fri, 22 Sep 2006 20:15:49 -0400, "Chris Boget" <[EMAIL PROTECTED]> wrote:
>> http://us2.php.net/class
> 
> Any particular place on that page I should be looking?  I've read it
> several
> times and didn't see anything like the above.  The closest thing I saw
> were
> actual methods called setBob() and getBob(), which isn't exactly what I'm
> looking for...

Check here:

http://us2.php.net/manual/en/language.oop5.magic.php

--
-
Lic. Martín Marqués |   SELECT 'mmarques' || 
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador, 
del Litoral |   Administrador
-

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



Re: Re: [PHP] PHP5 object construct

2006-09-22 Thread Joe Wollard

well, perhaps I'm not seeing what it is that you're looking for. The
page I sent you is a basic introduction to classes and OOP in PHP,
which based on the example that you've provided seemed like what you
wanted. It seems obvious that you want to learn more about OOP, but
are you trying to find a specific 'bob' example or would you just like
some help understanding OOP? What is the end result you're hoping to
get out of the list?.Google also provided these results, which
might help you if a specific example is what you're looking for:
http://pear.php.net/reference/PhpDocumentor-1.2.0beta2/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html
http://us3.php.net/get_object_vars
http://us3.php.net/spl

Feel free to help us help you ;-)


On 9/22/06, Chris Boget <[EMAIL PROTECTED]> wrote:

>> I read about a feature of PHP5 OOP that is something like this in a book
>> or
>> a magazine a while back.  But now I don't remember exactly how this works
>> and I can't find any reference to it in the online docs.  The basic idea
>> is
>> something along these lines:
>>
>> class MyClass {
>>
>>   private $bob;
>>   public $Bob {
>> set( $var ) {
>>   $this->bob = $var;
>>
>> }
>> get() {
>>   return $this->bob;
>>
>> }
>>   }
>> }
>>
>> Could someone point me to the relevant section of the docs that discusses
>> this?

> http://us2.php.net/class

Any particular place on that page I should be looking?  I've read it several
times and didn't see anything like the above.  The closest thing I saw were
actual methods called setBob() and getBob(), which isn't exactly what I'm
looking for...

thnx,
Chris





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



Re: [PHP] SSL Connection causes data errors.

2006-09-22 Thread Richard Lynch
On Mon, September 18, 2006 5:33 pm, Stefan wrote:
> I was wondering if anyone has experienced this before.
> I am connecting to an IIS server over HTTPS using
> pfsockopen and am getting xml data returned. Now when
> I open the URL in a browser the XML is returned fine
> without a problem. However when using PHP part of the
> XML is all messed up, data is moved around it appears
> and it messes up the XML.
>
> I am getting an error at the end of my request to the
> server:
>
> PHP Warning:  fread(): SSL: fatal protocol error in
> 
>
> However from what I read that error deals with the
> closing of the connection. Any help would be very
> appreciated.

I seem to recall some kinda note in php.net about IIS brokenness in
connection closing of HTTPS...

Maybe in "curl"?

And, actually, you may want to just try using PHP curl to get it,
instead of micro-managing the reading with pfsockopen...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] PDF.

2006-09-22 Thread Richard Lynch
On Tue, September 19, 2006 8:21 am, João Cândido de Souza Neto wrote:
> I´m using the fpdf class to create pdf files report and it works fine.
>
> Now i need to get a standard pdf and put some data into for complete
> data.
> There´s some way to get an existent pdf file and put data into?

I think you need the PDI functions for that, at least in PDFlib, and
that costs money, I believe...

There may be other solutions.

Generating the whole PDF is one.

FDF, where you layer a FORM over a PDF is another solution for some
needs.
Here is an article I wrote about FDF way long time ago:
http://phpbootcamp.com/articles/fdf.htm

Hm... Actually, that looks more like the rough draft of the article.

Oh well.

It was in php|architect at some point...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] File Upload Security and chmod

2006-09-22 Thread Andy Hultgren

So pretty much there's nothing to be done about it?  If I can get the
chmod thing to make it so that you can't surf to your uploaded image
afterwards and view it, I'd be happy with that solution.  I'd like to
stick with this host if I could.

On 9/22/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Fri, September 22, 2006 3:58 pm, Andy Hultgren wrote:
> that as my root directory is simply www.myDomain.com and not
> ".public_html/" and I am on a shared server where my root cannot be

I got two words for you:

Change Hosts

--
Like Music?
http://l-i-e.com/artists.htm





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



Re: [PHP] PHP5 object construct

2006-09-22 Thread Chris Boget
I read about a feature of PHP5 OOP that is something like this in a book 
or

a magazine a while back.  But now I don't remember exactly how this works
and I can't find any reference to it in the online docs.  The basic idea 
is

something along these lines:

class MyClass {

  private $bob;
  public $Bob {
set( $var ) {
  $this->bob = $var;

}
get() {
  return $this->bob;

}
  }
}

Could someone point me to the relevant section of the docs that discusses
this?



http://us2.php.net/class


Any particular place on that page I should be looking?  I've read it several 
times and didn't see anything like the above.  The closest thing I saw were 
actual methods called setBob() and getBob(), which isn't exactly what I'm 
looking for...


thnx,
Chris 


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



[PHP] Yahoo! HackDay

2006-09-22 Thread Rasmus Lerdorf
For any of you folks in the Bay Area, don't miss the open Hack Day at 
Yahoo next Friday/Saturday.  It is completely free and the density of 
web experts will be higher than at most conferences.


More info on it at the following links:

http://yuiblog.com/blog/2006/09/22/yahoo-devday-schedule/
http://nate.koechley.com/blog/2006/09/22/hookytime-yahoo-developer-day-hack-day-on-sept-29th-and-30th/
http://del.icio.us/chadd/yhackday

-Rasmus

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



Re: [PHP] PHP5 object construct

2006-09-22 Thread Joe Wollard

http://us2.php.net/class



On 9/22/06, Chris Boget <[EMAIL PROTECTED]> wrote:

I read about a feature of PHP5 OOP that is something like this in a book or
a magazine a while back.  But now I don't remember exactly how this works
and I can't find any reference to it in the online docs.  The basic idea is
something along these lines:

class MyClass {

  private $bob;
  public $Bob {
set( $var ) {
  $this->bob = $var;

}
get() {
  return $this->bob;

}
  }
}

Could someone point me to the relevant section of the docs that discusses
this?

thnx,
Chris

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




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



[PHP] PHP5 object construct

2006-09-22 Thread Chris Boget
I read about a feature of PHP5 OOP that is something like this in a book or 
a magazine a while back.  But now I don't remember exactly how this works 
and I can't find any reference to it in the online docs.  The basic idea is 
something along these lines:


class MyClass {

 private $bob;
 public $Bob {
   set( $var ) {
 $this->bob = $var;

   }
   get() {
 return $this->bob;

   }
 }
}

Could someone point me to the relevant section of the docs that discusses 
this?


thnx,
Chris 


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



Re: [PHP] Override php.ini

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 11:42 am, Beauford wrote:
> Is there a way I can use <% %> instead of  for the opening and
> closing
> tags of a php script. I thought I read this somewhere but can't find
> anything on it now.
>
> Is there something that I could do with override php.ini command? I
> don't
> have access to the php.ini file on this server.

You can do this in .htaccess under Apache, or with ini_set (which
would have to be in 

But you SHOULD NOT DO THIS

Nobody else on the planet is using <% for PHP, and it's unlikely to be
all that useful to you.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] File Upload Security and chmod

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 3:58 pm, Andy Hultgren wrote:
> that as my root directory is simply www.myDomain.com and not
> ".public_html/" and I am on a shared server where my root cannot be

I got two words for you:

Change Hosts

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] stripping with an OB callback [SOLVED]

2006-09-22 Thread Christopher Watson

Thanks for the follow-up Richard.  I am now bracketing my Fusebox core
includes with ob_start("ob_gzhandler") and ob_end_flush().  It's done
wonders for those large query results.  And since there is absolutely
nothing in this app that relies on multiple contiguous whitespace
characters, I'm good to go.

Christopher Watson

On 9/22/06, Richard Lynch <[EMAIL PROTECTED]> wrote:

Cannot compression be set in .htaccess?

Or even within the script???

I suspect you could even find a PHP class out there to compress and
send the right headers to do it all in PHP, regardless of server
settings...


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



Re: [PHP] move_uploaded_file locks?

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 1:36 pm, Matthew H. North wrote:
> Can't find this in the PHP docs, so: does anyone know whether
> move_uploaded_file locks the target file during the process?
>
> If move_uploaded_file does a rename within the same filesystem this
> isn't an
> issue (on unix, anyway, the O/S just reassigns inodes rather than
> copying
> data).  But if it does a copy instead, or if it has to rename across
> filesystems, any process that tries to read or write the file before
> move_uploaded_file completes could be munging things.

http://lxr.php.net/ may have the answer even faster than asking
PHP-Internals... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] storing function names in db and running them as row is output?

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 3:19 pm, blackwater dev wrote:
> First, the example I have is not the real situation, just an example
> so I
> don't want to get into why are you doing it like that, etc.  Just want
> to
> see if it's possible.
>
> Basically, I want to store stuff in a text field in a db like this
> "johns
> name is ucfirst('john adams') ".
>
> When I cycle through that row for output in my php script, I want it
> to not
> see ucfirst as text but as the php function and run ithow is the
> possible?

http://php.net/eval

But if eval is the answer, you are probably doing something entirely
the wrong way.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] php/css and .htaccess [SOLVED]

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 12:17 pm, tedd wrote:

> To the gang -- is this something new, or am I getting excited over
> nothing?

I been doing it long time now...

You mean everybody doesn't run their CSS through PHP so they can make
it do what they want for each page?

How odd... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] php/css and .htaccess [SOLVED]

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 10:37 am, David Giragosian wrote:
> So with this approach you're able to tailor css styles for specific
> browsers
> and their particular implementations of css, rather than employ hacks
> directly in the css??

That's one possible use.

Really, though, once your CSS is dynamic as well as your HTML, life
can be quite fun. :-)

Or, perhaps, if your so-called web Designer left NO CONSISTENT SPACE
on the layout for ERROR MESSAGES in a dynamic site, you might, just as
a hypothetical example, have something like:



Then, in the .css file, you'd be using $error_position to cram the
messages into an overflow: auto; at the $error_position, unique to
each page, where the so-called designer left you any white space at
all.

Not that this ever happened to me, oh no.

http://ralphsworld.com/

:-)

PS I embedded the CSS, actually, as I don't trust browser caching to
"know" that the CSS is also dynamic and changing.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] php/css and .htaccess

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 5:18 pm, tedd wrote:
> Hi gang:
>
> I embedded php code inside css and changed my .htaccess to read --
>
> 
>   SetHandler application/x-httpd-php
> 
>
> -- so that the css file would be processed and executed by php. The
> end result was that everything worked and did what I wanted.
>
> However, FireFox / Mozillia won't accept a css file if a .htaccess
> file reads as indicated above.
>
> Any ideas as to how to get FireFox to play nice?

Add a header("Content-type: text/css") to the top of it, so that the
web-server isn't LYING to Mozilla and telling it that you're sending
it an HTML file?

Only IE would be STOOPID and look at the URL and the file contents and
decide to ignore the headers.

text/css may not be right.  Whatever.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] stripping with an OB callback

2006-09-22 Thread Richard Lynch
Cannot compression be set in .htaccess?

Or even within the script???

I suspect you could even find a PHP class out there to compress and
send the right headers to do it all in PHP, regardless of server
settings...

On Wed, September 20, 2006 7:33 pm, Christopher Watson wrote:
> Hi Robert,
>
> Well, I think the main reason I'm not using transparent output
> compression is because this app shares php.ini with several other PHP
> apps on the server, and I don't want to foist this change on the
> admins of those apps.  I was trying to come up with a localized
> strategy for trimming my app's output.
>
> The  issue is not an issue for me.
>
> -Christopher
>
> On 9/20/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
>> Should be an issue as long as you're not stripping whitespace from
>> between  tags. Although, one must wonder why you don't
>> just
>> use output compression since all that whitespace would just compress
>> anyways as would all the other content. In fact 900k with fairly
>> standard content would shrink to about 90k.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] stripping with an OB callback

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 7:13 pm, Christopher Watson wrote:
> I've been coding with PHP for maybe a year.  So I'm somewhat new to
> it.  But I've learned quickly, and created a fairly serious LAMP app
> that is capable of returning large query results.  During my
> investigation into various means for incrementally reducing the
> response sizes, I've discovered output buffering with a callback
> function.  So, as an experiment, I bracketed my includes of the
> Fusebox files in index.php with ob_start('sweeper') and
> ob_end_flush(), and placed the simple callback function at the top of
> the file that performs a preg_replace on the buffer to strip all
> excess space:
>
> function sweeper($buffer) {
> return preg_replace("/\s\s+/", " ", $buffer);
> }

Here's where you MIGHT get bit in the butt:
  1. Anything in a PRE tag is gonna suck big-time
  2. Any kind of DATA from your db with multiple spaces will lose data

Now, you might maybe be able to fix these by religiously always doing
$output = str_replace(' ', ' ', $output);
on the DATA from the DB, or any kind of PRE tags stuff you use.

Or maybe in YOUR application, neither of these matters.

Test it with JUST the output buffer and without the whitespace crunch
-- You may find that the ob is the big win, especially if you have a
zillion echo statements going on.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] How to write PHP extension in FPC

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 4:25 am, Bronislav Klucka wrote:
> Sorry for previous question, was not that clear at all
>
> Does anybody know how to write PHP extension in FreePascal?

Port the FreePascal to C first? :-)

I dunno... I mean, maybe there's some fancy FreePascal->C bridge
thingie to make it all work...

Can you include a bunch of C header files and make them work?

Cuz there's a TON of stuff in PHP C header files of macros and whatnot
that make it easy to write an extension.

Working without those or rolling those all over again in FreePascal
would be a nightmare, I suspect...

I just gave a talk at the Chicago PHP User Group "Extension Writing
for Dummies" based on my experience with: http://l-i-e.com/perror

I really think you'll have an eaiser time porting the FreePascal to C
than trying to marry C and FreePascal, but I'm no expert.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: Most stable combination of AMP?

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 1:04 pm, James Tu wrote:
> I was thinking more along the lines of what version of Apache, MySQL
> and PHP I should install...

If you are comfy installing from source, visit each site and download
the version marked "latest stable release"

MAYBE for Apache stick with 1.x as there's not much point to 2.x with
PHP as you're stuck with pre-fork mode which means you might as well
just use 1.x as I understand it, or probably mis-understand it...

If you are not comfy with source, then whatever the distro is touting
as "stable" is probably the most stable for their distro...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] preg_replace (again)

2006-09-22 Thread Richard Lynch
On Wed, September 20, 2006 11:20 am, Pawel Miroslawski wrote:
> Hi
> it's example script:
>
>  $string = "This is some _color:pink_ colored text _color_";
>
> $patterns[0] = '/_color:(.*?)_/';
> $patterns[1] = '/_color_/';
> $replacements[0] = '';
> $replacements[1] = '';
>
> echo preg_replace($patterns, $replacements, $string);
> ?>
>
> It should be ok, but i don't test it.

For the sanitization...

.*? could be something more like:  [#a-z0-9A-Z]+

The # assumes you want to allow #ff style colors.

Since this whitelists the specific characters you allow, it's probably
better than the strip_tags thing.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] chown(), chgrp()

2006-09-22 Thread Richard Lynch


775 needs to be 0775 for starters, as I recall...

On Tue, September 19, 2006 11:07 am, Rahul S. Johari wrote:
>
> Here's the interesting things. I did exactly that to begin with... And
> I
> never got the "file can't be chmoded!" ... Instead, I actually got the
> "Mode
> changed to" notification that I had set in the "else {" case.
> However... The mode of the file never changed! Even though !chmod
> didn't say
> that mode cannot be changed It wasn't really changing the mode.
> Which is
> why I thought it doesn't work this way.
>
>
> On 9/19/06 11:58 AM, "Jay Paulson" <[EMAIL PROTECTED]> wrote:
>
>> If (!chmod("/somedir/somefile", 775)) {
>> echo "file can't be chmoded!";
>> }
>
> Rahul S. Johari
> Supervisor, Internet & Administration
> Informed Marketing Services Inc.
> 500 Federal Street, Suite 201
> Troy NY 12180
>
> Tel: (518) 687-6700 x154
> Fax: (518) 687-6799
> Email: [EMAIL PROTECTED]
> http://www.informed-sources.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] FTP Copy

2006-09-22 Thread Richard Lynch
On Tue, September 19, 2006 8:14 pm, Chris wrote:
... FTP copy ...

Depending on the security issues, and SCP from exec() may be more
suitable...

Another option would be to upload a PHP script to one or the other
that does the FTP you want one way or the other... :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: +AFs-OT+AF0- Working with version control

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 7:08 pm, Colin Guthrie wrote:

I've used CVS a fair amount, no branching, as everybody always said
what a bear it was to merge.

I keep hearing subversion is easier to branch/merge.

Tomorrow, I've been tasked by the boss to find out HOW easy and how to
do it for a big change that needs doing.

But I'd also like to hack away on the "little changes" in, err, the
trunk, I guess...

So can I keep those both around?
And would the branch live in a subdirectory or what?

I've read the docs and all, but it's all too nuts-and-bolts detail and
not enough of the slightly higher-level "How To"...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Fri, September 22, 2006 11:59 am, Martin Alterisio wrote:
> Anyway... as you say, it would be nice to have a contest that rewards
> readability and maintainability... but, how can we messure that
> qualities in
> this type of games?

If you think of the Open Market of software "out there" as "the game"
and people's decisions to use or not use it, then you've got a pretty
good contest.

And PHP is winning. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Richard Lynch
On Thu, September 21, 2006 9:32 pm, Curt Zirzow wrote:
> On 9/21/06, Tom Atkinson <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> I am attempting to convert this code for generating the digits of pi
>> from the original C (below) to PHP.
>>
>>   long k=4e3,p,a[337],q,t=1e3;
>>main(j){for(;a[j=q=0]+=2,--k;)
>>for(p=1+2*k;j<337;q=a[j]*k+q%p*t,a[j++]=q/p)
>>k!=j>2?:printf("%.3d",a[j-2]%t+q/p/t);}
>
>
> wow this is rather bad. it would probably be better to write this in
> asm, it would be easier to read than the way it is in C.
>
>>
>> I converted this to a more readable form:
>
> what about using:
>   php.net/pi
>
> note the precision description.
>
> or are we talking about a different pi.

We're probably talking about that silly contest started the other day
to calculate pi to 1000 digits...

:-)

My best guess is that the C code is relying on type-casting to hack
something somewhere.

-- 
Like Music?
http://l-i-e.com/artists.htm



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



Re: [PHP] PHP General

2006-09-22 Thread Robert Cummings
On Fri, 2006-09-22 at 18:55 -0400, Robert Cummings wrote:
> Did this list get a new server? Just wondering because lately my posts
> have been showing up within 1 or 2 minutes and they haven't done that in
> years. So either PHP General got a new zippy server or the mail system
> was quarantining my mails before I fixed my DNS (which had some issues I
> didn't notice until a few days ago :)

1 minute 10 seconds for that post to show up... wh! :B

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.  |
`'

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



[PHP] PHP General

2006-09-22 Thread Robert Cummings
Did this list get a new server? Just wondering because lately my posts
have been showing up within 1 or 2 minutes and they haven't done that in
years. So either PHP General got a new zippy server or the mail system
was quarantining my mails before I fixed my DNS (which had some issues I
didn't notice until a few days ago :)

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.  |
`'

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



Re: [PHP] Stop - Blog Time

2006-09-22 Thread Robert Cummings
On Fri, 2006-09-22 at 23:09 +0100, Toby Osbourn wrote:
> I don't want to spam a new blog I have created, so I won't post a link to
> it, but I was thinking about every so often talking about PHP and its many
> uses - to that end, if anyone has anything they want to blog, but couldn't
> be bothered actually making a blog, please email me - naturally you will get
> full credit for the article etc. etc.

I was thinking about writing a blog about people who write blogs and
advertise on PHP General for ideas on which to blog.  :B

Cheers,
Rob.

Ps. this has been written in light humour... not as a flame :)
-- 
..
| 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.  |
`'

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



[PHP] Stop - Blog Time

2006-09-22 Thread Toby Osbourn

I don't want to spam a new blog I have created, so I won't post a link to
it, but I was thinking about every so often talking about PHP and its many
uses - to that end, if anyone has anything they want to blog, but couldn't
be bothered actually making a blog, please email me - naturally you will get
full credit for the article etc. etc.


[PHP] Re: File Upload Security and chmod

2006-09-22 Thread Jo�o C�ndido de Souza Neto
I always use the ftp functions of php to upload files. I think it´s more 
safe than move_uploaded_file function.


""Andy Hultgren"" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
> Hi,
> I am relatively new to php and am trying to set up a file upload
> process for my website.  I have read through the php security
> documentation and a number of the security-related questions on these
> lists and am attempting to implement as many of the measures as
> possible.
> One of the suggestions I have read is to have the uploaded files saved
> somewhere outside of your root directory.  Unfortunately I cannot do
> that as my root directory is simply www.myDomain.com and not
> ".public_html/" and I am on a shared server where my root cannot be
> changed (I have already asked).  So, I am trying to keep the
> permissions on my "saved_files" folder as tight as possible except
> when the actual upload occurs.  I this as follows:
>
> 1) The actual file upload comes through Flash8, and when the user
> uploads a file it is sent to
> www.domain.com/flash8directory/upload.php, which is in the same
> directory as the Flash8 upload application.
> 2) upload.php first chmod 0740 the "saved_files" folder (which is
> located at www.domain.com/flash8directory/saved_files/).  Then it does
> security checks to make sure an appropriate image has been uploaded,
> and if everything looks good it moves the uploaded file to
> "saved_files".
> 3) The Flash8 upload application is notified of the completion of the
> upload and downloads the new image it its viewer.
> 4) Once the download is complete and Flash8 no longer needs to work
> with the file, the Flash8 application notifies a separate php script
> by sending the variable "complete=1" to lockdown.php (located at
> www.domain.com/flash8directory/lockdown.php), which runs the following
> simple script:
>
> 
> $success = 0;
> $complete = $_POST['complete'];
>
> if ($complete==1) {
> if(chmod("./saved_files", 0100)) {
> success = yes;
> echo "success=yes";
> }
> }
> ?>
>
> This script works and "saved_files" is set to chmod 0100, but here is
> the problem.  If I then navigate directly to the url of the uploaded
> file by entering its path in my
> browser(www.domain.com/flash8directory/saved_files/uploadedFile.jpg),
> the uploaded file appears in my browser!  However, if I then refresh
> the browser I get the desired error message saying I do not have
> permission to access that file.  Also, other browser windows never
> have access to view the uploaded file, only the browser from which the
> file was uploaded.
>
> Any thoughts on why I can view the uploaded file even though it has
> been set to chmod 0100?  I'd really rather not have those files
> accessible to anyone, as an extra security layer.
>
> Thank you for your help!
>
> Andy 

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



Re: [PHP] File Upload Security and chmod

2006-09-22 Thread Børge Holen
On Friday 22 September 2006 22:58, Andy Hultgren wrote:
> Hi,
> I am relatively new to php and am trying to set up a file upload
> process for my website.  I have read through the php security
> documentation and a number of the security-related questions on these
> lists and am attempting to implement as many of the measures as
> possible.
> One of the suggestions I have read is to have the uploaded files saved
> somewhere outside of your root directory.  Unfortunately I cannot do
> that as my root directory is simply www.myDomain.com and not
> ".public_html/" and I am on a shared server where my root cannot be
> changed (I have already asked).  So, I am trying to keep the
> permissions on my "saved_files" folder as tight as possible except
> when the actual upload occurs.  I this as follows:
>
> 1) The actual file upload comes through Flash8, and when the user
> uploads a file it is sent to
> www.domain.com/flash8directory/upload.php, which is in the same
> directory as the Flash8 upload application.
> 2) upload.php first chmod 0740 the "saved_files" folder (which is
> located at www.domain.com/flash8directory/saved_files/).  Then it does
> security checks to make sure an appropriate image has been uploaded,
> and if everything looks good it moves the uploaded file to
> "saved_files".
> 3) The Flash8 upload application is notified of the completion of the
> upload and downloads the new image it its viewer.
> 4) Once the download is complete and Flash8 no longer needs to work
> with the file, the Flash8 application notifies a separate php script
> by sending the variable "complete=1" to lockdown.php (located at
> www.domain.com/flash8directory/lockdown.php), which runs the following
> simple script:
>
> 
> $success = 0;
> $complete = $_POST['complete'];
>
> if ($complete==1) {
>   if(chmod("./saved_files", 0100)) {
>  success = yes;
>   echo "success=yes";
>   }
> }
> ?>
>
> This script works and "saved_files" is set to chmod 0100, but here is
> the problem.  If I then navigate directly to the url of the uploaded
> file by entering its path in my
> browser(www.domain.com/flash8directory/saved_files/uploadedFile.jpg),
> the uploaded file appears in my browser!  However, if I then refresh
> the browser I get the desired error message saying I do not have
> permission to access that file.  Also, other browser windows never
> have access to view the uploaded file, only the browser from which the
> file was uploaded.
>
> Any thoughts on why I can view the uploaded file even though it has
> been set to chmod 0100?  I'd really rather not have those files
> accessible to anyone, as an extra security layer.
>
> Thank you for your help!
>
> Andy

I don't quite understand why you cannot save to another catalog.
is  www.myDomain.com yer actual directory name of merely the domain?
If either, login to yer domain and simply go either one step up, is that 
possible? 
You can also make use of a .htaccess file inside a sub directory to keep 
others from it till you have checked the file, then move it out in the open 
or delete after specifications.

Do you have access to /tmp ? That one is possible to use, in fact any system 
wide directory writable by any/you is usable.

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

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



[PHP] File Upload Security and chmod

2006-09-22 Thread Andy Hultgren

Hi,
I am relatively new to php and am trying to set up a file upload
process for my website.  I have read through the php security
documentation and a number of the security-related questions on these
lists and am attempting to implement as many of the measures as
possible.
One of the suggestions I have read is to have the uploaded files saved
somewhere outside of your root directory.  Unfortunately I cannot do
that as my root directory is simply www.myDomain.com and not
".public_html/" and I am on a shared server where my root cannot be
changed (I have already asked).  So, I am trying to keep the
permissions on my "saved_files" folder as tight as possible except
when the actual upload occurs.  I this as follows:

1) The actual file upload comes through Flash8, and when the user
uploads a file it is sent to
www.domain.com/flash8directory/upload.php, which is in the same
directory as the Flash8 upload application.
2) upload.php first chmod 0740 the "saved_files" folder (which is
located at www.domain.com/flash8directory/saved_files/).  Then it does
security checks to make sure an appropriate image has been uploaded,
and if everything looks good it moves the uploaded file to
"saved_files".
3) The Flash8 upload application is notified of the completion of the
upload and downloads the new image it its viewer.
4) Once the download is complete and Flash8 no longer needs to work
with the file, the Flash8 application notifies a separate php script
by sending the variable "complete=1" to lockdown.php (located at
www.domain.com/flash8directory/lockdown.php), which runs the following
simple script:



This script works and "saved_files" is set to chmod 0100, but here is
the problem.  If I then navigate directly to the url of the uploaded
file by entering its path in my
browser(www.domain.com/flash8directory/saved_files/uploadedFile.jpg),
the uploaded file appears in my browser!  However, if I then refresh
the browser I get the desired error message saying I do not have
permission to access that file.  Also, other browser windows never
have access to view the uploaded file, only the browser from which the
file was uploaded.

Any thoughts on why I can view the uploaded file even though it has
been set to chmod 0100?  I'd really rather not have those files
accessible to anyone, as an extra security layer.

Thank you for your help!

Andy

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



Re: [PHP] [OFF] PHP/MySQL contractor needed

2006-09-22 Thread Google Kreme

On 22 Sep 2006, at 11:14 , Robert Cummings wrote:
Geee, way to fight back against the shrinking distance of the  
global

community brought to you by the Internet. I'm just curious why so many
posters for jobs feel the need to force a local boundary. Is the  
quality

of work somehow better because you can knock on their door?


Hah!  I'd say its worse, on average.


--
I gotta straighten my face
this mellow thighed chick just put my spine out of place

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio

2006/9/22, Tom Atkinson <[EMAIL PROTECTED]>:


Martin Alterisio wrote:
> 2006/9/22, Rory Browne <[EMAIL PROTECTED]>:
>>
>> On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:
>> >
>> > This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:
>> >
>> > > what about using:
>> > >   php.net/pi
>> > >
>> > > note the precision description.
>> > >
>> > > or are we talking about a different pi.
>> >
>> > The goal of the codegolf.com challenge is to print pi to 1000 places.
>> > The programmer to do it in the least keystrokes is the winner.
>>
>>
>> I personally don't think this is a very healthy contest. It discourages
>> comments, and use of whitespace to make code readable.
>>
>> I'd perfer a contest that rewarded code readability, and
maintainability
>> as
>> well as minimal keystrokes. After all you only enter the aforementioned
>> keystrokes once. Perhaps one like codegolf, with an enforced coding
style
>> (
>> eg KR Style, or GNU Style)
>>
>>
> I completely agree. This kind of contests do not provide any measure of
the
> good qualities of a programmer working as part of a team. The objectives
> ussualy end up being something of the sort: "let's see who can fit the
most
> in a for declaration".
>
> Anyway... as you say, it would be nice to have a contest that rewards
> readability and maintainability... but, how can we messure that
> qualities in
> this type of games? Should your code be praised by others and voted on?
Is
> that reliable? I think enforcing a coding style is too restrictive...
Also,
> how do we measure the declarativity of var and function names?
>

The value of these games is that they give you interesting problems to
solve without forcing you to maintain the code. That's the entire point.
It's exactly the sort of thing that's fun to write when you have to make
a living from your code the rest of the time. If you want to write
quality software in your free time then you start/join an FOSS project
and put the code to good use.

Nobody is claiming that this is a good way to write code or a good way
to learn PHP, it's just for fun.



You're right, it's just for fun but... they could still be fun and be
useful. These kind of games could easily be used for education and training.
We all know that the quest/mob grinding factor can be very addictive, why
don't use all that energy for the good? You could still learn how to do a
good job while having fun...


[PHP] mime_content_type replacement

2006-09-22 Thread Chris Jett
I understand that fileinfo is supposed to be the replacement for  
mime_content_type(), but the documentation is not real helpful.  What  
is the direct replacement for mime_content_type()?

--
Chris Jett
[EMAIL PROTECTED]

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



[PHP] Object Memory Leakage...

2006-09-22 Thread Jon Anderson
Sorry folks, this is a long one...I've re-read a bunch of the 
documentation, and I can't find a solution.


In debugging an out of memory condition, I found that PHP doesn't seem 
to garbage collect unreferenced objects. It seems to work fine for 
anything other than objects. (Arrays, strings, integers, etc.)


Here's a simple example: define a class, create 3 instances, destroy 
them in reverse order. I would expect that after each unset and/or NULL, 
the memory usage would go down, they don't. See the output below.


Note: the memory usage remains constant after the objects are allocated, 
even when they're unset/NULL'ed.


Some of the user contributed notes on the PHP documentation suggest that 
the memory is actually freed and available for use by other 
variables/objects even though memory_get_usage() says otherwise. Another 
little test seems to disprove that too... The idea here is to allocate 
close to 8 MB, then free it to show that it can allocate that data 
within the memory limit. Then allocate enough class instances and free 
them again such that the memory usage increases enough that the same 
data allocated and freed initially doesn't fit anymore. If PHP did 
indeed free the objects, the data would fit the second time too...


test = rand();
   }
}

echo "Initial Memory Usage: " . memory_get_usage() . "\n";

$mb = 6 * 1024 * 1024;
echo "Allocating 7 MB of data...";
$dat = "";
for ($x=0;$x<$mb;$x++) {
   $dat .= "x";
}
echo "Memory Usage: " . memory_get_usage() . "\n";
unset($dat,$x,$mb);
echo "Unset Usage: " . memory_get_usage() . "\n";

$num = 32767;
$objects = array();

echo "Initial Memory Usage (2): " . memory_get_usage() . "\n";
echo "Allocating $num objects...";
for ($x=0;$x<$num;$x++) {
   $objects[$x] = new Tester();
}
echo "Done. Memory Usage: " . memory_get_usage() . "\n";
echo "Freeing $num objects...";
for ($x=0;$x<$num;$x++) {
   unset($objects[$x]); $objects[$x] = NULL;
}
echo "Done. Memory Usage: " . memory_get_usage() . "\n";

$mb = 6 * 1024 * 1024;
echo "Allocating 7 MB of data...";
$dat = "";
for ($x=0;$x<$mb;$x++) {
   $dat .= "x";
}

This gives:

Initial Memory Usage: 44248
Allocating 7 MB of data...Memory Usage: 6335888
Unset Usage: 8
Initial Memory Usage (2): 44504
Allocating 32767 objects...Done. Memory Usage: 7752920
Freeing 32767 objects...Done. Memory Usage: 2807080
Allocating 7 MB of data...
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to 
allocate 1 bytes) in /home/janderson/svn/memtest.php on line 44



Am I missing something? (Is there a force_garbage_collection() function 
somewhere that I'm missing?) Any suggestions/workarounds/anything would 
be most appreciated.


Cheers,

jon

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread php
Hello all,

> > I personally don't think this is a very healthy contest. It
> > discourages comments, and use of whitespace to make code readable.

> Anyway... as you say, it would be nice to have a contest that rewards
> readability and maintainability... but, how can we messure that
> qualities in this type of games? Should your code be praised by others
> and voted on? Is that reliable? I think enforcing a coding style is
> too restrictive... Also, how do we measure the declarativity of var
> and function names?

For some real trouble, try the International Obsfucated C Code Contest:
http://www.ioccc.org/

These contests like Code Golf are just for fun, I can't say that they
encourage bad practice as long as you understand what the contest is
about.

That aside, I think that it would be very beneficial to the community as a
whole if a contest was started that encouraged readability and good
practices.

The scoring and judging could be done by a panel, but I think that it
would be more fun if the community itself was able to vote on various
attributes; readability, efficiency, general approach, originality, etc.
Allow people to comment on each entry. I don't know about the winner
getting anything besides bragging rights, but it if gets large enough
maybe there can be a few corporate sponsors giving away licenses or
something. Who knows?

I think it would be a lot of fun if well executed.

-K.Bear

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Tom Atkinson

Martin Alterisio wrote:

2006/9/22, Rory Browne <[EMAIL PROTECTED]>:


On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:
>
> This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:
>
> > what about using:
> >   php.net/pi
> >
> > note the precision description.
> >
> > or are we talking about a different pi.
>
> The goal of the codegolf.com challenge is to print pi to 1000 places.
> The programmer to do it in the least keystrokes is the winner.


I personally don't think this is a very healthy contest. It discourages
comments, and use of whitespace to make code readable.

I'd perfer a contest that rewarded code readability, and maintainability
as
well as minimal keystrokes. After all you only enter the aforementioned
keystrokes once. Perhaps one like codegolf, with an enforced coding style
(
eg KR Style, or GNU Style)



I completely agree. This kind of contests do not provide any measure of the
good qualities of a programmer working as part of a team. The objectives
ussualy end up being something of the sort: "let's see who can fit the most
in a for declaration".

Anyway... as you say, it would be nice to have a contest that rewards
readability and maintainability... but, how can we messure that 
qualities in

this type of games? Should your code be praised by others and voted on? Is
that reliable? I think enforcing a coding style is too restrictive... Also,
how do we measure the declarativity of var and function names?



The value of these games is that they give you interesting problems to 
solve without forcing you to maintain the code. That's the entire point. 
It's exactly the sort of thing that's fun to write when you have to make 
a living from your code the rest of the time. If you want to write 
quality software in your free time then you start/join an FOSS project 
and put the code to good use.


Nobody is claiming that this is a good way to write code or a good way 
to learn PHP, it's just for fun.


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



Re: [PHP] [OFF] PHP/MySQL contractor needed

2006-09-22 Thread Robert Cummings
On Fri, 2006-09-22 at 09:00 -0700, Brian Dunning wrote:
>
> Also - only interested in someone local to south Orange County, CA.  
> No outsourcers or non-locals can be considered, sorry.

Geee, way to fight back against the shrinking distance of the global
community brought to you by the Internet. I'm just curious why so many
posters for jobs feel the need to force a local boundary. Is the quality
of work somehow better because you can knock on their door?

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.  |
`'

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread Martin Alterisio

2006/9/22, Rory Browne <[EMAIL PROTECTED]>:


On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:
>
> This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:
>
> > what about using:
> >   php.net/pi
> >
> > note the precision description.
> >
> > or are we talking about a different pi.
>
> The goal of the codegolf.com challenge is to print pi to 1000 places.
> The programmer to do it in the least keystrokes is the winner.


I personally don't think this is a very healthy contest. It discourages
comments, and use of whitespace to make code readable.

I'd perfer a contest that rewarded code readability, and maintainability
as
well as minimal keystrokes. After all you only enter the aforementioned
keystrokes once. Perhaps one like codegolf, with an enforced coding style
(
eg KR Style, or GNU Style)



I completely agree. This kind of contests do not provide any measure of the
good qualities of a programmer working as part of a team. The objectives
ussualy end up being something of the sort: "let's see who can fit the most
in a for declaration".

Anyway... as you say, it would be nice to have a contest that rewards
readability and maintainability... but, how can we messure that qualities in
this type of games? Should your code be praised by others and voted on? Is
that reliable? I think enforcing a coding style is too restrictive... Also,
how do we measure the declarativity of var and function names?


Re: [PHP] Override php.ini

2006-09-22 Thread Brad Bonkoski

the ini directive for this is: asp_tags
and it appears you can set them in the .htaccess file on a per directory 
basis.


See the user contributed notes on www.php.net/ini_set
HTH
-B

Beauford wrote:

Is there a way I can use <% %> instead of  for the opening and closing
tags of a php script. I thought I read this somewhere but can't find
anything on it now.

Is there something that I could do with override php.ini command? I don't
have access to the php.ini file on this server.

Thanks

B

  


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



RE: [PHP] Override php.ini

2006-09-22 Thread Martin Bach Nielsen
http://us2.php.net/ini.core

asp_tags  boolean

Enables the use of ASP-like <% %> tags in addition to the usual 
tags. This includes the variable-value printing shorthand of <%= $value %>.
For more information, see Escaping from HTML.

Note: Support for ASP-style tags was added in 3.0.4.

I don't know if you can use a php.ini override command to do this, but it's
worth a try :)

// Martin

-Original Message-
From: Beauford [mailto:[EMAIL PROTECTED] 
Sent: 22. september 2006 18:42
To: PHP
Subject: [PHP] Override php.ini

Is there a way I can use <% %> instead of  for the opening and closing
tags of a php script. I thought I read this somewhere but can't find
anything on it now.

Is there something that I could do with override php.ini command? I don't
have access to the php.ini file on this server.

Thanks

B

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



[PHP] Override php.ini

2006-09-22 Thread Beauford
Is there a way I can use <% %> instead of  for the opening and closing
tags of a php script. I thought I read this somewhere but can't find
anything on it now.

Is there something that I could do with override php.ini command? I don't
have access to the php.ini file on this server.

Thanks

B


[PHP] reading urlencoded data from POST

2006-09-22 Thread Marek 'MMx' Ludha

Hi.

I need to read urlencoded data from POST request. So far I have tried
$_POST['name'], but this converts each input %5C to two backslashes
(instead of one) and %00 to \0 (slash zero, not zero byte) for some
reason. Is there any other way to read the data apart from parsing
php://input myself?
Thanks in advance for any response.

--
Marek 'MMx' Ludha

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



[PHP] [OFF] PHP/MySQL contractor needed

2006-09-22 Thread Brian Dunning
We need a guy for some hourly PHP/MySQL work. Large project to start  
with, plenty of incremental stuff down the road. Looking for someone  
expert, with a flexible schedule who can make hours available when we  
need them. Your regular hourly rate.


Also - only interested in someone local to south Orange County, CA.  
No outsourcers or non-locals can be considered, sorry.


Please email me back-channel for details if interested. Thanks!

- Brian

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



[PHP] Re: web browser shows blank page when accessing *.php file

2006-09-22 Thread Anna Barnes

Hi All
This is all very weird and it may be that it isn't a php problem  
after all.


Here is line 494 in ical_parser.php
 ereg ("([^:]+):(.*)", $line

Additional information is
a) the mac that publishes the ical is always up, no probs there  
although I should check if a system update has been done recently.
b) The webserver that hosts the calendar is definitely up because all  
the other web pages work.
c) The athentication definitely works since if I put in the wrong  
username and password it comes back with an error.
d) the whole thing worked perfectly until a few days ago. I've  
managed to get it up again by restarting httpd but then it fails  
again shortly after.

e) I've made no changes to the webserver.
f) Is it possible that its trying to access too much data from the  
calendar i.e it is possible to go back 18 months and look at the  
schedule.


I'm just about to archive the existing scanner.ics file and republish  
another one to see it that works.

thanks
Anna

On Sep 22, 2006, at 8:06 AM, Kae Verens wrote:


Anna Barnes wrote:

[Tue Sep 19 15:53:57 2006] [error] PHP Fatal error: Maximum  
execution time of 60 seconds exceeded in /websites/ical/functions/ 
ical_parser.php on line 494

Not quite sure where to go from here.


"ical_parser" sounds like it is a function which sucks in  
information from other computers. if one of those computers is  
down, then your program will probably timeout while waiting for the  
information.


Kae


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



Re: [PHP] +AFs-OT+AF0- Working with version control

2006-09-22 Thread Ray Hauge
On Friday 22 September 2006 07:29, Miles Thompson wrote:
> Use Subversion.
> For a nice Windows interface - Tortoise. Sorry, I can't rememberthe name
> ofthe Linux interface.
>
> Miles

I like kdesvn.  It actually uses the svn API so it isn't just a wrapper for 
the command line.

http://www.alwins-world.de/programs/kdesvn/

If you use SVN+SSH, and you run kdesvn from the command line, then it will ask 
you for your password on the command line.  Just a little hint.

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099

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



[PHP] Re: Asking about failure of accessing mySQL database by PHP-5.1.6 on Windows 2003

2006-09-22 Thread Jo�o C�ndido de Souza Neto
Try to copy php_mysql.dll to your system32 folder. I did it and works fine.

""Nguyen, Phuong Anh Ho"" <[EMAIL PROTECTED]> escreveu na mensagem 
news:[EMAIL PROTECTED]
Hello Sir/ Madame,


I am a developer working with PHP-5.1.6-Win32 and mySQL database. Following 
is my question:

I successfully runs PHP-5.1.6-Win32 with Internet Information Services 6 
(II6) on Windows 2003 under ISAPI mode. Then, I runs the index.php of 
phpMyAdmin software to connect to MySQL database, the result is "Cannot load 
mysql extension. Please check your PHP configuration".

Conditions such as php_mysql.dll and supplying information for extension_dir 
in php.ini are supplied.

Such a connection runs successfully on Windows XP but not on Windows 2003.

Please answer me the problem on Windows 2003. Thank you!


Best Regards,

Phuong


This email may contain material that is confidential, privileged and/or 
attorney work product for the sole use of the intended recipient. Any 
review, reliance or distribution by others or forwarding without express 
permission is strictly prohibited. If you are not the intended recipient, 
please contact the sender and delete all copies.

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



Re: [PHP] Help converting C to PHP

2006-09-22 Thread tedd

At 2:38 PM +0200 9/22/06, Rory Browne wrote:

On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:

The goal of the codegolf.com challenge is to print pi to 1000 places.
The programmer to do it in the least keystrokes is the winner.


I personally don't think this is a very healthy contest. It discourages
comments, and use of whitespace to make code readable.

I'd perfer a contest that rewarded code readability, and maintainability as
well as minimal keystrokes. After all you only enter the aforementioned
keystrokes once. Perhaps one like codegolf, with an enforced coding style (
eg KR Style, or GNU Style)


Agreed, but our old ways remain to haunt us.

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

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



[PHP] Asking about failure of accessing mySQL database by PHP-5.1.6 on Windows 2003

2006-09-22 Thread Nguyen, Phuong Anh Ho
Hello Sir/ Madame,


I am a developer working with PHP-5.1.6-Win32 and mySQL database. Following is 
my question:

I successfully runs PHP-5.1.6-Win32 with Internet Information Services 6 (II6) 
on Windows 2003 under ISAPI mode. Then, I runs the index.php of phpMyAdmin 
software to connect to MySQL database, the result is "Cannot load mysql 
extension. Please check your PHP configuration".

Conditions such as php_mysql.dll and supplying information for extension_dir in 
php.ini are supplied.

Such a connection runs successfully on Windows XP but not on Windows 2003. 

Please answer me the problem on Windows 2003. Thank you!


Best Regards,

Phuong


This email may contain material that is confidential, privileged and/or 
attorney work product for the sole use of the intended recipient. Any review, 
reliance or distribution by others or forwarding without express permission is 
strictly prohibited. If you are not the intended recipient, please contact the 
sender and delete all copies.

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

Re: [PHP] Help converting C to PHP

2006-09-22 Thread Rory Browne

On 9/22/06, Kevin Waterson <[EMAIL PROTECTED]> wrote:


This one time, at band camp, "Curt Zirzow" <[EMAIL PROTECTED]> wrote:

> what about using:
>   php.net/pi
>
> note the precision description.
>
> or are we talking about a different pi.

The goal of the codegolf.com challenge is to print pi to 1000 places.
The programmer to do it in the least keystrokes is the winner.



I personally don't think this is a very healthy contest. It discourages
comments, and use of whitespace to make code readable.

I'd perfer a contest that rewarded code readability, and maintainability as
well as minimal keystrokes. After all you only enter the aforementioned
keystrokes once. Perhaps one like codegolf, with an enforced coding style (
eg KR Style, or GNU Style)


Re: [PHP] +AFs-OT+AF0- Working with version control

2006-09-22 Thread Miles Thompson

At 06:21 PM 9/21/2006, Chris W. Parker wrote:


Hello,

This is off topic but I wanted to get the list member's opinions on the
subject as it will probably benefit someone else.

Currently I don't use version control at all. What I do instead is have
one directory that contains my development website and one directory
that contains the live website which I do not directly modify. When I
need to fix something or add a new feature I edit the development site
and copy the files that I've changed.

Sometimes I will start on a new feature before I am able to finish a
previous one. This is a major problem when the features overlap and I
have to edit the same file for both features. Even if I finish one of
the features I cannot publish the files because the other feature is not
ready yet.

What I'm looking to the list for is how I can overcome this through
version control.

What I'm thinking I'd do is create a base level (say v1.0) that I then
create a branch for every new feature and then merge those things
together. The issue I see in this case is the merging.

Is this a sound strategy or should I just realize that I can't publish
until all current features enhancements are completed?


Thanks,
Chris.



Not OT at all.

Use Subversion.
For a nice Windows interface - Tortoise. Sorry, I can't rememberthe name 
ofthe Linux interface.


Miles




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.7/454 - Release Date: 9/21/2006

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



[PHP] Re: Fatal error: session_start(): Failed to initialize storage module

2006-09-22 Thread Kae Verens

[EMAIL PROTECTED] wrote:

Hi,

"Fatal error: session_start(): Failed to initialize storage module in
/home/vernoncompany.biz/includes/validations.php on line 2"

validation.php:
#1 


possibly.

or it could be a disk-space problem.

what does your server's error_log say?

Kae

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



[PHP] Re: web browser shows blank page when accessing *.php file

2006-09-22 Thread Kae Verens

Anna Barnes wrote:

[Tue Sep 19 15:53:57 2006] [error] PHP Fatal error: Maximum execution 
time of 60 seconds exceeded in /websites/ical/functions/ical_parser.php 
on line 494


Not quite sure where to go from here.


"ical_parser" sounds like it is a function which sucks in information from 
other computers. if one of those computers is down, then your program will 
probably timeout while waiting for the information.


Kae

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



RE: [PHP] Help converting C to PHP

2006-09-22 Thread Jay Blanchard
[snip]
Codegolf...

heh.. nice little twist.
[/snip]

At least we weren't asked to help someone write his homework. 

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



RE: [PHP] Re: Frustrated trying to get help from your site

2006-09-22 Thread Arno Kuhl
-Original Message-
From: Michelle Konzack [mailto:[EMAIL PROTECTED]
Sent: 19 September 2006 11:14
To: php-general@lists.php.net
Subject: [PHP] Re: Frustrated trying to get help from your site


Am 2006-09-18 14:43:12, schrieb Jon Anderson:

> As an aside, I think that the online and offline (downloadable) PHP
> documentation is probably the clearest, best organized and complete set
> of documentation for any programming language I've run into online.

I wish, the downloadable documentation would include all those
examples since this is, WHY the Documentation is realy great.

--

I'm not sure which examples you're referring to but if you mean the user
contributed notes then the download documentation does include this - at
least one of the .chm versions does. It's great, but you need to download it
regularly if you want the latest notes (obviously). Use one of the skins and
it's even better (I use the phpZ skin which displays a tab for the user
notes).

Cheers
Arno

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