Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread clive

try using this, from php manual, clive

?php

echo filetype('/etc/passwd');  // file
echo filetype('/etc/');// dir

?

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



Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-22 23:26:06 -0800:
 On Jan 22, 2007, at 10:20 PM, Chris wrote:
 $basedir = '/whatever';
 
 for($i = 0; $i  count($cont); $i++) {
   $fullpath = $basedir . '/' . $cont[$i];
   if (is_file($fullpath)) {
   .
 }
 
 Ok, I hope I can get this to work. The code
 I copied here was code that was in the directory
 reading loop, where I would have guess that
 it would have the path info, but it did the same
 thing.

readdir() returns only a basename, you need to be in
the directory you're traversing (opendir(.) or
opendir($dir); chdir($dir)).  Compare this:

function is_file() { return test -f $1; }
function is_dir()  { return test -d $1; }
function file_exists() { return test -e $1; }

mkdir child
touch child/a child/b child/c
echo current directory: $(pwd)
for f in $(ls child); do
  is_file $f  echo is_file $f
  is_dir  $f  echo is_dir $f
  file_exists $f  echo file_exists $f
  is_file child/$f  echo is_file child/$f
  is_dir  child/$f  echo is_dir child/$f
  file_exists child/$f  echo file_exists child/$f
done

-- 
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] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-23 09:14:15 +:
 readdir() returns only a basename, you need to be in
 the directory you're traversing (opendir(.) or
 opendir($dir); chdir($dir))

... or prefix the basenames with the path you used in the
opendir() call.

-- 
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] Help With Inventory

2007-01-23 Thread Jim Lucas

Brandon Bearden wrote:

What I WANT to see is something like this

DVD ID | TITLE  |   GENRE 1   |   GENRE 2  | GENRE 3  |  ACT  | 
QTY BCK   |HLD  |  INC | OG USR |  OUT DATE  | OUT USR  |  IN DATE  | 
IN USR  CY


GENRE: ACTION - 1 TITLES
20860023  |  Movie name  |  ACTION  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0


GENRE: COMEDY - 2 TITLES
20860023  |  Movie name  |  COMEDY  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0
20860006  |  Movie name  |  COMEDY  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0





What I HAVE RIGHT NOW IS:

DVD ID | TITLE  |   GENRE 1   |   GENRE 2  | GENRE 3  |  ACT  | 
QTY BCK   |HLD  |  INC | OG USR |  OUT DATE  | OUT USR  |  IN DATE  | 
IN USR  CY


20860023  |  Movie name  |  ACTION  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0
20860023  |  Movie name  |  COMEDY  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0
20860006  |  Movie name  |  COMEDY  | | |  1  |   1  |   0  |   1000  | 
-00-00 00:00:00 | -00-00 00:00:00 |0



Thanks for you help :) I appreciate it very much.


