[PHP] file_get_contents

2007-02-06 Thread Steven Macintyre
Hiya,

I need to be able to read a file into a string - I have used the above
command and it works ... now ... I need to read a file into a string - that
requires a username and password to access the authentication is normal HTTP
basic realm

Any ideas?



Kind Regards


Steven Macintyre

--

www.friends4friends.co.za 

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



Re: [PHP] Writting a simple proxy in PHP

2007-02-06 Thread Jochem Maas
Alessandro Vernet wrote:
> I would like to forward on the server side (also called "proxy" or
> "server-side redirect") some queries that get to my PHP script. A naive
> approach is to do:
> 
> print(implode("", file("http://localhost:8090"; . $REQUEST_URI)));
> 
> Where http://localhost:8090 is the address I want to proxy to. But of
> course, this only works for simple GET requests. It does not forward headers
> (like Authentication), and won't work if the request is a POST.
> 
> Has anyone a suggestion on how I could implement a better proxy? I am not
> looking for a perfect solution. Something that would forward headers and
> handle posts would be good enough.

if your using apache then you should look at the ProxyPass directive - very 
hand,
STW or STA for more detailed info.

> 
> Alex

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



[PHP] Graphs

2007-02-06 Thread Kristian Erendi

Hi,

I wish to draw graphs on a web page.
Can someone tell me which extension or package I should use?
Any examples?

TIA Krillo


Re: [PHP] Converting string representation of a directory to multi-dimensional array

2007-02-06 Thread Jochem Maas
Richard Lynch wrote:
> On Mon, February 5, 2007 12:27 pm, Matt Carlson wrote:
>> Over the weekend, I was tasked with taking a string representation of
>> a directory ('\Interface\Addons\\'), which can
>> vary in length (no set number of depths) to a multi-dimensional array
>> (i.e.  array('Interface' => array('Addons' => array('' =>
>> )));).
>>
>> We came up with a very ugly hack to do it, but I'm curious if anyone
>> can help us wrap our head around a better solution, without using eval
>> (which we were able to find that solution quickly, but do not want to
>> use eval).
>>
>> Our situation is a little unique in the fact that these files don't
>> actually exist on a filesystem, so it makes it a bit more tough to
>> actually create this array.
>>
>> Thanks for any help you can give in cleaning this up somewhat.
>>
>> Here is the function we currently use:
>>
>> >
>> $array = array();
>>
>> addToList('\interface\addons\clearfont\clearfont.toc2', $array);
>> addToList('\interface\addons\clearfont\clearfont.toc3', $array);
>> addToList('\interface\addons\clearfont\clearfont.toc4', $array);
>> addToList('\interface\addons\clearfont\clearfont.toc5', $array);
>> addToList('\interface\addons\clearfont\subdir\something.toc', $array);
> 
> function addToList($path){
>   $parts = explode('\\', $path);
>   $result = array();
>   $parts = array_reverse($parts);
>   foreach($parts as $part){
> //something with array_splice here...
> $result = array_splice(array($result), $part); //???

array_splice won't cut it as it only splices at 1 level, unless I misunderstood
the OP is looking to dynamically build a multilevel array - which means
either using recursion or 'reference based array digging' (as I like to call it 
;-)

there may also be some kind of solution based on
ArrayArrayArrayIteratorIteratorRecursiveArrayIteratorIteratorRecursiveIterator 
but
personally I don't grok those exotic forms of SPL interface well enough to tell 
you.

>   }
> }
> 

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



[PHP] All-in-one PHP Classes

2007-02-06 Thread Tim

Hello folks,

Have been reading posts daily for two months now on the list, and am very
pleased at how informative these can be.
I have noticed, many examples where one is pointed to using classes
downloadable on the internet. 

Not a very big user of these classes my self (maybe a bit naïf in this
sense, but i just can't have unnecessary code loaded on an include() i like
to keep things clean and to a minimal)I decided to go through and look at
how they are built and what kind of "code load" we are talking about.
This is when i realized how often these classes that do "everything" are
very BIG. Now I realize how many functions this type of class can have and
how handy it can be for someone who does not want to code his own, and yes I
hear all the "reinventing the wheel" comments comming forth as well as
security etc, BUT (yes THE "but") are general classes like this pushing to
using bigger, more bloated web application which require more and more
bandwidth/processor/ram, server-side?

Here, it's the programmer who is confronted with loading huge files into
memory to use just one perhaps two function in a 300+ functionality class..

At what moment does one decide to use an all-in-one "bloated" with "out of
context" functionality, php class, knowing how powerfull only several
functions in this class can be to him?

Shouldn't these classes be perhaps broken down into usefull "parts".

Thanks for any input.

Regards,

Tim

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



Re: [PHP] Server Stall

2007-02-06 Thread Stut

Sancar Saran wrote:

I think php does not open second thread for same session...


Does your script use sessions? If so, then your problem has nothing to 
do with anything the script is doing and everything to do with PHP 
locking sessions.


* Request 1 does a start_session(), and PHP locks the session to that 
request.


* Request 2 comes in and does a start_session(), and PHP finds the 
session already locked. It will block until the session is unlocked, 
which will happen when request 1 completes.


Of course if you're not using sessions this message has been a waste of 
energy and I should go out and plant a tree.


-Stut

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



Re: [PHP] Graphs

2007-02-06 Thread David Blanco
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi!

Kristian Erendi escribió:

> I wish to draw graphs on a web page.
> Can someone tell me which extension or package I should use?
> Any examples?

I suppose you mean "Statistical graphs". If such a case, try jpgraph

http://www.aditus.nu/jpgraph/

For a "lower-level interface" you could try the bundled GD extension
and draw lines, point, fill them all, etc. ;)


Greetings from Spain

- --
David Blanco - Programación y sistemas
Publicinet (Publicidad-Cine-Internet, S.L.)
Urzaiz, 71, entlo, izda. -- 36204 Vigo
Telf 902.014.606 -- http://www.publicinet.net


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFyGvSdbgIy1SiWTARArwCAJ488Bg5Rzxdxrab++gfIFkApirNigCbBtcr
jJytDvKzXia7wa3MphI+PfU=
=2dZ9
-END PGP SIGNATURE-

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



[PHP] Re: All-in-one PHP Classes

2007-02-06 Thread setcookie
there are special design patterns for autoloading  classes and subclasses to
use only we needed at runtime! this together with singeltons pattern will
prevent any memory overflows. problem is that almost nobody implements these
patterns when designing "standalone" classes

fra*

Hello folks,

Have been reading posts daily for two months now on the list, and am very
pleased at how informative these can be.
I have noticed, many examples where one is pointed to using classes
downloadable on the internet.

