OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 24 Jan 2007 12:53:56 -0000 Issue 4587

php-general-digest-helplists.php.net
Date: Wed Jan 24 2007 - 06:53:56 CST


php-general Digest 24 Jan 2007 12:53:56 -0000 Issue 4587

Topics (messages 247653 through 247693):

Re: To many connections error message
        247653 by: Chris
        247655 by: Pintér Tibor

Re: php installation problem
        247654 by: Chris

Re: having trouble with is_file() and is_dir() on 5.1.2
        247656 by: jekillen
        247666 by: Richard Lynch

Re: preg_match problem
        247657 by: Beauford

Splitting long text
        247658 by: Skip Evans
        247660 by: Paul Novitski
        247661 by: Jay Blanchard
        247663 by: Anas Mughal
        247678 by: Travis Doherty
        247683 by: Paul Novitski

Re: OT - Leaving
        247659 by: Chris Shiflett
        247662 by: Ligaya A. Turmelle
        247687 by: Ryan A
        247688 by: Ryan A
        247690 by: Jochem Maas

How to make Browse Folder Dialog
        247664 by: Aslam Bari
        247676 by: Travis Doherty
        247677 by: Børge Holen
        247679 by: Travis Doherty
        247680 by: Aslam Bari
        247682 by: Travis Doherty

Re: creating an api-which protocol do you use?
        247665 by: Richard Lynch

Re: using return in include files
        247667 by: Richard Lynch

Re: JPEG info needed
        247668 by: Richard Lynch

Re: exec('make') Q
        247669 by: Richard Lynch

Re: [HELP] Fatal error when uploading large files!
        247670 by: Richard Lynch

Re: smsSend
        247671 by: Richard Lynch

Re: most powerful php editor
        247672 by: Richard Lynch
        247686 by: Robin Vickery
        247689 by: Robert Cummings
        247691 by: Sancar Saran
        247692 by: Roman Neuhauser
        247693 by: Robert Cummings

Re: having trouble with is_file() and is_dir() on 5.1.2; solved
        247673 by: jekillen

Re: where match question
        247674 by: Don
        247675 by: Chris
        247681 by: Don
        247685 by: Németh Zoltán

Re: Encoding issue with £
        247684 by: Frank Arensmeier

Administrivia:

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

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

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

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

attached mail follows:


Pintér Tibor wrote:
> , or ask your hoster to disable display_errors

That can be done in the script ;)

ini_set('display_errors', false);

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

attached mail follows:


Chris írta:
> Pintér Tibor wrote:
>> , or ask your hoster to disable display_errors
>
> That can be done in the script ;)
>
> ini_set('display_errors', false);
>
Sure it can, but its a lame host that enables displaying of errors by
default, thats why I advised to ask them to disable it globally :)