Roman Neuhauser [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

# [EMAIL PROTECTED] / 2007-01-22 22:55:50 -0800:

Jim Lucas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

$count = 0;
while ( $row = mysql_fetch_array( $invlist ) ) {

if ( $count % 1 ) {
$rowColor = '#c1c1c1';
} else {
$rowColor = '';
}

echo HEREDOC

tr bgcolor={$rowColor}
td class='body'{$row['dvdId']/td
td{$row['dvdTitle']}/td
td class='body'{$row['dvdGenre']}/td
td{$row['dvdGenre2']}/td
td class='body'{$row['dvdGenre3']}/td
td{$row['dvdActive']}/td
td class='body'{$row['dvdOnHand']}/td
td{$row['backordered']}/td
td class='body'{$row['dvdHoldRequests']}/td
td{$row['incomingInverntory']}/td
td class='body'{$row['ogUserId']}/td
td{$row['outDate']}/td
td class='body'{$row['outUserId']}/td
td{$row['inDate']}/td
td class='body'{$row['inUserId']}/td
td{$row['cycles']}/td
/tr

HEREDOC;

$count++;

echo '/tbody/table';
}
}


I don't understand how the quotient works there. I will sometime.
I also don't understand the HEREDOC concept.

I wanted colors alternating to allow for a better read.

Ignore the heredoc thing, the quotient (remainder after division)
works just like it worked in your math class, but it should be

   if ( $count % 2 ) {
   $rowColor = '#c1c1c1';
   } else {
   $rowColor = '';
   }

Although I'd use

   $rowColors = array('', '#c1c1c1');
   ...
   $rowColor = $rowColors[$count % 2];

I still have not solved the problem with listing the genre in its own 
row,

alone at the beginning of each section of genre (the start of each unique
genre which is the ORDER BY in the statement).

Thanks for the code. I need to learn how to write more eloquently like 
you.


If anyone can figure out the a row listing for the genres, that would be
s cool.

You want something like this?

genre  | #id | title | #id | title | #id | title
---+-+---+-+---+-+
horror | 123 | Scary Movie 1 | 456 | Scary Movie 2 | ... | 
comedy | 234 | Funny Movie 1 | 456 | Funny Movie 2 | ... | 


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




This should give you an idea of what you should have for displaying the 
header/genre/section name


$oldGenre = '';
while( $row = fetch_row() ) {
if ( $oldGenre != $row['genre'] ) {
echo 'trth align=left colspan=16'.
 $row['genre'].'/td/tr';
$oldGenre = $row['genre'];
}
// format the following with your table
print_r($row);
}


Also, be warned, I noticed that I missed something in my first reply to 
you.  I have the closing table tag inside the while loop.  So you need 
to move that outside the while loop.


Jim

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



Re: [PHP] where match question

2007-01-23 Thread Németh Zoltán
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;

greets
Zoltán Németh

 
  
  $result = mysql_query($query)
  
  or die (could not connect to db);
  
  $row = mysql_fetch_row($result);
  
   
  
   
  
  this works if there is only one row that contains that zip code.
  
   
  
  If there is more than one row that contains the zip, it returns 0 rows.
  ('It' being MYSQL that returns 0 rows. I checked this by running the query
  directly to the DB)
  
   
  
  Any ideas are very much appreciated.
  
   
  
  Thanks,
  
   
  
  Don
  
   
  
   
  
  
 

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



Re: [PHP] where match question

2007-01-23 Thread chris smith

On 1/23/07, Németh Zoltán [EMAIL PROTECTED] 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.

--
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] where match question

2007-01-23 Thread Németh Zoltán
On k, 2007-01-23 at 19:46 +1100, chris smith wrote:
 On 1/23/07, Németh Zoltán [EMAIL PROTECTED] 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

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



Re: [PHP] where match question

2007-01-23 Thread Jim Lucas

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 [EMAIL PROTECTED] 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

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



Re: [PHP] where match question

2007-01-23 Thread Németh Zoltán
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 [EMAIL PROTECTED] 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

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



Re: [PHP] where match question

2007-01-23 Thread chris smith

On 1/23/07, Jim Lucas [EMAIL PROTECTED] 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 [EMAIL PROTECTED] 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


This is getting pretty OT but that's my fault... so I'll post this and
if anyone has any questions send them off-list ;)

This stuff isn't mysql specific, it should be the same across all types of db's.

This:

LIKE '{$zip}'

will be able to use an index on the field because there are no
wildcards involved, so it's much the same as field='{$zip}'. I have no
idea if databases can make this conversion internally, but in theory
it should be the same.

If it's like this:

like '{$zip}%'

that means $zip is at the start of the field and you could use a
partial index (eg on the first 10 characters of the field, search
relevant database docs for how to do that).

If it's like this:

like '%{$zip}'

then $zip is at the end of the field and you'd probably benefit from
creating an extra database field, reversing the last X characters,
creating an index and using that for searching (and create a database
trigger to keep it up to date).

If it's like this:

like '%{$zip}%'

there's not much of a chance for that to use an index because the
string can be anywhere in the field.

LOCATE will be much the same as this because it has to find the string
somewhere in the whole field, then return it's position. Actually it
will probably be a lot worse because of that.

Hopefully that makes things as clear as mud! ;)

--
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] Function returning but continues execution

2007-01-23 Thread David Mytton

Jochem Maas wrote:

rewrite 'section/addfriend/will' - 
'index.php?cmd=section/addfriendusername=will'
rewrite 'section/addfriend/templates/js/jquery.js' - 
'index.php?cmd=section/addfriendusername=templates/js/jquery.js'