Not a very big user of these classes my self (maybe a bit naïf in this
sense, but i just can't have unnecessary code loaded on an include() i like
to keep things clean and to a minimal)I decided to go through and look at
how they are built and what kind of "code load" we are talking about.
This is when i realized how often these classes that do "everything" are
very BIG. Now I realize how many functions this type of class can have and
how handy it can be for someone who does not want to code his own, and yes I
hear all the "reinventing the wheel" comments comming forth as well as
security etc, BUT (yes THE "but") are general classes like this pushing to
using bigger, more bloated web application which require more and more
bandwidth/processor/ram, server-side?

Here, it's the programmer who is confronted with loading huge files into
memory to use just one perhaps two function in a 300+ functionality class..

At what moment does one decide to use an all-in-one "bloated" with "out of
context" functionality, php class, knowing how powerfull only several
functions in this class can be to him?

Shouldn't these classes be perhaps broken down into usefull "parts".

Thanks for any input.

Regards,

Tim

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



RE: [PHP] Graphs

2007-02-06 Thread Jay Blanchard
[snip]
I wish to draw graphs on a web page.
Can someone tell me which extension or package I should use?
Any examples?
[/snip]

Google for jpgraph

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



[PHP] Re: file_get_contents

2007-02-06 Thread Colin Guthrie
Steven Macintyre wrote:
> Hiya,
> 
> I need to be able to read a file into a string - I have used the above
> command and it works ... now ... I need to read a file into a string - that
> requires a username and password to access the authentication is normal HTTP
> basic realm
> 
> Any ideas?

$var =
file_get_contents('http://username:[EMAIL PROTECTED]/path/to/secret/file.txt');

This is standard web syntax - e.g. it will work in a web browser, wget,
curl, etc.

Col.

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



Re: [PHP] Server Stall

2007-02-06 Thread Stut

Sancar Saran wrote:

Yes you are absolute right.
Session was locked...

Thanks for info  :)


No problem, but please include the list in replies especially when 
you're confirming a possible explanation. It helps improve the 
usefulness of the archives.


-Stut


On Tuesday 06 February 2007 13:54, you wrote:

Sancar Saran wrote:

I think php does not open second thread for same session...

Does your script use sessions? If so, then your problem has nothing to
do with anything the script is doing and everything to do with PHP
locking sessions.

* Request 1 does a start_session(), and PHP locks the session to that
request.

* Request 2 comes in and does a start_session(), and PHP finds the
session already locked. It will block until the session is unlocked,
which will happen when request 1 completes.

Of course if you're not using sessions this message has been a waste of
energy and I should go out and plant a tree.

-Stut


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



Re: [PHP] PHP book reviewers wanted

2007-02-06 Thread tedd

At 8:39 PM -0600 2/5/07, Richard Lynch wrote:

On Mon, February 5, 2007 10:09 am, tedd wrote:

 At 1:05 AM -0200 2/5/07, Manuel Lemos wrote:

Demonstrating good English writing skills and having published good
 book
reviews in the past gets me preference.


 "gets me preference" ???

 Me get any money for this?


Hey, go easy on the non-native speakers...

I'm betting your Spanish is worse than his English...


No doubt -- I have enough problems with English.

My point was, or at least my failed attempt was: 1) humor; 2) 
pointing out a proof reading error in a request for roof reading 
skills. I found that ironically humorous.


No disrespect was intended, it was just a jab between posters.

My apologies if any offense was taken.

Cheers,

tedd

PS:  He is a native speaker, it's just not English.  :-)
--
---
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



Re: [PHP] PHP book reviewers wanted

2007-02-06 Thread tedd

At 4:04 AM -0200 2/6/07, Manuel Lemos wrote:

Anyway, since you brought that up, I would like to clarify that this is
often misunderstood issue. Nobody likes ads, including myself. Ads are
obviously necessary to keep the site viable. Otherwise it would have
been closed a long time ago.


Why are ads necessary? I don't follow.

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



Re: [PHP] Writting a simple proxy in PHP

2007-02-06 Thread Casey Chu

Try using cUrl.

On 2/6/07, Jochem Maas <[EMAIL PROTECTED]> wrote:

Alessandro Vernet wrote:
> I would like to forward on the server side (also called "proxy" or
> "server-side redirect") some queries that get to my PHP script. A naive
> approach is to do:
>
> print(implode("", file("http://localhost:8090"; . $REQUEST_URI)));
>
> Where http://localhost:8090 is the address I want to proxy to. But of
> course, this only works for simple GET requests. It does not forward headers
> (like Authentication), and won't work if the request is a POST.
>
> Has anyone a suggestion on how I could implement a better proxy? I am not
> looking for a perfect solution. Something that would forward headers and
> handle posts would be good enough.

if your using apache then you should look at the ProxyPass directive - very 
hand,
STW or STA for more detailed info.

>
> Alex

--
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



Re: [PHP] Converting string representation of a directory to multi-dimensional array

2007-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-06 12:45:22 +0100:
> there may also be some kind of solution based on
> ArrayArrayArrayIteratorIteratorRecursiveArrayIteratorIteratorRecursiveIterator
> but personally I don't grok those exotic forms of SPL interface well
> enough to tell you.

I had wanted to post something when the thread started, but gave up,
because I quickly ran into ambiguities.  What should the conversion do
when given a basename, e. g.  addToList("file.txt", ...)?

Anyway, here's an implementation, and a few Testilence tests.  The code
doesn't provide for iteration since, AFAICT, the OP is looking for
a map, not an iterable collection.

sep = $sep;
$path = trim($path, $sep);
if ($this->isBasename($path)) {
throw new InvalidArgumentException;
}
list($key, $rest) = $this->split($path);
$this->key = $key;
if ($this->isBasename($rest)) {
$this->data = $rest;
} else {
$this->data = new self($rest, $sep);
}
}
function __toString()
{
return $this->key . $this->sep . $this->data;
}
function offsetExists($key)
{
return $this->key === $key;
}
function offsetGet($key)
{
return $this->data;
}
function offsetUnset($key) { throw new LogicException; }
function offsetSet($key, $value) { throw new LogicException; }

private function isBasename($path)
{
return (false === strpos($path, $this->sep));
}
private function split($path)
{
$sp = $this->strpos($path, $this->sep);
$key = substr($path, 0, $sp);
$rest = trim(substr($path, $sp), $this->sep);
return array($key, $rest);
}
private function strpos($haystack, $needle)
{
$rv = strpos($haystack, $needle);
return (false === $rv) ? strlen($haystack) : $rv;
}
private $key, $data = array();
}

class pata_SingleSegmentTest extends Tence_TestCase
{
function testThrowsOnBaseName()
{
$this->willThrow('InvalidArgumentException');
new pata('foo');
}
}