btw: Although display_errors may be set at runtime (with *ini_set()*
<http://hu.php.net/manual/hu/function.ini-set.php>), it won't have any
affect if the script has fatal errors. This is because the desired
runtime action does not get executed.

t

attached mail follows:


Ross wrote:
> Just installed apache and am looking at an error
>
> Warning: session_start() [function.session-start]:
> open(C:\DOCUME~1\Ross\LOCALS~1\Temp\php\upload\sess_ob822kp9sqlndjvu089r845e50,
> O_RDWR) failed: No such file or directory (2) in
> C:\Apache\Apache2\htdocs\ssn\editor.php on line 4
>
> Should I set up a local folder to save the session data or something. Do I
> set this up in the php.ini or apache config?

Well it's trying to save here:

C:\DOCUME~1\Ross\LOCALS~1\Temp\php\upload\

You can either create the path, make sure it has appropriate permissions.

Or tell php where to save the session and create that folder (and check
permissions). See
http://www.php.net/manual/en/function.session-save-path.php

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

attached mail follows:


On Jan 22, 2007, at 11:18 PM, clive wrote:

>
>> everything without an extension is a directory
>> You will notice that the only directory detected
>> by this code is templates. There are no files
>> detected by this code. Does this have something
>> to do with stat cache? I want to make one array
>> with directories and one array with files. I can't
>> see any syntax or logic problems.
>> Thanks in advance;
>> JK
>
> As far as I know is_dir and is_file require a full path , as chris
> mentioned, how are you populating $cont;
>
> clive
>

Thanks all for the replies, I think I got the message.
Some times getting better at things can be a pain.
I code and code and code and get use to writing
code like the above and have it just work. Then I
use a function I've never used before, is_file()
and is_dir() and surprise... I have gotten past dumb
syntax errors and screwy logic, it must be the os
or something(?!).
JK

attached mail follows:


On Tue, January 23, 2007 12:03 am, jekillen wrote:
> Hello php developers:
> I am having a problem with the following code:
> OS: FreeBSD v6.0
> Apache 1.3.34
> php 5.1.2
> -> $cont is an array produced from opening and reading a
> directory:
> for($i = 0; $i < count($cont); $i++)
> {
> print $cont[$i].'<br>';
> if(is_file($cont[$i]))
> {
> print "is file: ".$cont[$i].'<br>';
> //array_push($files, $cont[$i]);
> }
> else if(is_dir($cont[$i]))
> {
> print "is dir: ".$cont[$i]."<br>";
> //array_push($dirs, $cont[$i]);
> }
> }
>
> The print statements produce the following:
>
> collections
> groups
> in
> index.php
> lists.php
> new_multi.php
> new_single.php
> out
> pref_code
> pref_funct.php
> process.php
> requests
> rlists
> routing.php
> send.php
> steps.php
> store
> templates
>
> is dir: templates <- only directory recognized (extra line breaks
> added here for readability)
>
> usr_config.php
> usr_pref.php
>
> everything without an extension is a directory
> You will notice that the only directory detected
> by this code is templates. There are no files
> detected by this code. Does this have something
> to do with stat cache? I want to make one array
> with directories and one array with files. I can't
> see any syntax or logic problems.
> Thanks in advance;

is_file and is_dir are checking in the same dir as your PHP script,
not the one you opened.

So you are detecting that your PHP dir *also* happens to have a
directory named "templates" which is a mere coincidence to the fact
that the directory you opened had a directory named "templates"

Use a FULL PATH when you are messing with files/dirs if at all
possible, and your life will be much simpler.

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

attached mail follows:


> You don't need to escape the apostrophe if the pattern isn't
> quoted with apostrophes in PHP or delimited by apostrophes in
> the PREG pattern. But generally there's no harm in escaping
> characters unnecessarily; it just makes for messier code.
>
> Here is a simple test of the regexp I recommended yesterday
> using the pattern:
> "/^[A-Za-z0-9!#$%&()*;:_.'\/\\\\ ]+$/"

Ok, after a lot of testing and seriously losing it, this is what appears to
be the issue. Blank lines or \n or some kind of carriage return is not
allowed. The first example works, the others don't. I tried adding a
carriage return, but who knows, I may be way out on left field with this.
It's insane.

sdfasd:spacespacespace
http://fsdgas.asfs.asfs/ dfgfasg

-------

sdfasd:spacespacespace

http://fsdgas.asfs.asfs/ dfgfasg

-------

Abcdefg

abcfder#$

If there is another solution to doing this, I would definitely prefer it.
This is just way to buggy, and I ran out of patience a week ago. This is on
a production site, and is the only reason I have tried to get it working.

attached mail follows:


Hey all,

I have a requirement to take a large amount of
text, a story submitted to a competition, and
split into displayable chunks of 600 words each.

I'd like some feedback on the best way to this.

Thanks!
Skip

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

attached mail follows:


At 1/23/2007 05:52 PM, Skip Evans wrote:
>I have a requirement to take a large amount of text, a story
>submitted to a competition, and split into displayable chunks of 600
>words each.

You can explode a text into an array of words, slice off a
600-element array, and implode the result back into text.

http://php.net/explode
http://php.net/implode
http://php.net/array-slice

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com

attached mail follows:


[snip]
I have a requirement to take a large amount of
text, a story submitted to a competition, and
split into displayable chunks of 600 words each.

I'd like some feedback on the best way to this.
[/snip]

There are many ways to skin this cat Skip but you can start with the
basics of using explode() and implode(). For instance, count all of the
words;

function countwords($str) {
   return count(array_filter(explode(' ', $str)));
}

// Example Usage:
$test = "This has four words.";
echo "There are " . countwords($test) . " words in that '$test'";

Check out the usage of array_filter(), it will get rid of multiple
spaces between words. You will have to do more to filter out new lines
between paragraphs, but this should get you started.

Since explode is an array you can then implode 600 word chunks of text.

http://www.php.net/explode
http://www.php.net/implode
http://www.php.net/array_filter

attached mail follows:


I have been using the below function successfully. Hope it works for you.
-- Anas

// textwrap 1.1 Brian Moon <brianphorum.org>
// This code is part of the Phorum project <http://phorum.org>
// $String The string to be wrapped.
// $breaksAt How many characters each line should be.
// $breakStr What character should be used to cause a break.
// $padStr Allows for the wrapped lines to be padded at the begining.

function textwrap ($String, $breaksAt = 78, $breakStr = "\n", $padStr="")
{
    $newString="";
    $lines=explode($breakStr, $String);
    $cnt=count($lines);
    for($x=0;$x<$cnt;$x++){
        if(strlen($lines[$x])>$breaksAt){
            $str=$lines[$x];
            while(strlen($str)>$breaksAt){
                $pos=strrpos(chop(substr($str, 0, $breaksAt)), " ");
                if ($pos == false) {
                    break;
                }
                $newString.=$padStr.substr($str, 0, $pos).$breakStr;
                $str=trim(substr($str, $pos));
            }
            $newString.=$padStr.$str.$breakStr;
        }
        else{
            $newString.=$padStr.$lines[$x].$breakStr;
        }
    }
    return $newString;

} // end textwrap()

On 1/23/07, Skip Evans <skipbigskypenguin.com> wrote:
>
> Hey all,
>
> I have a requirement to take a large amount of
> text, a story submitted to a competition, and
> split into displayable chunks of 600 words each.
>
> I'd like some feedback on the best way to this.
>
> Thanks!
> Skip
>
> --
> 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
>
>

--
Anas Mughal

attached mail follows:


Anas Mughal wrote:

> I have been using the below function successfully. Hope it works for you.
> -- Anas
>
>
>
> // textwrap 1.1 Brian Moon <brianphorum.org>
> // This code is part of the Phorum project <http://phorum.org>
> // $String The string to be wrapped.
> // $breaksAt How many characters each line should be.
> // $breakStr What character should be used to cause a break.
> // $padStr Allows for the wrapped lines to be padded at the begining.

Short of string padStr in that function, and bool cut in the native PHP
one, I don't see why someone wouldn't just use http://php.net/wordwrap/ .

Travis Doherty

attached mail follows:


At 1/23/2007 05:52 PM, Skip Evans wrote:
>I have a requirement to take a large amount of text, a story
>submitted to a competition, and split into displayable chunks of 600
>words each.

At 1/23/2007 07:20 PM, Anas Mughal wrote:
>// textwrap 1.1 Brian Moon <brianphorum.org>
>// This code is part of the Phorum project <http://phorum.org>
>// $String The string to be wrapped.
>// $breaksAt How many characters each line should be.
>// $breakStr What character should be used to cause a break.

At 1/23/2007 10:40 PM, Travis Doherty wrote:
>Short of string padStr in that function, and bool cut in the native PHP
>one, I don't see why someone wouldn't just use http://php.net/wordwrap/ .

Ouch! Inserting hard carriage returns into the markup can only work
when a) the font size is fixed (which we know better than to attempt)
or b) the column width enlarges with the font size in a completely
zoomable page.