and what's the bet that this second rewritten url is the bogey man here.


Yeah it was - the JS library was being requested and rewritten to the 
PHP file. Seems some data was being added to the variable in the 
function before it was being checked empty and so not returning false as 
it should have done.


Thanks for everyone's help.

David

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



RE: [PHP] using return in include files

2007-01-23 Thread Arno Kuhl
-Original Message-
From: Aaron Axelsen [mailto:[EMAIL PROTECTED]
Sent: 23 January 2007 06:12
To: php-general@lists.php.net
Subject: [PHP] using return in include files


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;
}
define('TEST_LOADED',true);
echo blah blah blah blahbr/;
?

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

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?

Any thoughts are appreciated.

--
Aaron Axelsen
[EMAIL PROTECTED]



Include works as though the include statement line is replaced by the code
that is being included. So try the following exercise and it should become
obvious why you're getting that error: copy-and-paste the code from test.php
into the code that includes test.php for each line that includes test.php,
and then delete each of those include lines (I'll comment them out). You end
up with:

?php
// include('test.php');
if (defined('TEST_LOADED')) {
return;
}
define('TEST_LOADED',true);
echo blah blah blah blahbr/;

function myFunc($test) {

}

// include('test.php');
if (defined('TEST_LOADED')) {
return;
}
define('TEST_LOADED',true);
echo blah blah blah blahbr/;

function myFunc($test) {

}

// include('test.php');
if (defined('TEST_LOADED')) {
return;
}
define('TEST_LOADED',true);
echo blah blah blah blahbr/;

function myFunc($test) {

}
?

Run that and you should get exactly the same error. Interestingly under php4
neither your code nor my expanded version of your code throws an error, so I
assume you're using php5?

If you're trying to avoid including the file more than once you could use
include_once, but I've had problems with that - the file was previously
included but not in the same scope, so it wasn't included second time it was
called and yet none of the included file's contents existed. The way I got
round it was by assigning a value in the include file, and then testing for
that value before including the file.

For example:

test.php
?php
$testphp_loaded = TRUE; // - must be outside any function or braces
.
.
.
?

main.php
?php
if (!$testphp_loaded) {
require('test.php');
}
?

You can't use a define for this because it has a much wider scope and you
end up with the same problem as using include_once.

Arno

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



Re: [PHP] preg_match problem

2007-01-23 Thread Martin Alterisio

2007/1/22, Beauford [EMAIL PROTECTED]:



... much blah blah blah ...

I've probably read 100 pages on this, and no matter what I try it doesn't
work. Including all of what you suggested above - is my PHP possessed?

if(preg_match(/[EMAIL PROTECTED]()*;:_.'/\\ ]+$/, $string)) { gives me
this error.

Warning: preg_match() [function.preg-match]: Unknown modifier '\' in
/constants.php on line 107

So if If you wouldn't mind, could you show me exactly what I need right
from
the beginning and explain why it works.

i.e.

if(preg_match(what goes here, $string)) {
Echo You got it;



if (preg_match('/[EMAIL PROTECTED]()*;:_.'\\/ ]+$/', $string))

Use single quotes and double back-slashes. PHP strings also have escape
sequences that use the back-slash as escape character, that's why you have
to double them. And single quotes to avoid the $ character interpreted as
the start of a variable.

PS: Will we be risking going the perl way if we ask that PHP supported
regular expressions natively (I mean: without having to provide them as
strings)?


Re: [PHP] preg_match problem

2007-01-23 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-01-23 09:52:17 -0300:
 2007/1/22, Beauford [EMAIL PROTECTED]:
 PS: Will we be risking going the perl way if we ask that PHP supported
 regular expressions natively (I mean: without having to provide them as
 strings)?

Yes.  I don't know about other people's objections (I have no problem
with the look and feel of naked regular expressions, but the parser
would get a bit hairier.  I mean, parsers.

-- 
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] creating an api-which protocol do you use?

2007-01-23 Thread blackwater dev

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?

Thanks!


Re: [PHP] preg_match problem

2007-01-23 Thread Paul Novitski

At 1/23/2007 04:52 AM, Martin Alterisio wrote:

if (preg_match('/[EMAIL PROTECTED]()*;:_.'\\/ ]+$/', $string))



Close but no cigar.  Because you're using apostrophe to quote the 
expression, PHP interprets the apostrophe inside the character class 
as ending the quoted expressions and fails.  Both PHP and PREG need 
you to escape any character inside a string that's used to delimit 
the string itself.


(I think it's just as important to test the code we offer to solve 
problems on the list as it is to research problems before posting 
them.  This is all getting archived)


Regards,

Paul
__

Juniper Webcraft Ltd.
http://juniperwebcraft.com  


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



RE: [PHP] preg_match problem

2007-01-23 Thread Beauford
 
 if (preg_match('/[EMAIL PROTECTED]()*;:_.'\\/ ]+$/', $string))
 
 Use single quotes and double back-slashes. PHP strings also 
 have escape sequences that use the back-slash as escape 
 character, that's why you have to double them. And single 
 quotes to avoid the $ character interpreted as the start of a 
 variable.
 
 PS: Will we be risking going the perl way if we ask that PHP 
 supported regular expressions natively (I mean: without 
 having to provide them as strings)?

I have tried all the examples posted in the last couple of days, and none of
them, including the above work. Is there another solution to this, as this
just seems to be way to buggy?

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/constants.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
//constants.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/constants.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
/constants.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
//constants.php on line 107

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in
//constants.php on line 107

Parse error: syntax error, unexpected ']' in //constants.php on line 107 

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



Re: [PHP] exec('make') Q

2007-01-23 Thread james
Roman,

On 23/1/2007, Roman Neuhauser [EMAIL PROTECTED] wrote:

 KEYLIST := keylist.txt
 DEPS := $(wildcard *.txt)
 FILES := *.txt

 $(KEYLIST): $(DEPS)
 grep ^keywords $(FILES)  $@

Why is it so roundabout about $(DEPS)/$(FILES)? The target *actuall*
depends on different files than those declared in the sources list!
What does $(DEPS) (and $(FILES)) contain?
This is what your Makefile does, BTW:
  grep ^keywords keylist.txt ...  keylist.txt

Sorry my fault, I decided to change the filename extensions of DEPS+FILES
to *.txt before posting without noticing they became same as KEYLIST.

$(DEPS) !== $(FILES) as wanted pass '*.txt' to grep rather than every
individual filename.

Try it with this instead (rename keylist.txt to key.list), but make sure
you have at least one file ending in .txt in that directory first!):

KEYLIST := key.list
FILES := $(wildcard *.txt)

$(KEYLIST): $(FILES) ; grep '^keywords' $^  $@

Ok, tried that, still same problem. it works running make from
commandline, but not from PHP using exec, or shell_exec, or system.
It's the redirection which does not work for some reason. I'm
temporarily displaying output in PHP from make, so can see that
grep is grepping, but not redirecting to the target.

Cheers,
James.

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



[PHP] no database selected

2007-01-23 Thread Ross
I am using this to connect remotely but I get a no database selected  error. 
The table is contacts but there is not a parameter for database name 
according to the documentation. How do I delect my database when conencting 
this way?

$link = mysql_connect('.org:3306', 'my_username', 'mypass');

echo 'Connected successfully';

$query = SELECT * FROM contacts; 

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



Re: [PHP] no database selected

2007-01-23 Thread Dave Goodchild

mysql_select_db


RE: [PHP] no database selected

2007-01-23 Thread Jay Blanchard
[snip]
I am using this to connect remotely but I get a no database selected
error. 
The table is contacts but there is not a parameter for database name 
according to the documentation. How do I delect my database when
conencting 
this way?
[/snip]

http://us3.php.net/manual/en/function.mysql-select-db.php

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



RE: [PHP] preg_match problem

2007-01-23 Thread Beauford
 
 You need to escape that forward slash in the character class:
 
  preg_match(/[EMAIL PROTECTED]()*;:_.'\/
 
 Also, you've got only two backslashes in your char class.  PHP is 
 reducing this to a single backslash before the space character.  I 
 think you intend this to be two backslashes in the pattern so you 
 need four backslashes in PHP:
 
  preg_match(/[EMAIL PROTECTED]()*;:_.'\/ ]+$/, $string)
 
On top of this, every time a ' is entered it gets preceded by \. If I just
check for the characters like below that doesn't happen. Totally confused.

if(preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {

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



[PHP] Encoding issue with £

2007-01-23 Thread 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


Re: [PHP] preg_match problem

2007-01-23 Thread Jim Lucas


if (preg_match('/[EMAIL PROTECTED]()*;:_.'\\/ ]+$/', $string))



Here is my rendition of what I think you are looking for.

$str = 'tab()/space( )/[EMAIL PROTECTED]*();:...';

if ( preg_match('|[EMAIL PROTECTED]*();:_. /\t-]+$|', $str) ) {
echo 'success';
} else {
echo 'failure';
}



--
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] preg_match problem

2007-01-23 Thread Jim Lucas

Beauford wrote:
 

You need to escape that forward slash in the character class:

 preg_match(/[EMAIL PROTECTED]()*;:_.'\/

Also, you've got only two backslashes in your char class.  PHP is 
reducing this to a single backslash before the space character.  I 
think you intend this to be two backslashes in the pattern so you 
need four backslashes in PHP:


 preg_match(/[EMAIL PROTECTED]()*;:_.'\/ ]+$/, $string)


On top of this, every time a ' is entered it gets preceded by \. If I just
check for the characters like below that doesn't happen. Totally confused.

if(preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {


check out magic_quote_gpc??

use the funciton get_magic_quotes_gpc() to determine if it is on and 
run stripslashes() on the value if you find that it is on.


--
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] preg_match problem

2007-01-23 Thread Paul Novitski

At 1/23/2007 09:50 AM, Beauford wrote:

  preg_match(/[EMAIL PROTECTED]()*;:_.'\/ ]+$/, $string)

On top of this, every time a ' is entered it gets preceded by \. If I just
check for the characters like below that doesn't happen. Totally confused.

if(preg_match(/^[-A-Za-z0-9_.' ]+$/, $string)) {



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:
/[EMAIL PROTECTED]()*;:_.'\/ ]+$/
http://juniperwebcraft.com/test/regexp_test_2007-01-23.php

If you're still having trouble getting this to work, please post a 
link to a page that demonstrates it not working and give us the 
complete PHP statements so we can find your error.


As an additional resource, here's Oliver Steele's RegExp workbench:
http://osteele.com/tools/rework/

Regards,

Paul
__

Juniper Webcraft Ltd.
http://juniperwebcraft.com 


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



[PHP] Re: JPEG info needed

2007-01-23 Thread zerof

Gerry D escreveu:

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)

Can anybody help me?

TIA

Gerry


http://www.jpeg.org/

--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
--
Você deve, sempre, consultar uma segunda opião!
--  
You must hear, always, one second opinion! In all cases.
--

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



[PHP] OT - Leaving

2007-01-23 Thread John Nichel

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
[EMAIL PROTECTED]

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



Re: [PHP] [HELP] Fatal error when uploading large files!

2007-01-23 Thread Jay Paulson
 Hi everyone,
 
 Hopefully you all can help!  I¹m at a loss as to what to do next.  I¹m
 running PHP 5.1.2 with Apache 2.0.55 on RedHat ES4 and I keep getting the
 following PHP error when trying to upload a larger file.  I have
 AllowOverride turned on in the httpd.conf file so my .htaccess file is below
 as well.  When I look at phpinfo() it reflects the changes in the .htaccess
 file but yet still I get the following PHP fatal error.  Anyone have any
 ideas what could be going on?  Could it be the Zend Memory Manager
 (something that I know nothing about)?  Or anything else I may not be aware
 of?
 
 Any help would be greatly appreciated!
 
 
 Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to
 allocate 19590657 bytes) in /path/to/php/file on line 979
 
 LimitRequestBody 0
 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
 
 
 doesn't seem to me that it is following the directives for memory size
 
 OR or you are up against a 20mb disk quota possibly???


How would I check to see if I'm up against a 20md disk quota?

Thanks.

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



Re: [PHP] [HELP] Fatal error when uploading large files!

2007-01-23 Thread Jay Paulson
 Hi everyone,
 
 Hopefully you all can help!  I¹m at a loss as to what to do next.  I¹m
 running PHP 5.1.2 with Apache 2.0.55 on RedHat ES4 and I keep getting the
 following PHP error when trying to upload a larger file.  I have
 AllowOverride turned on in the httpd.conf file so my .htaccess file is below
 as well.  When I look at phpinfo() it reflects the changes in the .htaccess
 file but yet still I get the following PHP fatal error.  Anyone have any
 ideas what could be going on?  Could it be the Zend Memory Manager
 (something that I know nothing about)?  Or anything else I may not be aware
 of?
 
 Any help would be greatly appreciated!
 
 
 Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to
 allocate 19590657 bytes) in /path/to/php/file on line 979
 
 LimitRequestBody 0
 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
 
 php_value can't overrule a php_admin_value (your apache conf or another
 .htaccess
 maybe setting these ini settings usiong php_admin_value).
 
 check that the php ini settings you've got in your .htaccess are
 actually being honored:
 
 foreach (array('memory_limit','post_max_size','upload_max_filesize') as $ini)
 echo ini_get($ini),'br /';
 

I ran the foreach like you have and the values came back with the ones I'm
using in my .htaccess file.

I couldn't find any occurrences of php_admin_value used any where. Hm.

Thanks!

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



[PHP] To many connections error message

2007-01-23 Thread Kevin Murphy
I'm working with my host to resolve why I am getting these error  
messages, but in the meantime, I am getting this message on the website:


Warning: mysql_connect(): Too many connections in /path/number/user/ 
code/connect.php on line 10
Sorry: Could not connect to database. Please contact the webmaster at  
[EMAIL PROTECTED]


Where my connection code is:

$con = mysql_connect($host, $dbuser, $pw)
		or die(Sorry: Could not connect to database. Please contact the  
webmaster at [EMAIL PROTECTED]);

@mysql_select_db($db,$con);

The questions is, since I don't have error reporting turned on, why  
am I getting an error message that includes the complete path to my  
connect script something I would like to not be telling the  
general public? Is there a way to suppress that?


--
Kevin Murphy
Webmaster: Information and Marketing Services
Western Nevada Community College
www.wncc.edu
775-445-3326




Re: [PHP] To many connections error message

2007-01-23 Thread Pintér Tibor

@, or ask your hoster to disable display_errors

t




The questions is, since I don't have error reporting turned on, why am 
I getting an error message that includes the complete path to my 
connect script something I would like to not be telling the 
general public? Is there a way to suppress that?


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



Re: [PHP] OT - Leaving

2007-01-23 Thread tg-php
Best wishes John!  We'll hold the fort and keep fighting the good fight in your 
absence. :)

Good luck to ya!

-TG

= = = Original message = = =

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
[EMAIL PROTECTED]


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



RE: [PHP] OT - Leaving

2007-01-23 Thread Jay Blanchard
[snip]
...damned sappy stuff...
[/snip]

Later gator, we're going to miss your pseudo-Cajun self!

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



Re: [PHP] OT - Leaving

2007-01-23 Thread Robert Cummings
Who's John Nichel?

;)

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

Cheers,
Rob.

On Tue, 2007-01-23 at 14:45 -0500, 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.
 
 -- 
 John C. Nichel IV
 Programmer/System Admin (ÜberGeek)
 Dot Com Holdings of Buffalo
 716.856.9675
 [EMAIL PROTECTED]
 
-- 
..
| 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] Encoding issue with £

2007-01-23 Thread tedd

At 5:55 PM + 1/23/07, Dave Goodchild wrote:

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?


My guess is that it is. There are difference 
between browsers, OS's, and thus support for 
multilingual code-points. Not all allow the user 
to submit those types of characters and worse 
yet, some allow to them to be submitted 
incorrectly.


As such, if it were me and I wanted a form for 
the end user to indicate what currency s/her was 
entering, I would make it a selection control of 
some type and thereby control the user's input.


My $0.02.

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] OT - Leaving

2007-01-23 Thread tedd

At 2:45 PM -0500 1/23/07, 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.

--
John C. Nichel IV


John:

Does this mean that I'm out of your kill file now?  :-)

Take care and I hope everything goes well for you.

tedd

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

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



[PHP] php installation problem

2007-01-23 Thread Ross
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?


R. 

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



Re: [PHP] Encoding issue with £

2007-01-23 Thread Larry Garfield
On Tuesday 23 January 2007 11:55 am, Dave Goodchild wrote:
 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...

Yep, sounds like encoding to me.  This article talks more about smart quotes 
than the £ sign, but the recommendation applies for that as well.

http://www.garfieldtech.com/blog/stupid-quotes

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

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



Re: [PHP] To many connections error message

2007-01-23 Thread Chris

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/

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



Re: [PHP] php installation problem

2007-01-23 Thread Chris

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/

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



Re: [PHP] To many connections error message

2007-01-23 Thread Pintér Tibor

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

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



Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread jekillen


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

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



RE: [PHP] preg_match problem

2007-01-23 Thread Beauford
 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:
  /[EMAIL PROTECTED]()*;:_.'\/ ]+$/

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

[EMAIL PROTECTED]

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.

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



[PHP] Splitting long text

2007-01-23 Thread Skip Evans

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



Re: [PHP] OT - Leaving

2007-01-23 Thread Chris Shiflett
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/

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



Re: [PHP] Splitting long text

2007-01-23 Thread Paul Novitski

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 


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



RE: [PHP] Splitting long text

2007-01-23 Thread Jay Blanchard
[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

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



RE: [PHP] OT - Leaving

2007-01-23 Thread Ligaya A. Turmelle
So many old faces leaving... Feels odd 

Respectfully,
Ligaya Turmelle
Systems Analyst
Guamcell Communications
Phone: (671)689-2377 
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED] 
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
[EMAIL PROTECTED]

--
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] Splitting long text

2007-01-23 Thread Anas Mughal

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



// textwrap 1.1 Brian Moon [EMAIL PROTECTED]
// 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 [EMAIL PROTECTED] 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


[PHP] How to make Browse Folder Dialog

2007-01-23 Thread Aslam Bari

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.

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



Re: [PHP] creating an api-which protocol do you use?

2007-01-23 Thread Richard Lynch
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?

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



Re: [PHP] having trouble with is_file() and is_dir() on 5.1.2

2007-01-23 Thread Richard Lynch
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?

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



Re: [PHP] using return in include files

2007-01-23 Thread Richard Lynch
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 blahbr/;
 ?

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

 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?

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



Re: [PHP] JPEG info needed

2007-01-23 Thread Richard Lynch
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?

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



Re: [PHP] exec('make') Q

2007-01-23 Thread Richard Lynch
On Mon, January 22, 2007 5:45 pm, [EMAIL PROTECTED] 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?

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



Re: [PHP] [HELP] Fatal error when uploading large files!

2007-01-23 Thread Richard Lynch
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?

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



Re: [PHP] smsSend

2007-01-23 Thread Richard Lynch
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?

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



Re: [PHP] most powerful php editor

2007-01-23 Thread Richard Lynch
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?

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



[PHP] re: having trouble with is_file() and is_dir() on 5.1.2; solved

2007-01-23 Thread jekillen

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

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



RE: [PHP] where match question

2007-01-23 Thread Don
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 [EMAIL PROTECTED] 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.

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



Re: [PHP] where match question

2007-01-23 Thread Chris

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/

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



Re: [PHP] How to make Browse Folder Dialog

2007-01-23 Thread Travis Doherty
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

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



Re: [PHP] How to make Browse Folder Dialog

2007-01-23 Thread Børge Holen
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
---

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



Re: [PHP] Splitting long text

2007-01-23 Thread Travis Doherty
Anas Mughal wrote:

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



 // textwrap 1.1 Brian Moon [EMAIL PROTECTED]
 // 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

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



Re: [PHP] How to make Browse Folder Dialog

2007-01-23 Thread Travis Doherty
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



Re: [PHP] How to make Browse Folder Dialog

2007-01-23 Thread Aslam Bari

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.

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



RE: [PHP] where match question

2007-01-23 Thread Don


 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

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



Re: [PHP] How to make Browse Folder Dialog

2007-01-23 Thread Travis Doherty
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

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



Re: [PHP] Splitting long text

2007-01-23 Thread Paul Novitski

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 [EMAIL PROTECTED]
// 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 


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