abstract class pata_MultipleSegmentTest extends Tence_TestCase
{
abstract protected /* string */ function separator();
function setUp()
{
$this->garbage = 'garbage';
$this->key = 'foo';
$segments = array('bar', 'baz');
$sep = $this->separator();
$this->path = implode($sep, $segments);
$this->pata = new pata($this->key . $sep . $this->path, $sep);
}
function testIssetWithPathAsKeySucceeds()
{
return $this->assertTrue(isset($this->pata[$this->key]));
}
function testIssetWithWrongKeyFails()
{
return $this->assertFalse(isset($this->pata[$this->garbage]));
}
function testGetWithPathAsKey()
{
return $this->assertEquals($this->path, 
$this->strval($this->pata[$this->key]));
}
private function strval($v)
{
if (is_object($v)) {
return $v->__toString();
} else {
return strval($v);
}
}
}
class pata_WinTest extends pata_MultipleSegmentTest
{
function separator() { return '\\'; }
}
class pata_POSIXTest extends pata_MultipleSegmentTest
{
function separator() { return '/'; }
}
class pata_tests extends Tence_TestSuite
{
function __construct()
{
$this
->add(new pata_SingleSegmentTest)
->add(new pata_WinTest)
->add(new pata_POSIXTest)
;
}
}

?>

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



[PHP] Open pop-up stylish window

2007-02-06 Thread Chris Carter

Hi,

I am looking for a way to open a preview window. This should be a seperate
pop-up but within the same page. The moment the user clicks for say "more
details »" .. this should not open a next page or a pop-up window but a
dhtml transparent window that has the short discription. This window might
display onclick just below the "more details »" link.

Has anyone come across this ever. Please assist with a link or with your
advice. Sorry about posting on PHP-General though its HTML thing. 

Thanks,
-- 
View this message in context: 
http://www.nabble.com/Open-pop-up-stylish-window-tf3181638.html#a8829459
Sent from the PHP - General mailing list archive at Nabble.com.

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



[PHP] Re: Open pop-up stylish window

2007-02-06 Thread Colin Guthrie
Chris Carter wrote:
> Hi,
> 
> I am looking for a way to open a preview window. This should be a seperate
> pop-up but within the same page. The moment the user clicks for say "more
> details »" .. this should not open a next page or a pop-up window but a
> dhtml transparent window that has the short discription. This window might
> display onclick just below the "more details »" link.
> 
> Has anyone come across this ever. Please assist with a link or with your
> advice. Sorry about posting on PHP-General though its HTML thing. 

There are gazillions of examples found via the web. Just google for "css
popups" and I'm sure you'll fine a few of them in amoungst the porn,
spam, and warez. :p

Col.

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



Re: [PHP] All-in-one PHP Classes

2007-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-06 12:47:47 +0100:
> Have been reading posts daily for two months now on the list, and am very
> pleased at how informative these can be.
> I have noticed, many examples where one is pointed to using classes
> downloadable on the internet. 

> This is when i realized how often these classes that do "everything" are
> very BIG.

Big classes and long methods are signs of bad code, no matter if it's
downloadable for free or costs money.
 
> Here, it's the programmer who is confronted with loading huge files into
> memory to use just one perhaps two function in a 300+ functionality class..
 
what's a "300+ functionality class"?  One having more than 300 public
methods?  Where can I see it?  Such a beast could be legit (hard to tell
without knowing more), but it's probably a result of incompetence.

> Shouldn't these classes be perhaps broken down into usefull "parts".

Definitely.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] PHP book reviewers wanted

2007-02-06 Thread Stut

tedd wrote:
My point was, or at least my failed attempt was: 1) humor; 2) pointing 
out a proof reading error in a request for roof reading skills. I found 
that ironically humorous.


HumoUrous "roof reading skills" you've got there.


No disrespect was intended, it was just a jab between posters.


Indeed.

-Stut

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



Re: [PHP] file_get_contents

2007-02-06 Thread scotdiddle

Steven,

I asked this same question a week or so on the ZEND PHP Fourm

See the answer to my post for an elegant solution:

http://www.zend.com/forums/index.php?t=msg&th=2977&start=0&S=fe14095d33458d18b9bc49ea04a9a13b

Scot L. Diddle, Richmond VA





Quoting Steven Macintyre <[EMAIL PROTECTED]>:


Hiya,

I need to be able to read a file into a string - I have used the above
command and it works ... now ... I need to read a file into a string - that
requires a username and password to access the authentication is normal HTTP
basic realm

Any ideas?



Kind Regards


Steven Macintyre

--

www.friends4friends.co.za

--
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



Re: [PHP] Open pop-up stylish window

2007-02-06 Thread Jim Lucas

Chris Carter wrote:

Hi,

I am looking for a way to open a preview window. This should be a seperate
pop-up but within the same page. The moment the user clicks for say "more
details »" .. this should not open a next page or a pop-up window but a
dhtml transparent window that has the short discription. This window might
display onclick just below the "more details »" link.

Has anyone come across this ever. Please assist with a link or with your
advice. Sorry about posting on PHP-General though its HTML thing. 


Thanks,


This is what i found a few years ago.  Check it out

http://www.brainjar.com/dhtml/windows/

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

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



Re: [PHP] Open pop-up stylish window

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
> Chris Carter wrote:
> > Hi,
> > 
> > I am looking for a way to open a preview window. This should be a seperate
> > pop-up but within the same page. The moment the user clicks for say "more
> > details »" .. this should not open a next page or a pop-up window but a
> > dhtml transparent window that has the short discription. This window might
> > display onclick just below the "more details »" link.
> > 
> > Has anyone come across this ever. Please assist with a link or with your
> > advice. Sorry about posting on PHP-General though its HTML thing. 
> > 
> > Thanks,
> 
> This is what i found a few years ago.  Check it out
> 
> http://www.brainjar.com/dhtml/windows/

Junk! Doesn't work in Opera :/

:)

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] Converting string representation of a directory to multi-dimensional array

2007-02-06 Thread Matt Carlson
It will never receive a base name due to the way the data is structured before 
being passed into the function.