If the number of characters per line is allowed to change, as happens
when font size changes in a fixed column width, hard carriage returns
will break the wrap.

Far better to let the browser handle word-wrap.

Regards,

Paul
__________________________

Juniper Webcraft Ltd.
http://juniperwebcraft.com

attached mail follows:


John Nichel wrote:
> I'm just popping in now to let y'all know that I'm off to join
> people like John and Jason in the world of, "what ever happened
> to him".

Thanks for your contributions over the years, John.

Chris

--
Chris Shiflett
http://shiflett.org/

attached mail follows:


So many old faces leaving... Feels odd

Respectfully,
Ligaya Turmelle
Systems Analyst
Guamcell Communications
Phone: (671)689-2377
-----Original Message-----
From: John Nichel [mailto:johnkegworks.com]
Sent: Wednesday, January 24, 2007 5:45 AM
To: PHP Mailing Lists
Subject: [PHP] OT - Leaving

Howdy ladies and gents:

   For the past 9 or so years, with one email account or another, I have been subscribed to the PHP General Mailing List. Well, life an work have succeeded in taking up all of my time, and the only thing I've been able to do with this list over the past year or so is select all the unread messages in my php folder, and hit the delete key. If I've posted 10 messages over the past year, I'd be surprised (probably why you n00bs are saying to yourself, "who the hell is this guy"). I'm just popping in now to let y'all know that I'm off to join people like John and Jason in the world of, "what ever happened to him". For those of you who give a damn ;) I can be reached at numerous email addresses,
including:

john <at> nichel <dot> net
jnichel <at> by-tor <dot> com

As well as the other in this email (which have already been harvested by a billion spam bots).

Have fun, and I'll see ya on the other side.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnicheldotcomholdingsofbuffalo.com

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

attached mail follows:


Who the f*/k are you? and why should we remember you????

Hehe just kidding, you may have not posted a lot in the last year but you have helped me many times before that....which I really appreciate.

Thanks for your help mate, and I hope you have success in whatever you decide to do.

Cheers!
R

John Nichel <johnkegworks.com> wrote: Howdy ladies and gents:

   For the past 9 or so years, with one email account or another, I have
been subscribed to the PHP General Mailing List. Well, life an work
have succeeded in taking up all of my time, and the only thing I've been
able to do with this list over the past year or so is select all the
unread messages in my php folder, and hit the delete key. If I've
posted 10 messages over the past year, I'd be surprised (probably why
you n00bs are saying to yourself, "who the hell is this guy"). I'm just
popping in now to let y'all know that I'm off to join people like John
and Jason in the world of, "what ever happened to him". For those of
you who give a damn ;) I can be reached at numerous email addresses,
including:

john nichel net
jnichel by-tor com

As well as the other in this email (which have already been harvested by
a billion spam bots).