I appreciate everyone's input on this.  It's been tough for us to develop what 
we did (since it's such an odd case), and it's good to see other possible 
methods to do this in a better manor.

- Original Message 
From: Roman Neuhauser <[EMAIL PROTECTED]>
To: Jochem Maas <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Sent: Tuesday, February 6, 2007 9:03:35 AM
Subject: Re: [PHP] Converting string representation of a directory to 
multi-dimensional array

I had wanted to post something when the thread started, but gave up,
because I quickly ran into ambiguities.  What should the conversion do
when given a basename, e. g.  addToList("file.txt", ...)?





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



Re: [PHP] Writting a simple proxy in PHP

2007-02-06 Thread Alessandro Vernet


Jochem Maas wrote:
> 
> if your using apache then you should look at the ProxyPass directive -
> very hand,
> STW or STA for more detailed info.
> 

Jochem,

I went this route. I agree, it is much simpler than trying to hack this in
PHP.

Alex
-- 
View this message in context: 
http://www.nabble.com/Writting-a-simple-proxy-in-PHP-tf3178331.html#a8832985
Sent from the PHP - General mailing list archive at Nabble.com.

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



Re: [PHP] Open pop-up stylish window

2007-02-06 Thread Jim Lucas

Robert Cummings wrote:

On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:

Chris Carter wrote:

Hi,

I am looking for a way to open a preview window. This should be a seperate
pop-up but within the same page. The moment the user clicks for say "more
details »" .. this should not open a next page or a pop-up window but a
dhtml transparent window that has the short discription. This window might
display onclick just below the "more details »" link.

Has anyone come across this ever. Please assist with a link or with your
advice. Sorry about posting on PHP-General though its HTML thing. 


Thanks,

This is what i found a few years ago.  Check it out

http://www.brainjar.com/dhtml/windows/


Junk! Doesn't work in Opera :/

:)

Cheers,
Rob.


Was there a requirement given that it had to work in Opera.  No, he just 
asked if anybody had come across this feature.  Maybe it works in Opera, 
maybe it doesn't. I didn't see that as a requirement.  But then again, 
what about the people that use Lynx, how is he going to work that one? 
Oh, that wasn't a requirement either.


This is just one example of how it can be done.

That is what he asked for.

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

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



Re: [PHP] Open pop-up stylish window

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
> >> Chris Carter wrote:
> >>> Hi,
> >>>
> >>> I am looking for a way to open a preview window. This should be a seperate
> >>> pop-up but within the same page. The moment the user clicks for say "more
> >>> details »" .. this should not open a next page or a pop-up window but a
> >>> dhtml transparent window that has the short discription. This window might
> >>> display onclick just below the "more details »" link.
> >>>
> >>> Has anyone come across this ever. Please assist with a link or with your
> >>> advice. Sorry about posting on PHP-General though its HTML thing. 
> >>>
> >>> Thanks,
> >> This is what i found a few years ago.  Check it out
> >>
> >> http://www.brainjar.com/dhtml/windows/
> > 
> > Junk! Doesn't work in Opera :/
> > 
> > :)
> > 
> > Cheers,
> > Rob.
> 
> Was there a requirement given that it had to work in Opera.  No, he just 
> asked if anybody had come across this feature.  Maybe it works in Opera, 
> maybe it doesn't. I didn't see that as a requirement.  But then again, 
> what about the people that use Lynx, how is he going to work that one? 
> Oh, that wasn't a requirement either.
> 
> This is just one example of how it can be done.
> 
> That is what he asked for.

I dunno... works fine via wget :B

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] Open pop-up stylish window

2007-02-06 Thread Jim Lucas

Robert Cummings wrote:

On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:

Robert Cummings wrote:

On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:

Chris Carter wrote:

Hi,

I am looking for a way to open a preview window. This should be a seperate
pop-up but within the same page. The moment the user clicks for say "more
details »" .. this should not open a next page or a pop-up window but a
dhtml transparent window that has the short discription. This window might
display onclick just below the "more details »" link.

Has anyone come across this ever. Please assist with a link or with your
advice. Sorry about posting on PHP-General though its HTML thing. 


Thanks,

This is what i found a few years ago.  Check it out

http://www.brainjar.com/dhtml/windows/

Junk! Doesn't work in Opera :/

:)

Cheers,
Rob.
Was there a requirement given that it had to work in Opera.  No, he just 
asked if anybody had come across this feature.  Maybe it works in Opera, 
maybe it doesn't. I didn't see that as a requirement.  But then again, 
what about the people that use Lynx, how is he going to work that one? 
Oh, that wasn't a requirement either.


This is just one example of how it can be done.

That is what he asked for.


I dunno... works fine via wget :B

Cheers,
Rob.


I didn't know that you could view a popup in wget.  I'll have to try 
that.. :)


--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush



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



Re: [PHP] Open pop-up stylish window

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 13:16 -0800, Jim Lucas wrote:
> Robert Cummings wrote:
> > On Tue, 2007-02-06 at 13:05 -0800, Jim Lucas wrote:
> >> Robert Cummings wrote:
> >>> On Tue, 2007-02-06 at 10:09 -0800, Jim Lucas wrote:
>  Chris Carter wrote:
> > Hi,
> >
> > I am looking for a way to open a preview window. This should be a 
> > seperate
> > pop-up but within the same page. The moment the user clicks for say 
> > "more
> > details »" .. this should not open a next page or a pop-up window but a
> > dhtml transparent window that has the short discription. This window 
> > might
> > display onclick just below the "more details »" link.
> >
> > Has anyone come across this ever. Please assist with a link or with your
> > advice. Sorry about posting on PHP-General though its HTML thing. 
> >
> > Thanks,
>  This is what i found a few years ago.  Check it out
> 
>  http://www.brainjar.com/dhtml/windows/
> >>> Junk! Doesn't work in Opera :/
> >>>
> >>> :)
> >>>
> >>> Cheers,
> >>> Rob.
> >> Was there a requirement given that it had to work in Opera.  No, he just 
> >> asked if anybody had come across this feature.  Maybe it works in Opera, 
> >> maybe it doesn't. I didn't see that as a requirement.  But then again, 
> >> what about the people that use Lynx, how is he going to work that one? 
> >> Oh, that wasn't a requirement either.
> >>
> >> This is just one example of how it can be done.
> >>
> >> That is what he asked for.
> > 
> > I dunno... works fine via wget :B
> > 
> > Cheers,
> > Rob.
> 
> I didn't know that you could view a popup in wget.  I'll have to try 
> that.. :)

*grin* And I was only joking in the first response also ;)

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] Writting a simple proxy in PHP

2007-02-06 Thread Jochem Maas
Alessandro Vernet wrote:
> 
> Jochem Maas wrote:
>> if your using apache then you should look at the ProxyPass directive -
>> very hand,
>> STW or STA for more detailed info.
>>
> 
> Jochem,
> 
> I went this route. I agree, it is much simpler than trying to hack this in
> PHP.

it's rather a neat way of solving the 'how to run php4 & php5 module on the same
server' problem one often encounters,

I can't take any credit though - that belongs to Rasmus Lerdorf for pointing it 
out
(and possibly also due to his work on Apache itself - IIRC).

regardless, nice to know you solved your problem (or at least pushed back the 
urgency -
I guess that one day we'll all have to let go of php4 altogether :-).

> 
> Alex

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



Re: [PHP] PHP5 & Commercial Development

2007-02-06 Thread Keryx Web

Robert Cummings skrev:

I sincerely question the competence of someone who advocates a one size
fits all approach to programming. There are many reasons why a developer
may work with the old-school interface calls. For instance they may be
supporting an old school application. They might be writing their own
abstract layer. They might be optimizing an extremely loaded system
whereby explicitly using the API calls improves speed. Prepared
statements only improve speed when making multiple queries to the
database having the same format. They slow things down when making
unique queries. Any developer worth his salt doesn't need prepared
statements to improve security, and assuming prepared statements will
protect you is silly since they cannot protect against everything. A
professional knows when to use any given approach given the environment
and requirements.

Cheers,
Rob.


So I was perhaps a bit inflammatory in my post. But I do not see myself 
completely rebutted.


1. Maintaining legacy apps does not fall under the categories I was 
referring to. If you are bound by legacy constraints it is another ballgame.


2. In a short mail like this one there is not room to expand every 
minute detail. I do realise that PDO is not the best way to go for every 
app. But in saying that prepared statements is a really good way to 
protect against SQL-injection, I'm just echoing Ilia Alshanetsky 
(spelling?) and a few other rather renowned security experts. Of course 
one should always have a "defense in depth", though.


3. Speed loss from prepared statements are usually negligible even for a 
single query. There are tests published on the net. And if one wants 
speed, one should probably consider a caching layer between PHP and ones 
DBMS. The OO-model in PHP 5 would make such multi tiered apps simpler to 
develop as well.


The question PHP 4 or PHP 5: If you stay with 4 you are bound to a one 
size fits all solution. In PHP 5 you can use DB-specific drivers or PDO 
or a PHP-based abstraction layer. That's *more* choice, not less!


To summarize: With PDO or mysqli I can use both old school SQL and 
prepared statements, in PHP 4 there are fewer options! My case for PHP 5 
stands intact.


And finally: With each new release of PHP we can expect improvements in 
PDO, making it a more future safe alternative.



Lars Gunther

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



Re: [PHP] All-in-one PHP Classes

2007-02-06 Thread Chris

Roman Neuhauser wrote:

# [EMAIL PROTECTED] / 2007-02-06 12:47:47 +0100:

Have been reading posts daily for two months now on the list, and am very
pleased at how informative these can be.
I have noticed, many examples where one is pointed to using classes
downloadable on the internet. 



This is when i realized how often these classes that do "everything" are
very BIG.


Big classes and long methods are signs of bad code, no matter if it's
downloadable for free or costs money.


Pfft. Depends on the code.

A developer api is going to have long methods / functions, simply 
because of error checking.



Here, it's the programmer who is confronted with loading huge files into
memory to use just one perhaps two function in a 300+ functionality class..
 
what's a "300+ functionality class"?  One having more than 300 public

methods?  Where can I see it?  Such a beast could be legit (hard to tell
without knowing more), but it's probably a result of incompetence.


I'd have to agree with that being extremely bad. My biggest class has 
maybe 30.



Shouldn't these classes be perhaps broken down into usefull "parts".


Definitely.


Where possible, yes.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] PHP5 & Commercial Development

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 23:45 +0100, Keryx Web wrote:
>
> The question PHP 4 or PHP 5: If you stay with 4 you are bound to a one 
> size fits all solution. In PHP 5 you can use DB-specific drivers or PDO 
> or a PHP-based abstraction layer. That's *more* choice, not less!
> 
> To summarize: With PDO or mysqli I can use both old school SQL and 
> prepared statements, in PHP 4 there are fewer options! My case for PHP 5 
> stands intact.
> 
> And finally: With each new release of PHP we can expect improvements in 
> PDO, making it a more future safe alternative.

Could you point out to me where exactly the discussion became about PHP4
versus PHP5? I seem to be smelling the red herring technique of changing
the conversation focus so as to inappropriately lend credence to the
initial argument because the secondary red herring argument can be
argued more in your favour despite its irrelevance.

http://en.wikipedia.org/wiki/Red_herring

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] _GET('name') truncates

2007-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-05 18:09:21 -0600:
> GET args can be truncated at some number, if the server does not want
> to allow longer args.  I believe the minimum compliant limit is 1024
> bytes.

Since you asked for a reference in the other post: HTTP/1.1 tries to be
as general as possible, and doesn't impose limits on line lengths.  Some
commented quotes follow, I hope it's digestible.

# 3.2.1 General Syntax
# 
#URIs in HTTP can be represented in absolute form or relative to some
#known base URI [11], depending upon the context of their use. The two
#forms are differentiated by the fact that absolute URIs always begin
#with a scheme name followed by a colon. For definitive information on
#URL syntax and semantics, see "Uniform Resource Identifiers (URI):
#Generic Syntax and Semantics," RFC 2396 [42] (which replaces RFCs
#1738 [4] and RFC 1808 [11]). This specification adopts the
#definitions of "URI-reference", "absoluteURI", "relativeURI", "port",
#"host","abs_path", "rel_path", and "authority" from that
#specification.
 
RFC 2396 doesn't mention any length limits.

#The HTTP protocol does not place any a priori limit on the length of
#a URI. Servers MUST be able to handle the URI of any resource they
#serve, and SHOULD be able to handle URIs of unbounded length if they
#provide GET-based forms that could generate such URIs.

Case closed.  If there's no "a priori limit on the length of a URI",
then there isn't any limit on the length of the request line, the
Location response header, or the Content-Location entity header.

#   A server
#SHOULD return 414 (Request-URI Too Long) status if a URI is longer
#than the server can handle (see section 10.4.15).

"10.4.15 414 Request-URI Too Long" doesn't add anything interesting.

# 4 HTTP Message
# 
# 4.1 Message Types
# 
#HTTP messages consist of requests from client to server and responses
#from server to client.
# 
#HTTP-message   = Request | Response ; HTTP/1.1 messages
# 
#Request (section 5) and Response (section 6) messages use the generic
#message format of RFC 822 [9] for transferring entities (the payload
#of the message).

The keyword is "entities".  Applying the email-specific header length
limit to a HTTP implementation would IMO be a mistake.  For
completeness, RFC 822:

# 3.4.8.  FOLDING LONG HEADER FIELDS
#
#Each header field may be represented on exactly one line  con-
#sisting  of the name of the field and its body, and terminated
#by a CRLF; this is what the parser sees.  For readability, the
#field-body  portion of long header fields may be "folded" onto
#multiple lines of the actual field.  "Long" is commonly inter-
#preted  to  mean greater than 65 or 72 characters.  The former
#length serves as a limit, when the message is to be viewed  on
#most  simple terminals which use simple display software; how-
#ever, the limit is not imposed by this standard.

As you can see, the standard specifically disclaims a length limit.  The
998-character limit you mentioned (IIRC) in another post comes from
RFC 2822 (replaces 822), which imposes it for compatibility with legacy
systems which could not handle lines longer than 1000 characters
(RFC 2822, 2.1.1. Line Length Limits):