Have fun, and I'll see ya on the other side.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
jnicheldotcomholdingsofbuffalo.com

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

------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 
---------------------------------
8:00? 8:25? 8:40? Find a flick in no time
 with theYahoo! Search movie showtime shortcut.

attached mail follows:


FYI, for the noobs, the John and Jason referenced in the email are John
Holmes and Jason Wong.

Yep, two of the "big" guys without who... many would have taken a muchh longer path to learning php, including me.

I dont know if theres a "list heroes" list, but if there is... John is def mine.
Although if you put "John Holmes" into google... you'll see a lot of other work he has done on film a long time ago :))

Cheers!
R

------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
 
---------------------------------
Don't be flakey. Get Yahoo! Mail for Mobile and
always stay connected to friends.

attached mail follows:


with all the respect that should be afforded to someone
so bloody helpful:

        thank you for all the fish :-)

best wishes,
Jochem

John Nichel wrote:
> Howdy ladies and gents:
>
> For the past 9 or so years, with one email account or another, I have
> been subscribed to the PHP General Mailing List. Well, life an work
> have succeeded in taking up all of my time, and the only thing I've been
> able to do with this list over the past year or so is select all the
> unread messages in my php folder, and hit the delete key. If I've
> posted 10 messages over the past year, I'd be surprised (probably why
> you n00bs are saying to yourself, "who the hell is this guy"). I'm just
> popping in now to let y'all know that I'm off to join people like John
> and Jason in the world of, "what ever happened to him". For those of
> you who give a damn ;) I can be reached at numerous email addresses,
> including:
>
> john <at> nichel <dot> net
> jnichel <at> by-tor <dot> com
>
> As well as the other in this email (which have already been harvested by
> a billion spam bots).
>
> Have fun, and I'll see ya on the other side.
>

attached mail follows:


Dear All,
I m new in this Forum. I m making a project in which i need to show user a
Browse Folder Dialog Box, In which he can select a folder and after this i
will do some manipulation on that folder's content. So the problem is that i
could not found any sample on Web , how to show "Folder Dialog" in any way
(HTML, JavaScript, PHP etc). Plz has anybody some idea how to do some work
around this.

Thanks...
--
View this message in context: http://www.nabble.com/How-to-make-Browse-Folder-Dialog-tf3079100.html#a8554729
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


Aslam Bari wrote:

>Dear All,
>I m new in this Forum. I m making a project in which i need to show user a
>Browse Folder Dialog Box, In which he can select a folder and after this i
>will do some manipulation on that folder's content. So the problem is that i
>could not found any sample on Web , how to show "Folder Dialog" in any way
>(HTML, JavaScript, PHP etc). Plz has anybody some idea how to do some work
>around this.
>
>Thanks...
>
>
PHP won't let you edit files on your users' computer. Ever.

Maybe it would be worth your time to look into a different language to
do whatever it is you want to do, something like Visual Basic might suit
you well (last time I used it there was a control that would popup the
standard windows 'Select Folder' dialog.)

Travis Doherty

attached mail follows:


On Wednesday 24 January 2007 07:32, Travis Doherty wrote:
> Aslam Bari wrote:
> >Dear All,
> >I m new in this Forum. I m making a project in which i need to show user a
> >Browse Folder Dialog Box, In which he can select a folder and after this i
> >will do some manipulation on that folder's content. So the problem is that
> > i could not found any sample on Web , how to show "Folder Dialog" in any
> > way (HTML, JavaScript, PHP etc). Plz has anybody some idea how to do some
> > work around this.
> >
> >Thanks...
>
> PHP won't let you edit files on your users' computer. Ever.
>
> Maybe it would be worth your time to look into a different language to
> do whatever it is you want to do, something like Visual Basic might suit
> you well (last time I used it there was a control that would popup the
> standard windows 'Select Folder' dialog.)
>
> Travis Doherty

Ouch, this is close to swearing in the church...

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

attached mail follows:


Børge Holen wrote:

>On Wednesday 24 January 2007 07:32, Travis Doherty wrote:
>
>
>>Aslam Bari wrote:
>>
>>
>>>Dear All,
>>>I m new in this Forum. I m making a project in which i need to show user a
>>>Browse Folder Dialog Box, In which he can select a folder and after this i
>>>will do some manipulation on that folder's content. So the problem is that
>>>i could not found any sample on Web , how to show "Folder Dialog" in any
>>>way (HTML, JavaScript, PHP etc). Plz has anybody some idea how to do some
>>>work around this.
>>>
>>>Thanks...
>>>
>>>
>>PHP won't let you edit files on your users' computer. Ever.
>>
>>Maybe it would be worth your time to look into a different language to
>>do whatever it is you want to do, something like Visual Basic might suit
>>you well (last time I used it there was a control that would popup the
>>standard windows 'Select Folder' dialog.)
>>
>>Travis Doherty
>>
>>
>
>Ouch, this is close to swearing in the church...
>
>
>
:p I suppose it is. Use the right tool for the job right? PHP on a
server won't ever let the OP manipulate the content of a folder on his
users computer.