#The 998 character limit is due to limitations in many implementations
#which send, receive, or store Internet Message Format messages that
#simply cannot handle more than 998 characters on a line. Receiving
#implementations would do well to handle an arbitrarily large number
#of characters in a line for robustness sake.

This limitation doesn't apply to HTTP, that'd conflict with the unbound
URI statement in 3.2.1.

As for the server side: Status codes 413 and 414 are SHOULD, but any
server which silently truncates either the request URI or the request
entity has serious interoperability problems.

Summary

There are no limits on line length in HTTP, servers need to be able to
handle anything they need to work, and clients need to support headers
as long as they want to send.

HTTP/1.1 doesn't address URI or entity truncation in user agents
specifically, that's simply a bug, not a protocol violation.

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] All-in-one PHP Classes

2007-02-06 Thread Robert Cummings
On Wed, 2007-02-07 at 09:59 +1100, Chris wrote:
> Roman Neuhauser wrote:
> > # [EMAIL PROTECTED] / 2007-02-06 12:47:47 +0100:
> >> Have been reading posts daily for two months now on the list, and am very
> >> pleased at how informative these can be.
> >> I have noticed, many examples where one is pointed to using classes
> >> downloadable on the internet. 
> > 
> >> This is when i realized how often these classes that do "everything" are
> >> very BIG.
> > 
> > Big classes and long methods are signs of bad code, no matter if it's
> > downloadable for free or costs money.
> 
> Pfft. Depends on the code.
> 
> A developer api is going to have long methods / functions, simply 
> because of error checking.
> 
> >> Here, it's the programmer who is confronted with loading huge files into
> >> memory to use just one perhaps two function in a 300+ functionality class..
> >  
> > what's a "300+ functionality class"?  One having more than 300 public
> > methods?  Where can I see it?  Such a beast could be legit (hard to tell
> > without knowing more), but it's probably a result of incompetence.
> 
> I'd have to agree with that being extremely bad. My biggest class has 
> maybe 30.

I have a base class that most of my components extend that has 90
methods. It could go elsewhere or be broken up into smaller pieces, but
why bother, then I'd have to spend more cycles loading the individual
pieces... and quite frankly I'm too lazy to bother :) Most of them wrap
PHP functionality or do framework localization.

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] Apache asks to save php file?

2007-02-06 Thread Skip Evans

Hey all,

Just did a new install on FreeBSD 6.0 of Apache 2, 
PHP4 and MySQL, but the browser asks to save a PHP 
file rather than execute it. I do have the 
following in httpd.conf, however.


LoadModule php4_module libexec/apache2/libphp4.so

DirectoryIndex index.php index.html index.htm 
index.html.var


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Now I'm wondering if somehow PHP4 got compiled 
without the Apache module selected?


Does that sound accurate? I did check it off when 
the compile began however.

--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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



Re: [PHP] Apache asks to save php file?

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 16:15 -0700, Skip Evans wrote:
> Hey all,
> 
> Just did a new install on FreeBSD 6.0 of Apache 2, 
> PHP4 and MySQL, but the browser asks to save a PHP 
> file rather than execute it. I do have the 
> following in httpd.conf, however.
> 
> LoadModule php4_module libexec/apache2/libphp4.so
> 
> DirectoryIndex index.php index.html index.htm 
> index.html.var
> 
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
> 
> Now I'm wondering if somehow PHP4 got compiled 
> without the Apache module selected?
> 
> Does that sound accurate? I did check it off when 
> the compile began however.

Anything in your apache logs? Did you restart the webserver? Did you
compile yourself?

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] Apache asks to save php file?

2007-02-06 Thread Skip Evans
Nothing in the log file. Did restart the web 
server, and yes, I'm compiling this myself.


The log file is actually not being touched. I 
think it failed to compile the apache module on 
the last attempt (it stopped before because I was 
not subscribed to a paypal module I tried to 
include), so I need to somehow get back to where 
it will ask me to compile the Apache module, but 
doing


make deinstall clean

does not do it.

Skip

Robert Cummings wrote:

On Tue, 2007-02-06 at 16:15 -0700, Skip Evans wrote:

Hey all,

Just did a new install on FreeBSD 6.0 of Apache 2, 
PHP4 and MySQL, but the browser asks to save a PHP 
file rather than execute it. I do have the 
following in httpd.conf, however.


LoadModule php4_module libexec/apache2/libphp4.so

DirectoryIndex index.php index.html index.htm 
index.html.var


AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Now I'm wondering if somehow PHP4 got compiled 
without the Apache module selected?


Does that sound accurate? I did check it off when 
the compile began however.


Anything in your apache logs? Did you restart the webserver? Did you
compile yourself?

Cheers,
Rob.


--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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



Re: [PHP] Apache asks to save php file?

2007-02-06 Thread Chris

Skip Evans wrote:

Hey all,

Just did a new install on FreeBSD 6.0 of Apache 2, PHP4 and MySQL, but 
the browser asks to save a PHP file rather than execute it. I do have 
the following in httpd.conf, however.


LoadModule php4_module libexec/apache2/libphp4.so


Is that the right path to the file? Does that file exist? What 
permissions are on it?


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Apache asks to save php file?

2007-02-06 Thread Greg Maruszeczka
On Tue, 06 Feb 2007 16:42:03 -0700
Skip Evans <[EMAIL PROTECTED]> wrote:

> Nothing in the log file. Did restart the web 
> server, and yes, I'm compiling this myself.
> 
> The log file is actually not being touched. I 
> think it failed to compile the apache module on 
> the last attempt (it stopped before because I was 
> not subscribed to a paypal module I tried to 
> include), so I need to somehow get back to where 
> it will ask me to compile the Apache module, but 
> doing
> 
> make deinstall clean
> 
> does not do it.


delete /var/db/ports/php*/options and 'make install clean' again.

HTH,
G

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



Re: [PHP] Apache asks to save php file?

2007-02-06 Thread Robert Cummings
On Tue, 2007-02-06 at 15:59 -0800, Greg Maruszeczka wrote:
> On Tue, 06 Feb 2007 16:42:03 -0700
> Skip Evans <[EMAIL PROTECTED]> wrote:
> 
> > Nothing in the log file. Did restart the web 
> > server, and yes, I'm compiling this myself.
> > 
> > The log file is actually not being touched. I 
> > think it failed to compile the apache module on 
> > the last attempt (it stopped before because I was 
> > not subscribed to a paypal module I tried to 
> > include), so I need to somehow get back to where 
> > it will ask me to compile the Apache module, but 
> > doing
> > 
> > make deinstall clean
> > 
> > does not do it.
> 
> 
> delete /var/db/ports/php*/options and 'make install clean' again.

I always cleanup with:

shell> rm config.cache
shell> make clean

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] Apache asks to save php file?

2007-02-06 Thread Skip Evans
Yes, the file name and path are correct. Apache 
will give an error upon restart if they are not.


Chris wrote:

Skip Evans wrote:

Hey all,

Just did a new install on FreeBSD 6.0 of Apache 2, PHP4 and MySQL, but 
the browser asks to save a PHP file rather than execute it. I do have 
the following in httpd.conf, however.


LoadModule php4_module libexec/apache2/libphp4.so


Is that the right path to the file? Does that file exist? What 
permissions are on it?




--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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



RE: [PHP] PHP5 & Commercial Development

2007-02-06 Thread Ligaya A. Turmelle
Law of mass tonnage - better to be in the big motorized vehicle then the
little one when *crunch* happens.

Respectfully,
Ligaya Turmelle
Systems Analyst
Guamcell Communications
Phone: (671)689-2377 
-Original Message-
From: Stut [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 06, 2007 2:55 AM
To: tedd
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP5 & Commercial Development

tedd wrote:
> At 12:06 AM -0500 2/5/07, Craige Leeder wrote:
>> PHP is fine for commercial environments. Many people are just afraid 
>> of it due to the fact it is known to break some poorly written PHP 4 
>> scripts, and the fact that many people don't think it's new features 
>> are "necessary". It is perfectly fine to use it in a commercial 
>> environment however.
> 
> I feel the same way about cars. There are some terrible drivers out 
> there, so we should all take the bus.

Won't work. There are some *really* terrible bus drivers out there.

-Stut

--
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



Re: [PHP] Apache asks to save php file?

2007-02-06 Thread Skip Evans

Even do the deinstall I get this:

===>  Checking if misc/php4-calendar already installed
===>   php4-calendar-4.4.4_1 is already installed
  You may wish to ``make deinstall'' and 
install this port again

  by ``make reinstall'' to upgrade it properly.
  If you really wish to overwrite the old 
port of misc/php4-calendar
  without deleting it first, set the variable 
"FORCE_PKG_REGISTER"
  in your environment or the "make install" 
command line.

*** Error code 1


Agggh

How do I clean up the hold install completely?

Skip

Robert Cummings wrote:

On Tue, 2007-02-06 at 15:59 -0800, Greg Maruszeczka wrote:

On Tue, 06 Feb 2007 16:42:03 -0700
Skip Evans <[EMAIL PROTECTED]> wrote:

Nothing in the log file. Did restart the web 
server, and yes, I'm compiling this myself.


The log file is actually not being touched. I 
think it failed to compile the apache module on 
the last attempt (it stopped before because I was 
not subscribed to a paypal module I tried to 
include), so I need to somehow get back to where 
it will ask me to compile the Apache module, but 
doing


make deinstall clean

does not do it.


delete /var/db/ports/php*/options and 'make install clean' again.


I always cleanup with:

shell> rm config.cache
shell> make clean

Cheers,
Rob.


--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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



[PHP] preg_match

2007-02-06 Thread James Lockie
I am trying to use this code to display a button at the root but it 
always displays the button. :-(


   if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button


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



Re: [PHP] preg_match

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 7:46 pm, James Lockie wrote:
> I am trying to use this code to display a button at the root but it
> always displays the button. :-(
>
> if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {

Without any "modifier", $ matches the END of the string.

It is impossible to have the end of the string followed by more stuff.

You maybe meant to add 'm' and or 's' after the ending '/', which
would indicate that you are looking for a newline followed by
'\/index.php' but I doubt that that is what you want either...

I don't think you want the $ in there at all...

Or maybe you want it right before the final '/' to make sure the URL
has nothing else after the 'index.php' part.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



Re: [PHP] preg_match

2007-02-06 Thread Myron Turner

James Lockie wrote:
I am trying to use this code to display a button at the root but it 
always displays the button. :-(


   if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button



You got the end-of-string character ($) in the wrong place:
if (! (preg_match( "/\/index.php$/", $_SERVER['PHP_SELF'] ))) {


--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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



Re: [PHP] preg_match

2007-02-06 Thread James Lockie

Myron Turner wrote:

James Lockie wrote:
I am trying to use this code to display a button at the root but it 
always displays the button. :-(


   if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button



You got the end-of-string character ($) in the wrong place:
if (! (preg_match( "/\/index.php$/", $_SERVER['PHP_SELF'] ))) {



Richard Lynch wrote:

On Tue, February 6, 2007 7:46 pm, James Lockie wrote:
  

I am trying to use this code to display a button at the root but it
always displays the button. :-(

if (! (preg_match( "/$\/index.php/", $_SERVER['PHP_SELF'] ))) {



Without any "modifier", $ matches the END of the string.

I wanted this. :-(
Thanks.

if (! (preg_match( "/^\/index.php/", $_SERVER['PHP_SELF'] ))) {
# display a button

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



Re: [PHP] _GET('name') truncates

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 4:01 pm, Roman Neuhauser wrote:
> # [EMAIL PROTECTED] / 2007-02-05 18:09:21 -0600:
>> GET args can be truncated at some number, if the server does not
>> want
>> to allow longer args.  I believe the minimum compliant limit is 1024
>> bytes.

I may well have been remembering HTTP/1.0 or even 0.9 or lower specs. 
Circa 1995, I suppose...

Sorry.

That said, I cannot find the exact section I was thinking of from any
HTTP spec online, where HTTP implementations were enouraged to make
the GET/POST limits as high as practical, but they could not be lower
than 1024? for GET and 4096? for POST to be compliant.  Maybe I'm even
remembering some ephemeral draft or something...

I did find this fairly quickly:

http://classicasp.aspfaq.com/forms/what-is-the-limit-on-querystring/get/url-parameters.html

So even if the server doesn't limit the URL length, SGML, a superset
of HTML, does limit it in the actual HREF, according to that one.

Utlimately, the specs aren't really all that relevant, since the
original poster probably is hitting a limit, whether it's a compliant
server or not.

I'd love every server to be in spec, but that's not quite the real
world we live in, unfortunately.

The document you referenced recommends not exceeding 255 characters,
for that very reason -- broken proxy servers.

Some day I'll find the dang document I'm always remembering when this
issue crops up...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



Re: [PHP] All-in-one PHP Classes

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 5:47 am, Tim wrote:
> Shouldn't these classes be perhaps broken down into usefull "parts".

Many of them started life as very small classes, and then the Feature
Requests started pouring in and...

Do feel free to take a class and delete all the bits you're not using,
if you can figure that out.

Or just take the bits you need and make a new class, or just use the
one function you need as an actual function or...

I have many many times found a bloated class with tons of Security
issues that make it unusable (for me) but it has the kernel of truth
buried in it that I was looking for...  Then I start typing. :-)

Only experience will be able to tell you when to do which, however.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



Re: [PHP] Graphs

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 5:42 am, Kristian Erendi wrote:
> I wish to draw graphs on a web page.
> Can someone tell me which extension or package I should use?
> Any examples?

The answer is the same as it was yesterday.

GD
JPGraph

Okay, somebody posted a third one I forgot already.

Did you even try to find an answer first?...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



Re: [PHP] Re: file_get_contents

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 7:53 am, Colin Guthrie wrote:
> Steven Macintyre wrote:
>> Hiya,
>>
>> I need to be able to read a file into a string - I have used the
>> above
>> command and it works ... now ... I need to read a file into a string
>> - that
>> requires a username and password to access the authentication is
>> normal HTTP
>> basic realm
>>
>> Any ideas?
>
> $var =
> file_get_contents('http://username:[EMAIL 
> PROTECTED]/path/to/secret/file.txt');
>
> This is standard web syntax - e.g. it will work in a web browser,
> wget,
> curl, etc.

Actually, IE is dropping (has dropped?) support for the
username:password part because their users are too dumb to chop out
their password before posting their URL or something...

I found this in some KB article somewhere, I think...

They didn't actually express it as user stupidity, mind you. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



Re: [PHP] PHP book reviewers wanted

2007-02-06 Thread Richard Lynch
On Tue, February 6, 2007 12:04 am, Manuel Lemos wrote:
> Hello,
>
> on 02/06/2007 12:39 AM Richard Lynch said the following:
 Demonstrating good English writing skills and having published
 good
 book
 reviews in the past gets me preference.
>>> "gets me preference" ???
>>>
>>> Me get any money for this?
>>
>> Hey, go easy on the non-native speakers...
>>
>> I'm betting your Spanish is worse than his English...
>
> Thanks for helping to clarify the "native speakers". Just a minor
> correction. My Spanish is not better than my English. I am a native
> Portuguese speaker. ;-)
>
> Portuguese is also a latin based language like
> Spanish,
> French, Italian and Romanian, but it is a distinct
> idiom.

Dang I'm felling stoopid.

I even have all the facts in my brain to have not made that mistake,
had I matched up column M with row P...

Sorry.


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving 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



[PHP] Opera advice needed!

2007-02-06 Thread William Stokes
Hello,

I just noticed when I published a new menu system that it does NOT work in 
the ISP hosted server. However it works ok on my test server. Here's the 
test I have done all in same client machine (=unchanged browser settings):

My test server:
IE6 & 7->OK
Opera 9.02 -> OK
Firefox ->OK

ISP server:
IE6 & 7->OK
Opera 9.02 -> DOES NOT WORK!
Firefox ->OK

The system relies on JS also I can see from the browser source code that all 
PHP has printed out all JS like it should but the menu is not printed to 
browser. Could you give me some pointers how to troubleshoot this? It must 
be something server related but not folder or file rights according to my 
testing.

Thanks
-Will

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



[PHP] PHP4 extensions not loading

2007-02-06 Thread Skip Evans

Hey all,

I installed a new server with PHP5, but then had to 
revert to PHP4 (attempted anyway) on a FreeBSD 6.0 
install. I have PHP4 compiled, both the main BSD 
port of lang/php4 and all of the extensions 
individually.


However, the extensions, including basic ones like 
MySQL are not getting loaded.


I have an identical server that is working fine that 
was built some time ago, and the only difference I 
can see is that the working server as options file 
listed in


/var/db/ports/php4-extensions

The server that is not working had a smaller file in

/var/db/ports/php4

That did not list the additional extensions I 
compiled individually.


The output of phpinfo() can be seen on each server at

bigskypenguin.com/info.php (working)
venomouspenguin.com/info.php (not working)

You can see that the venomouspenguin.com server the 
extensions are not showing up, but I am certain they 
are compiled and installed, because the make (s) 
tell me so.


What I need to do is get Apache looking at a

/var/db/ports/php4-extensions

directory, which I did create with the options file 
listing all the extensions I built individually.


Can someone tell me how this can be done? How I can 
tell Apache to load the extensions in that directory?


It is way too late, I am way too exhausted and going 
to bed.


Thanks so much for any help. I've been tracking this 
down a bit chunk of the day and my brain is now 
total guacamole.



--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240

=-=-=-=-=-=-=-=-=-=-=

Check out PHPenguin, a lightweight and versatile 
PHP/MySQL development framework.


http://phpenguin.bigskypenguin.com

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



Re: [PHP] PHP4 extensions not loading

2007-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-07 00:00:57 -0700:
> What I need to do is get Apache looking at a
> 
> /var/db/ports/php4-extensions
> 
> directory, which I did create with the options file 
> listing all the extensions I built individually.
> 
> Can someone tell me how this can be done? How I can 
> tell Apache to load the extensions in that directory?

/var/db/ports is a cache directory for the FreeBSD port system
configuration, Apache itself doesn't use is in any way.

Anyway, OT for this list, please use [EMAIL PROTECTED]

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



Re: [PHP] Opera advice needed!

2007-02-06 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-07 08:32:47 +0200:
> Hello,
> 
> I just noticed when I published a new menu system that it does NOT work in 
> the ISP hosted server. However it works ok on my test server. Here's the 
> test I have done all in same client machine (=unchanged browser settings):
> 
> My test server:
> IE6 & 7->OK
> Opera 9.02 -> OK
> Firefox ->OK
> 
> ISP server:
> IE6 & 7->OK
> Opera 9.02 -> DOES NOT WORK!
> Firefox ->OK
> 
> The system relies on JS also I can see from the browser source code that all 
> PHP has printed out all JS like it should but the menu is not printed to 
> browser. Could you give me some pointers how to troubleshoot this? It must 
> be something server related but not folder or file rights according to my 
> testing.

Might be a content-type issue.  http://www.wireshark.org/

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

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



[PHP] base64-encoding in cookies?

2007-02-06 Thread Fletcher Mattox
Hi,

A campus web server (not under my control) returns an authentication
string in a cookie named AUTH.  The cookie's value is an encrypted,
base64 encoded string.  Unfortunately, when I examine $_COOKIE['AUTH'],
it is clear that all of the '+' characters have been replaced with a ' ' 
character in the base64 string.  Why is this?  Obviously, this corrupts
the data and makes it impossible to base64-decode the string correctly.
I believe this is a php issue and not, say, an apache issue because a
perl program can correctly authenticate the same cookie based on perl's
$ENV{'HTTP_COOKIE'}.  i.e., the perl cookie contains the original '+'.
Does anyone know how to make php (v5.1.5) do the right thing with base64
encoded cookies?

Thanks
Fletcher

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