T

attached mail follows:


Hello,
Just a minute. I know the php script will run on server. Suppose i m working
on server machine and i need to make a project for myself. The machine is
only one and same. Also there are a lot of file and directory methods
available in PHP, Whats that? Actually i want to show the files of selected
folder on screen.
Thanks...

Travis Doherty-2 wrote:
>
> Børge Holen wrote:
>
>>On Wednesday 24 January 2007 07:32, Travis Doherty wrote:
>>
>>
>>>Aslam Bari wrote:
>>>
>>>
>>>>Dear All,
>>>>I m new in this Forum. I m making a project in which i need to show user
a
>>>>Browse Folder Dialog Box, In which he can select a folder and after this
i
>>>>will do some manipulation on that folder's content. So the problem is
that
>>>>i could not found any sample on Web , how to show "Folder Dialog" in any
>>>>way (HTML, JavaScript, PHP etc). Plz has anybody some idea how to do
some
>>>>work around this.
>>>>
>>>>Thanks...
>>>>
>>>>
>>>PHP won't let you edit files on your users' computer. Ever.
>>>
>>>Maybe it would be worth your time to look into a different language to
>>>do whatever it is you want to do, something like Visual Basic might suit
>>>you well (last time I used it there was a control that would popup the
>>>standard windows 'Select Folder' dialog.)
>>>
>>>Travis Doherty
>>>
>>>
>>
>>Ouch, this is close to swearing in the church...
>>
>>
>>
> :p I suppose it is. Use the right tool for the job right? PHP on a
> server won't ever let the OP manipulate the content of a folder on his
> users computer.
>
> T
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--
View this message in context: http://www.nabble.com/How-to-make-Browse-Folder-Dialog-tf3079100.html#a8555797
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


Aslam Bari wrote:

>Hello,
>Just a minute. I know the php script will run on server. Suppose i m working
>on server machine and i need to make a project for myself. The machine is
>only one and same. Also there are a lot of file and directory methods
>available in PHP, Whats that? Actually i want to show the files of selected
>folder on screen.
>Thanks...
>
>
Yes, PHP has file handling functions for use on the server it is running
on. As long as we're clear that it can't touch the filesystem of the
user of the application :D

If you just wanted to make a list of folders and let them select one you
could build the list using an HTML SELECT box. Once they have selected
an item and click on submit, you would use similar code that you used to
populate your directory list to show a list of all files in that directory.

The code at Example 2 on the php.net readdir documentation is probably
one good place to start: http://www.php.net/readdir

A hint from another thread today to save yourself trouble: Always use
full paths when working with files.

T

attached mail follows:


On Tue, January 23, 2007 7:59 am, blackwater dev wrote:
> I need to create some webservices for our web app and am really torn
> as to
> which route to go...SOAP, XML_RPC, etc.? I like the looks of REST but
> many
> of our partners that will be using our services use cold fusion and I
> think
> that has build in SOAP support.
>
> Which protocol would you use?

Use whichever one is convenient for the most recipients, which sounds
like SOAP for you, so far.

Try to design your application so that you can easily provice the
OTHER options later as well, so you can have a single DB with multiple
publication methods. Consider RSS as well.

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

attached mail follows:


On Mon, January 22, 2007 10:11 pm, Aaron Axelsen wrote:
> I'm trying to figure out what the desired behavior is of using the
> return function to bail out of an include page.
>
> I did some testing, and this is what I concluded.
>
> First, I created the following file:
>
> <?php
> if (defined('TEST_LOADED')) {
> return;

The behaviour of return in the main script scope changed from, errr,
PHP 3 to PHP 4, so I'm not sure it's a good idea to rely on it.

> }
> define('TEST_LOADED',true);
> echo "blah blah blah blah<br/>";
> ?>
>
> I then called it as follows:
> include('test.php');
> include('test.php');
> include('test.php');
>
> The output is:
> blah blah blah blah
>
> Second, I changed the test.php file to be the following:
>
> <?php
> if (defined('TEST_LOADED')) {
> return;
> }
> define('TEST_LOADED',true);
> echo "blah blah blah blah<br/>";
>
> function myFunc($test) {
>
> }
> ?>
>
> When I load the page now, it throws the following error: PHP Fatal
> error: Cannot redeclare myfunc()
>
> It appears that if there are functions in the include page that you
> can't use return to bail out. What is the desired functionality in
> this
> case? Is this a bug in how php handles it? or was return never
> designed
> to be used this way?

You *could* do more like this:

if (!defined('TEST_LOADED')){
  define('TEST_LOADED', true);
  function my_func() { return true; }
}

This should work, I think...

You also could consider just using http://php.net/include_once and let
PHP handle this.

Or, you could actually architect your application to not be including
things so willy-nilly that you don't even know what the [bleep] you've
included... :-) :-) :-)

To be blunt, though, code like this usually IS a sign that the
application is a bit dis-organized, pulling in include files with too
little planning.

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

attached mail follows:


On Mon, January 22, 2007 9:46 pm, Gerry D wrote:
> I need PHP to find out if a jpeg file uses progressive encoding. None
> of the standard exif or image functions seem to be able to tell me
> that. (please correct me if I'm wrong)

I don't know of any function, and the ever-populare
http://php.net/getimagesize doesn't seem to do it.

You may be able to hack it with http://php.net/exec and 'file'
built-in shell command, if that reliably/consistently reports
progressive-ness...

One other possibility is to see what happens if you do imagefromjpeg()
on a progressive JPEG -- There amy be functions in GD that will tell
you if the JPEG is progressive, once you have sucked it into PHP...

Depending on the size of the images on average, this could be slower
than exec('file') but would be faster for small images, I should
think.

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

attached mail follows:


On Mon, January 22, 2007 5:45 pm, jamesjwm-art.net wrote:
> Here's a simple makefile I want PHP's exec to execute make on:
>
> KEYLIST := keylist.txt
> DEPS := $(wildcard *.txt)
> FILES := *.txt
>
> $(KEYLIST): $(DEPS)
> grep ^keywords $(FILES) > $
>
> now when I use make from command line, it works as expected,
> the keylist.txt file is created. however, when I use PHP exec
> to run make on the makefile, the keylist.txt file is not generated.
>
> * if keylist.txt does not need updating, PHP exec make works,
> make says keylist.txt is up to date.
> * if i remove redirection, PHP exec make shows that grep is
> making the same matches as make from commandline.
>
> Why does the redirection of the grep command (within the makefile)
> only work when I execute make from the commandline but not from
> PHP exec||shell_exec?
>
> One sollution is to abandon redirection and get the output from
> grep into a string and then get PHP to create keylist.txt, but
> why do that?

When your web-server runs PHP, it is NOT running as 'you'
It is running as a different user with different permissions.
Almost for sure, that user does not have permission to create files in
that directory.
This would exactly match the description you gave.

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

attached mail follows:


On Tue, January 23, 2007 1:48 pm, Jay Paulson wrote:
>>> php_value memory_limit 40M
>>> php_value post_max_size 30M
>>> php_value upload_max_filesize 30M
>>> php_value display_errors On
>>> php_value max_execution_time 300
>>> php_value max_input_time 300

I *think* PHP (used to?) take the MINIMUM of the php.ini and .htaccess
memory sizes.

The reason being that your webhost should not have an application
developer over-riding that limit in php.ini...

Of course, if an app developer wants a smaller number, that's fine.

I don't guarantee this answer is correct.

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

attached mail follows:


On Mon, January 22, 2007 9:17 am, Marcelo Ferrufino Murillo wrote:
> Hi guys, I´m beginner in php, so I need some help. I have to make a
> script to send SMS to moviles phones, can you give some ideas how to
> make it please... Thank you

Another option is to partner with a gateway such as mQube to let them
worry about the actual sending.

The phone carriers are trying to keep your cell phone from becoming a
dumping ground for spammers, so it's not "easy", by Design.

If you intend to have a "short code" number, then it gets even more
stringent, with a months-long review process of your application and
each carrier approves/denies the application and...

Good luck.

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

attached mail follows:


On Sat, January 20, 2007 6:54 pm, Vinicius C Silva wrote:
> hi everyone!
>
> i'd like to ask something maybe commonly asked here. what is the most
> powerful php editor?

vi on a Crey.
:-)

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

attached mail follows:


On 21/01/07, Arno Kuhl <akuhltelkomsa.net> wrote:
> -----Original Message-----
> From: Vinicius C Silva [mailto:vinicrigruposgmail.com]
> Sent: 21 January 2007 02:54
> To: php-generallists.php.net
> Subject: [PHP] most powerful php editor
>
> For me the analogy goes something like this: if you type the occasional
> letter or note then Wordpad is perfectly adequate, but if your livelihood is
> churning out professional well-formatted heavy-weight documents then it pays
> you to invest in a top-class word processor and supporting tools.

Or alternatively, use vim and LaTeX and produce documents of a
consistently higher quality than practically any top-class word
processor.

-robin

attached mail follows:


On Wed, 2007-01-24 at 10:31 +0000, Robin Vickery wrote:
> On 21/01/07, Arno Kuhl <akuhltelkomsa.net> wrote:
> > -----Original Message-----
> > From: Vinicius C Silva [mailto:vinicrigruposgmail.com]
> > Sent: 21 January 2007 02:54
> > To: php-generallists.php.net
> > Subject: [PHP] most powerful php editor
> >
> > For me the analogy goes something like this: if you type the occasional
> > letter or note then Wordpad is perfectly adequate, but if your livelihood is
> > churning out professional well-formatted heavy-weight documents then it pays
> > you to invest in a top-class word processor and supporting tools.
>
> Or alternatively, use vim and LaTeX and produce documents of a
> consistently higher quality than practically any top-class word
> processor.

The inherent problem in any top-class word processor being used to
produce PHP code is that PHP will quite likely (read WILL) choke on the
binary format. And if it's not saved in a binary format, then it's
probable you've lost all that "top-class" formatting :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. |
`------------------------------------------------------------'

attached mail follows:


I believe this was related to what did you want to do with your editor.

I use these editors

Linux - KDE -> Kate
Win32 -> Ultra Edit

Both are support UTF8 and both can handle more than one file at one session..
Enough search and replace abilites. Both can highlight code...

I wish to KDE (and or Kate) can support key macros to support my G15 extra
buttons for speeding up some HTML and PHP standart code blocks...

I use pico and nano for editing php code very long time ago. (multiple shell
windows etc).

Then I realize, abilites of editor effect my coding style. At that days, I
star to add line brake to SQL querys line because of long sql querys does not
fit the screen.

And also I detect when you adjust yourself to high capacity editor, you may be
very frusturated and feel uncomfortable with that low capacity ones...

and also in these days I'm looking for 19 inch (or more) wide LCD sceerns to
able to fit longer lines in my screen...

Regards

Sancar

attached mail follows:


# sancar.saranevodot.com / 2007-01-24 13:57:03 +0200:
> and also in these days I'm looking for 19 inch (or more) wide LCD
> sceerns to able to fit longer lines in my screen...

Number of reading errors people make grows with line length,
this has been known for as long as I remember. You're increasing the
probability of bugs in the code, and get tired sooner because following
long lines requires more energy.

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

attached mail follows:


On Wed, 2007-01-24 at 13:41 +0000, Roman Neuhauser wrote:
> # sancar.saranevodot.com / 2007-01-24 13:57:03 +0200:
> > and also in these days I'm looking for 19 inch (or more) wide LCD
> > sceerns to able to fit longer lines in my screen...
>
> Number of reading errors people make grows with line length,
> this has been known for as long as I remember. You're increasing the
> probability of bugs in the code, and get tired sooner because following
> long lines requires more energy.

Yep long lines are hard to read and formatting lines can improve
information absorption by providing extra visual cues. I use a 20" LCD
monitor and still format to 78 character wide lines.

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

attached mail follows:


Thanks all.

**
> As far as I know is_dir and is_file require a full path , ...

This did the trick. I kind of assumed that the path info would be
understood by is_file() and is_dir().
But explicitly adding the path info solved the problem.
Now I have a beautiful array with 38 items just as I need them.
JK

attached mail follows:


On k, 2007-01-23 at 00:58 -0800, Jim Lucas wrote:
> Németh Zoltán wrote:
> > On k, 2007-01-23 at 19:46 +1100, chris smith wrote:
> >> On 1/23/07, Németh Zoltán <znemethalterationx.hu> wrote:
> >>> On h, 2007-01-22 at 22:53 -0800, Jim Lucas wrote:
> >>>> Don wrote:
> >>>>> I have a db field that contains zip codes separated by comas.
> >>>>>
> >>>>> I am trying to get php to return all of the rows that contain a
particular
> >>>>> zip code.
> >>>>>
> >>>>>
> >>>>>
> >>>>> $query = "SELECT * FROM info WHERE MATCH (partialZIP) AGAINST
('$zip')";
> >>>> try this
> >>>>
> >>>> $query = "SELECT * FROM info WHERE column LIKE '{$zip}'";
> >>> I would use
> >>>
> >>> $query = "SELECT * FROM info WHERE LOCATE('{$zip}', column) > 0";
> >> And how are you going to index that? That's going to be extremely slow
> >> as the size of the table grows.
> >>
> >
> > well, yes.
> >
> > better solution is to not store the zip codes in one field with commas,
> > but in a separate table which relates to this one. and then you could
> > use a query like
> >
> > $query = "SELECT t1.*, t2.* FROM info t1, zips t2 WHERE t1.id=t2.infoid
> > AND t2.zip = '{$zip}'";
> >
> > greets
> > Zoltán Németh
> >
> But, since the op is working with existing data, what is the performance
> difference between using LIKE or LOCATE?
>
> Pro's vs. Con's
>
>
>

oops I just made a simple performance test and the result showed me that
LIKE is faster (in my test it was twice as faster than LOCATE)

sorry for my ignorance, I did not know that

greets
Zoltán Németh

I appreciate all the input. I would definitely like to use a separate table
for the zips, but I cannot figure out how make the form that stores them
user friendly.... each entry can have any number of zips - from many to just
a few.

Also, the site is in development, so there is no existing data....

I will play with LIKE for the time being.....

attached mail follows:


> I appreciate all the input. I would definitely like to use a separate table
> for the zips, but I cannot figure out how make the form that stores them
> user friendly.... each entry can have any number of zips - from many to just
> a few.
>
> Also, the site is in development, so there is no existing data....
>
> I will play with LIKE for the time being.....

Aren't zip's fixed? Why do you need 'like'? What are you trying to achieve?

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

attached mail follows:


> I appreciate all the input. I would definitely like to use a separate
table
> for the zips, but I cannot figure out how make the form that stores them
> user friendly.... each entry can have any number of zips - from many to
just
> a few.
>
> Also, the site is in development, so there is no existing data....
>
> I will play with LIKE for the time being.....

Aren't zip's fixed? Why do you need 'like'? What are you trying to achieve?

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

zips are fixed, but my clients have districts that I want to be searched by
zip+4. Each client will have a different district with different zips per
district.
They are to input the zips that are within their district when they sign up,
and that data is used to display relevant profiles when a user inputs their
zip.

As best as I can figure, the best way to do this with full text db fields
where the zips are inputted separated by comas.

I am currently trying to get WHERE MATCH () AGAINST to do the trick, but I
am going to play with some of these other suggestions....

I am very new to programming, just fyi.

Any input or suggestions very much welcome.

Thanks,
Don

attached mail follows:


On k, 2007-01-23 at 22:49 -0700, Don wrote:
> On k, 2007-01-23 at 00:58 -0800, Jim Lucas wrote:
> > Németh Zoltán wrote:
> > > On k, 2007-01-23 at 19:46 +1100, chris smith wrote:
> > >> On 1/23/07, Németh Zoltán <znemethalterationx.hu> wrote:
> > >>> On h, 2007-01-22 at 22:53 -0800, Jim Lucas wrote:
> > >>>> Don wrote:
> > >>>>> I have a db field that contains zip codes separated by comas.
> > >>>>>
> > >>>>> I am trying to get php to return all of the rows that contain a
> particular
> > >>>>> zip code.
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>> $query = "SELECT * FROM info WHERE MATCH (partialZIP) AGAINST
> ('$zip')";
> > >>>> try this
> > >>>>
> > >>>> $query = "SELECT * FROM info WHERE column LIKE '{$zip}'";
> > >>> I would use
> > >>>
> > >>> $query = "SELECT * FROM info WHERE LOCATE('{$zip}', column) > 0";
> > >> And how are you going to index that? That's going to be extremely slow
> > >> as the size of the table grows.
> > >>
> > >
> > > well, yes.
> > >
> > > better solution is to not store the zip codes in one field with commas,
> > > but in a separate table which relates to this one. and then you could
> > > use a query like
> > >
> > > $query = "SELECT t1.*, t2.* FROM info t1, zips t2 WHERE t1.id=t2.infoid
> > > AND t2.zip = '{$zip}'";
> > >
> > > greets
> > > Zoltán Németh
> > >
> > But, since the op is working with existing data, what is the performance
> > difference between using LIKE or LOCATE?
> >
> > Pro's vs. Con's
> >
> >
> >
>
> oops I just made a simple performance test and the result showed me that
> LIKE is faster (in my test it was twice as faster than LOCATE)
>
> sorry for my ignorance, I did not know that
>
> greets
> Zoltán Németh
>
> I appreciate all the input. I would definitely like to use a separate table
> for the zips, but I cannot figure out how make the form that stores them
> user friendly.... each entry can have any number of zips - from many to just
> a few.
>
> Also, the site is in development, so there is no existing data....
>
> I will play with LIKE for the time being.....

well if you don't have existing data I strongly recommend putting the
zips into a separate table (and then you can forget LIKE and LOCATE as
well ;) )

you don't have to change the user input part, the user may enter all the
zips separated with commas, you only have to do an explode() on it and
then store the resulting array into the zips table.

http://www.php.net/manual/en/function.explode.php

greets
Zoltán Németh

attached mail follows:


23 jan 2007 kl. 18.55 skrev Dave Goodchild:

> This may be more of a mysql issue, but I am using php for my app so
> here
> goes...
>
> I have a fee field in the database, and when users post events they
> can
> specify entrance fee in £. In some, not all, of the fields I am
> getting, for
> example, £7 rather than £. Is this an encoding issue?
>
> Many thanks in advance...
>
> --
> http://www.web-buddha.co.uk
Dave,

Maybe you already noticed that the first two letters of "£7" are the
UTF8 encoded pound sign. But where the 7 is coming from, I do not
know. Does the data come from a html form? A select list? Do you have
a valid html encoding specified for your html code? I would begin by
looking at the source where the data is coming from. In order to
track the bug, maybe (temporarily) you could have a db where you
would strore a var_dump on posted data together with a var_dump on
$_SERVER. It might be possible as well to get some information about
the users curent browser encoding by using some java script? This
information might give you some help in narrowing down the source of
your problem.

Otherwise, why not give your user predefined currencies to choose
from? A simple select list would do the trick.

//frank