php-general Digest 10 Sep 2005 12:39:42 -0000 Issue 3674

2005-09-10 Thread php-general-digest-help

php-general Digest 10 Sep 2005 12:39:42 - Issue 3674

Topics (messages 222101 through 222110):

Books / tutorials on Object Oriented Programming with PHP
222101 by: Vinayakam Murugan
222102 by: Vizion
222103 by: Jason Coffin

mixing $_POST and $_GET vars
222104 by: bruce
222105 by: Stephen Johnson
222106 by: afan.afan.net

Re: access resources via a proxy
222107 by: Vedanta Barooah

Re: Encrypt Files
222108 by: Vedanta Barooah

Re: ASP (VBScript) to PHP Converters?
222109 by: Rick Emery

Re: Breaking up search terms into an array intelligently
222110 by: Robin Vickery

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
php-general@lists.php.net


--
---BeginMessage---
Hi 

I am learning about Object Oriented Programming with PHP. Can you suggest 
any good books / tutorials?

-- 
Warm Regards
~~~
Vinayak
http://theregoesanotherday.blogspot.com/
---End Message---
---BeginMessage---
On Friday 09 September 2005 16:25,  the author Vinayakam Murugan contributed 
to the dialogue on-
 [PHP] Books / tutorials on Object Oriented Programming with PHP: 

Hi

I am learning about Object Oriented Programming with PHP. Can you suggest
any good books / tutorials?
PHP  MySQL web development by Luke Welling and Laura Thomson is good if you 
are web oriented in yr development objectives

david
-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.
---End Message---
---BeginMessage---
On 9/9/05, Vinayakam Murugan [EMAIL PROTECTED] wrote:
 I am learning about Object Oriented Programming with PHP. Can you suggest
 any good books / tutorials?

Greetings,

I HIGHLY recommend PHP 5 Objects, Patterns, and Practice by Matt
Zandstra [http://www.apress.com/book/bookDisplay.html?bID=358]. This
was one of the best PHP books I have read and I suspect it is exactly
what you are looking for.

Yours,
Jason Coffin
---End Message---
---BeginMessage---
hi..

quick question.. a basic link a ref =foo.php?a=1blah/a allows you to
process the vars in foo.php using $_GET, easy/basic enough. however, if i
have a form from cat.php that does a 'post' of the form information/input to
the foo.php, i'm then going to have to either change the form to do a 'get'
or else i'm going to have to do both a $_GET, and a $_POST within foo.php to
access the vars from the pages that are interfacing with foo.php.

is there an easier/cleaner/better approach??

or do i really need/wind up doing something like

if ($_GET['foo'])...

if ($_POST['apple'])...

and just have a mix of both methods within the code...

thanks

-bruce
[EMAIL PROTECTED]
---End Message---
---BeginMessage---
Is there any particular reason that you do not want to mix both type in
foo.php.

I have a few that mix $_SERVER , $_COOKIE, $_POST, and $_FILES.

I do not see a particular performance hit with mixing these since they are
available regardless of whether they are populated or not.




On 9/9/05 4:46 PM, bruce [EMAIL PROTECTED] wrote:

 hi..
 
 quick question.. a basic link a ref =foo.php?a=1blah/a allows you to
 process the vars in foo.php using $_GET, easy/basic enough. however, if i
 have a form from cat.php that does a 'post' of the form information/input to
 the foo.php, i'm then going to have to either change the form to do a 'get'
 or else i'm going to have to do both a $_GET, and a $_POST within foo.php to
 access the vars from the pages that are interfacing with foo.php.
 
 is there an easier/cleaner/better approach??
 
 or do i really need/wind up doing something like
 
 if ($_GET['foo'])...
 
 if ($_POST['apple'])...
 
 and just have a mix of both methods within the code...
 
 thanks
 
 -bruce
 [EMAIL PROTECTED]

-- 
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

[EMAIL PROTECTED]
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--
---End Message---
---BeginMessage---


   Request variables: $_REQUEST

   *Note: * Introduced in 4.1.0. There is no equivalent array in
   earlier versions.

   *Note: * Prior to PHP 4.3.0, $_FILES information was also included
   in $_REQUEST.

An associative array consisting of the contents of $_GET, $_POST, and 
$_COOKIE.


This is a 'superglobal', or automatic global, variable. This simply 
means that it is available in all scopes throughout a script. You don't 
need to do a *global $_REQUEST;* to access it within functions or methods.


If the register_globals 
http://us2.php.net/manual/en/ini.core.php#ini.register-globals 
directive is set, then these variables will also be made available in 
the global scope 

Re: [PHP] Breaking up search terms into an array intelligently

2005-09-10 Thread Robin Vickery
On 9/7/05, Paul Groves [EMAIL PROTECTED] wrote:
 I want to be able to break up a number of search terms typed into an input
 box into array, simple enough one would think, just use explode, e.g
 
 
 $array = explode( , $string);
 
 
 But what if I want to be able to cope with search terms seperated by  1
 space (a common typing error)? This should work:
 
 
 function enhanced_explode($string) {
  $array = preg_split (/\s+/, $string);
  return ($array);
 }
 
 
 But what if I want to allow Google-type search parameters, so that
 something like the following is split into 3 search terms?:
 firstsearchterm second search term thirdsearchterm
 The following code will do the trick, but is slow and doesn't allow for
 multiple spaces as the delimiter, nor the possibility of multiple delimiters
 (e.g.  , +, , etc.)

?php
$search ='first -second +third fourth \fifth\-sixth seventh 
eighth';

$re = '/[+-]?((?:[^]|.)*|[^\s]+)/';

preg_match_all($re, $search, $terms);

print_r($terms);
?

Array
(
[0] = Array
(
[0] = first
[1] = -second
[2] = +third
[3] = fourth \fifth\
[4] = -sixth seventh
[5] = eighth
)

[1] = Array
(
[0] = first
[1] = second
[2] = third
[3] = fourth \fifth\
[4] = sixth seventh
[5] = eighth
)

)

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



[PHP] array2string

2005-09-10 Thread David Christensen
Pardon my ignorance and lack of ability to form the right search for
google, but I'm trying to figure out if there's a simple function in PHP
to convert array values to a string with a separator for each value.

eg.

$arr = array(1, 5, 2);
$str = some_funct($arr, ',');

print $str;  # 1,5,2



Thanks for your help,

David Christensen

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



Re: [PHP] array2string

2005-09-10 Thread Niels Ganser
string implode(string glue, array pieces) [1]

Regards,
Niels

[1] http://php.net/manual/en/function.implode.php

 Pardon my ignorance and lack of ability to form the right search for
 google, but I'm trying to figure out if there's a simple function in
 PHP to convert array values to a string with a separator for each
 value.

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



Re: [PHP] array2string

2005-09-10 Thread afan
try serialize function
http://us2.php.net/serialize
it's easy to switch back to array again.

small addition to Niels'post

array 2 string - implode (http://us2.php.net/implode)
string to array - explode (http://us2.php.net/explode)

-afan


 string implode(string glue, array pieces) [1]

 Regards,
 Niels

 [1] http://php.net/manual/en/function.implode.php

 Pardon my ignorance and lack of ability to form the right search for
 google, but I'm trying to figure out if there's a simple function in
 PHP to convert array values to a string with a separator for each
 value.

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



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



[PHP] switching php version

2005-09-10 Thread Florent Monnier
Hi,
I have put the last php in /usr/local/bin/php505, but apache still use the 
older php in /usr/bin/php

How to configure apache to select one particular from several installed php?

-- 
Thanks

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



[PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Brian Dunning
I get my timestamp from the db in this format (I don't have control  
over this):


2004-05-14 13:24:48

I need to convert it to RFC822 to make it a valid RSS pubDate field  
like this:


Wed, 02 Oct 2002 13:00:00 GMT

How can I do that? I'm tearing my hair out here (what's left)...

:)

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



Re: [PHP] switching php version

2005-09-10 Thread Niels Ganser
Choose the right module. Search your apache config for LoadModule 
php5_module resp. LoadModule php4_module.

 How to configure apache to select one particular from several
 installed php?

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



Re: [PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Niels Ganser
Usually you can use a function in your SELECT statement to change the 
format of your timestamp. In MySQL it's DATE_FORMAT [1]. Otherwise use 
PHP's Date and Time Functions [2]. You could for instance extract the 
ingredients of your database's timestamp with strptime [3] and 
reformat it with strftime [4].

Regards,
Niels


[1] 
http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html#id2728257
[2] http://php.net/manual/en/ref.datetime.php
[3] http://php.net/manual/en/function.strptime.php
[4] http://php.net/manual/en/function.strftime.php

 I get my timestamp from the db in this format (I don't have control
 over this):

 2004-05-14 13:24:48

 I need to convert it to RFC822 to make it a valid RSS pubDate field
 like this:

 Wed, 02 Oct 2002 13:00:00 GMT

 How can I do that? I'm tearing my hair out here (what's left)...

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



[PHP] creating a login/registration/admin function/app

2005-09-10 Thread bruce
hi...

i'm in the process of looking for/creating a function to allow me to perform
user login/registration/etc, as well as handle a user admin function.

i'm looking for the following functionality:

user registration/login:
 -allow user to enter basic information
 -allow user to enter username/passwd
 -ensure unique username
 -email confirmation of user registration
 -password regeneration (forgot passwd)
 -handle forgot username/password
 -ip blocking
 -email blocking
 -security graphic verification (capcha??)
 -admin notification
 -aadmin enable/authorize
 -Session var generation on successful login
 -limit login attempts for invalid logins
 -ensure only single usage of login at a time
 -ensure that multiple logins of a login is
  within a geographic/IP range
 -IP/User tracking
 -captcha processing/implementation
 -

Admin functionality:
 -IP Tracking
 -IP blocking
 -User Management
 -User Enable/Disable function
 -User Auth/Verification function
 -User Email Function
 -User Password regeneration function
 -Site Mamagement
 -List Users
 -Track User Actions within site
 -Allow User to be a member of a given group
 -Create Groups
 -Assign User Roles/Groups
 -
 -
 -
 -

This is kind of a basic/starting point. I'm looking at a few CMS apps, but
i'm curious to know if you guys have seen any app (open source) that has
what i'm looking for...

I'm in the process of extracting the functionality from Mambo/phpBB and
adding some of what i need. Does anybody have any idea as to whether an
existing Open Source app is out here, that gives a good deal of this
functionality? Searching google turns up alot of scripts, but nothing that
really has what i'm after and that's free!!

Also, if i have to pretty much create this from scratch, is there anybody
who'd want to play the role of architect/test/reviewer??

thanks

bruce
[EMAIL PROTECTED]

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



[PHP] Re: creating a login/registration/admin function/app

2005-09-10 Thread Manuel Lemos

Hello,

on 09/10/2005 05:39 PM bruce said the following:

Does anybody have any idea as to whether an
existing Open Source app is out here, that gives a good deal of this
functionality? Searching google turns up alot of scripts, but nothing that
really has what i'm after and that's free!!


You may want to take a look at this class as it seems to do most of what 
you want:


http://www.phpclasses.org/access_user

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

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



[PHP] ran into a seemingly odd problem

2005-09-10 Thread matt VanDeWalle

Hello all.
I am new to this list but not to new to php although maybe the problem I 
am having will prove otherwise
ok, I am writing a server(or trying to), Basically I am attempting to 
write a  chat type server in php.  I cant seem to get it to realize that I 
have typed more than one word, so execute the code within the if 
statement.  basic function is below, well what I am attempting to do 
anyway, I have the  str_word_count() defined as $word_count and $words for 
the array of words that str_word_count($variable, 1) creates

ok, little piece of code is below

function commands($sock, $data)
{
$word_count = str_word_count($data);
$words = str_word_count($data, 1);
/* here is where the problems come in I think */
if(($word_count == 2)  ($data == '.quit'))
{
echo you quit with a message of $data\n;
}
else
{
echo quitting without saying anything...\n;
}
}

it seems like the code fragment above does absolutely nothing e.g 
$word_count reverts to being empty once the if statement is hit.  if I put 
something in the function, but outside of the if statement like

echo word_count was $word_count\n;
that works fine and returns an integer like it should
am I the only one who finds this little thing odd or am I missing 
something that it is so simple it already sticks out to others as a big 
glaring error?

any ideas?
matt

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



[PHP] seemingly odd problem

2005-09-10 Thread matt VanDeWalle

I should have added in my previous message, what my test input was so :
ok, i login, this is what I typed to test the little piece of code i 
previously wrote...

/* my input */
.quit goodbye
/*
just a note, I know that '.quit' by itself is only one word, i guess I 
just assumed people would know what I would test this with but maybe not.

anyway, above is my test input

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



[PHP] searching through a mysql db/tbl

2005-09-10 Thread bruce
hi...

i'm trying to figure out how to approach/solve a few issues. looking through
google hasn't made the light shine!!

1) i'm trying to figure out how to allow a user to search through a
query/tbl for a given string. ie, if i have the following as the result of a
query:

  name   email   foo...
  aa [EMAIL PROTECTED] 
  b1 [EMAIL PROTECTED]123
  bb [EMAIL PROTECTED]qwe


if i allow a user to search on say 'aa', i'd like the user to be able to
get:

  name   email   foo...
  aa [EMAIL PROTECTED] 
  b1 [EMAIL PROTECTED]123

any ideas as to how i could go about and create the query, or what would i
need to do to have this result...


2) if i have a query that produces a number of rows, how/what would i need
to do, to limit the number of rows displayed, and to allow the user to
select a 'back/next' button that would generate/display the next 'N' items
in the list/query results...

if anybody could direct me to sample docs/code that kind of describes/solves
what i've described, i'd appreciate it!!!

thanks

-bruce
[EMAIL PROTECTED]

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



Re: [PHP] searching through a mysql db/tbl

2005-09-10 Thread Stephen Johnson



On 9/10/05 3:13 PM, bruce [EMAIL PROTECTED] wrote:

 if i allow a user to search on say 'aa', i'd like the user to be able to
 get:
 
   name   email   foo...
   aa [EMAIL PROTECTED] 
   b1 [EMAIL PROTECTED]123
 
 any ideas as to how i could go about and create the query, or what would i
 need to do to have this result...

Use like in your select statement ...

Select name, email, foo from tbl where email like '%aa%';



 2) if i have a query that produces a number of rows, how/what would i need
 to do, to limit the number of rows displayed, and to allow the user to
 select a 'back/next' button that would generate/display the next 'N' items
 in the list/query results...
 

Use limit in your select statement

Select * from tbl limit 10;

You can also use a start in the limit so the next button would call this
select. 

Select * from tbl limit 10, 10;

 if anybody could direct me to sample docs/code that kind of describes/solves
 what i've described, i'd appreciate it!!!

The folks on the MySQL list can help you with these questions better then
the folks here on the PHP list.



 
 thanks
 
 -bruce
 [EMAIL PROTECTED]

-- 
Stephen Johnson
The Lone Coder

http://www.ouradoptionblog.com
*Join us on our adoption journey*

[EMAIL PROTECTED]
http://www.thelonecoder.com

*Continuing the struggle against bad code*
--

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



Re: [PHP] creating a login/registration/admin function/app

2005-09-10 Thread Jay Paulson

You might also take a look at the following.

http://phpgacl.sourceforge.net/

I know that's what Joomla (formly known as Mambo) is going to use in 
their 5.0 version.


jay


hi...

i'm in the process of looking for/creating a function to allow me to 
perform

user login/registration/etc, as well as handle a user admin function.

i'm looking for the following functionality:

user registration/login:
 -allow user to enter basic information
 -allow user to enter username/passwd
 -ensure unique username
 -email confirmation of user registration
 -password regeneration (forgot passwd)
 -handle forgot username/password
 -ip blocking
 -email blocking
 -security graphic verification (capcha??)
 -admin notification
 -aadmin enable/authorize
 -Session var generation on successful login
 -limit login attempts for invalid logins
 -ensure only single usage of login at a time
 -ensure that multiple logins of a login is
  within a geographic/IP range
 -IP/User tracking
 -captcha processing/implementation
 -

Admin functionality:
 -IP Tracking
 -IP blocking
 -User Management
 -User Enable/Disable function
 -User Auth/Verification function
 -User Email Function
 -User Password regeneration function
 -Site Mamagement
 -List Users
 -Track User Actions within site
 -Allow User to be a member of a given group
 -Create Groups
 -Assign User Roles/Groups
 -
 -
 -
 -

This is kind of a basic/starting point. I'm looking at a few CMS apps, 
but
i'm curious to know if you guys have seen any app (open source) that 
has

what i'm looking for...

I'm in the process of extracting the functionality from Mambo/phpBB and
adding some of what i need. Does anybody have any idea as to whether an
existing Open Source app is out here, that gives a good deal of this
functionality? Searching google turns up alot of scripts, but nothing 
that

really has what i'm after and that's free!!

Also, if i have to pretty much create this from scratch, is there 
anybody

who'd want to play the role of architect/test/reviewer??

thanks

bruce
[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] ran into a seemingly odd problem

2005-09-10 Thread Jasper Bryant-Greene

matt VanDeWalle wrote:

function commands($sock, $data)
{
$word_count = str_word_count($data);
$words = str_word_count($data, 1);
/* here is where the problems come in I think */
if(($word_count == 2)  ($data == '.quit'))
{
echo you quit with a message of $data\n;
}
else
{
echo quitting without saying anything...\n;
}
}


function commands( $sock, $data ) {
$words = explode( ' ', $data );
if( count( $words ) == 2$words[0] == '.quit' ) {
echo quit with a message of {$words[1]}\n;
} else {
echo quit with no message\n;
}
}

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] Convert a timestamp to RFC822??

2005-09-10 Thread Jordan Miller
we *just* had a post similar to this. It's easy, just use the date()  
and strtotime() functions:


$timestamp = '2004-05-14 13:24:48';
$RFC_formatted = date('r', strtotime($timestamp));

done!

Jordan


On Sep 10, 2005, at 11:14 AM, Brian Dunning wrote:

I get my timestamp from the db in this format (I don't have control  
over this):


2004-05-14 13:24:48

I need to convert it to RFC822 to make it a valid RSS pubDate field  
like this:


Wed, 02 Oct 2002 13:00:00 GMT

How can I do that? I'm tearing my hair out here (what's left)...

:)

--
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] Books / tutorials on Object Oriented Programming with PHP

2005-09-10 Thread Jordan Miller

Here is a thorough review on the Zandstra book:
http://books.slashdot.org/article.pl?sid=05/08/16/0434205tid=169tid=6

Jordan



On Sep 9, 2005, at 6:39 PM, Jason Coffin wrote:


On 9/9/05, Vinayakam Murugan [EMAIL PROTECTED] wrote:

I am learning about Object Oriented Programming with PHP. Can you  
suggest

any good books / tutorials?



Greetings,

I HIGHLY recommend PHP 5 Objects, Patterns, and Practice by Matt
Zandstra [http://www.apress.com/book/bookDisplay.html?bID=358]. This
was one of the best PHP books I have read and I suspect it is exactly
what you are looking for.

Yours,
Jason Coffin

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






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



[PHP] thanks for the help

2005-09-10 Thread matt VanDeWalle

hello,
I just wanted to say thank you to the person who basically rewrote the 
function i seemed to have problems with and it actually now works.

thanks again
matt

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



RE: [PHP] searching through a mysql db/tbl

2005-09-10 Thread Murray @ PlanetThoughtful
 hi...
 
 i'm trying to figure out how to approach/solve a few issues. looking
 through
 google hasn't made the light shine!!
 
 1) i'm trying to figure out how to allow a user to search through a
 query/tbl for a given string. ie, if i have the following as the result of
 a
 query:
 
   name   email   foo...
   aa [EMAIL PROTECTED] 
   b1 [EMAIL PROTECTED]123
   bb [EMAIL PROTECTED]qwe
 
 
 if i allow a user to search on say 'aa', i'd like the user to be able to
 get:
 
   name   email   foo...
   aa [EMAIL PROTECTED] 
   b1 [EMAIL PROTECTED]123
 
 any ideas as to how i could go about and create the query, or what would i
 need to do to have this result...

Hi,

Basically what you need to do is dynamically create the WHERE clause of your
query string.

In the example above, the WHERE clause might look something like:

$qry = SELECT * FROM table WHERE name LIKE '%$searchterm%' OR email LIKE
'%$searchterm%';

If you want to span the search across more fields, simply add them as extra
OR elements to the WHERE clause. 


 
 2) if i have a query that produces a number of rows, how/what would i need
 to do, to limit the number of rows displayed, and to allow the user to
 select a 'back/next' button that would generate/display the next 'N' items
 in the list/query results...
 
 if anybody could direct me to sample docs/code that kind of
 describes/solves
 what i've described, i'd appreciate it!!!

Here I'm making the assumption that you're using MySQL. If that's the case,
you need to familiarize yourself with the LIMIT clause. This allows you to
specify a starting point and number of rows to return for the resultset.

So, using the query above again:

$qry = SELECT * FROM table WHERE name LIKE '%$searchterm%' OR email LIKE
'%$searchterm%' LIMIT 0,10;

...will return the first 10 results from your query (records 0 to 9). Note
that the 'first' row is at position 0 in the recordset. Also note: if there
are less than 10 records returned by your query (ie in your example, only 2
match your pseudo request), only those records will be returned.

Then, issuing:

$qry = SELECT * FROM table WHERE name LIKE '%$searchterm%' OR email LIKE
'%$searchterm%' LIMIT 9,10;

...will return the next 10 results from your query (records 10 to 19), and
so on.

This requires you to pass some variables from one search result page to the
next, particularly the variable that indicates where the 'next' results
should begin, allowing you to factor that in when building the LIMIT clause
of the query string for the search results that should be displayed on that
page.

A Google search on PHP pagination or PHP paginate should return a number
of online resources explaining how to paginate results returned from a db
query in PHP.

Hope this helps.

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org

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



[PHP] Date/Time Display for recurring monthly event

2005-09-10 Thread [EMAIL PROTECTED]
Having a heck of time getting anything to work, can anyone make a suggestion
to the following.

I need a webpage that displays 5 recurring meeting dates, i.e. the second
Wednesday, Thursday, and Friday of each month in five different locations.

Is there an easy (meaning code only, without using a database connection)
way to get dates to display and automatically roll-over to the next months
date when the actual date changes?

Thanks in advance for the help.

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



[PHP] creating a login/registration/admin function/app

2005-09-10 Thread info
Hello Bruce,
I didn't want to sound like a walking advertisement on this list so I have 
sticky emailed specific information direct to you about your question and our 
answer. 

However, I DID want the list to know about a freeware ( LGPL license ) mini 
application that protects sensitive web pages with just one line of code (after 
self installation on any web server). This freeware app is called 
admin-login-only and it performs basic single user (administration) session 
based authentication. 

More info: http://www.globalissa.com/showcase.php?n=13p=15
FREE Download: http://www.globalissa.com/download.php?n=13p=15

We encourage commercial / or any use with the open ended LGPL license. The 
software is absolutely free.

Dave.
===
Bruce wrote:
hi...

i'm in the process of looking for/creating a function to allow me to perform
user login/registration/etc, as well as handle a user admin function.
snip

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



[PHP] PHP on FreeBSD - Compiler Bugs and Option selection

2005-09-10 Thread Vizion
Hi ale

I just wanted to check you had received OK the two compiler errors that I 
reported for /usr/ports/lang/php5-extensions.

The first error was apparently caused by make expecting  libmagic in an 
incorrect path for FreeBSD 5.3. Once a copy was placed in the correct path 
compilation resumed.

The second error seems also to be caused by an inability to find requisite 
files for wddx.
ext/xml/expat_compat.h
ext/xml/php

As a result of compiling php5 I began to wonder whether it  would be helpful 
to users if :
drwxr-xr-x  3 root  wheel 512 May  2 07:06 php5-cli
drwxr-xr-x  3 root  wheel 512 Sep  9 18:00 php5-extensions
drwxr-xr-x  3 root  wheel 512 May 28 10:06 php_doc
were more integrated as choices within make for php5.

I would personally find it helpful if all the build options for php could be 
in an editable file for sysadmins to define a repeatable unattended build 
from all available build options. A closer integration of the subsidiary php5 
ports into the php5 make would facilitate this process.

I do not not how welcome these proposals might be or how easy it would be to 
make the changes but would be interested to know what others think.

Norberto Meijome [EMAIL PROTECTED] made a very interesting suggestion that 
he uses on his servers to achieve the above goal. He 
uses /usr/local/etc/pkgtools.conf for that purpose but my preference would be 
to have a method that is particular to php and does not lead to an 
overloading of /usr/local/etc/pkgtools.conf.

I have copied Norbeto's example below: 
** Quote***
-if you want to avoid having to choose by hand what you really
-want( or have it preconfigured so all you have to do is press OK, then
-use something like /usr/local/etc/pkgtools.conf which will be read by
-portinstall (sysutils/port-maintenance-tools/)
-my relevant sections for my servers are:
-

-     'php4-*' =- [
-         'WITH_APACHE2=true',
-         'WITHOUT_DEBUG=true',
-         'WITH_BCMATH=true',
-         'WITH_BZ2=true',
-         'WITHOUT_CALENDAR=true',
-         'WITH_CRACK=true',
-         'WITH_CTYPE=true',
-         'WITHOUT_CURL=true',
-         'WITH_DBA=true',
-         'WITHOUT_DBASE=true',
-         'WITHOUT_DBX=true',
-         'WITHOUT_DIO=true',
-         'WITHOUT_DOMXML=true',
-         'WITHOUT_EXIF=true',
-         'WITHOUT_FILEINFO=true',
-         'WITHOUT_FILEPRO=true',
-         'WITHOUT_FRIBIDI=true',
-         'WITH_FTP=true',
-         'WITH_GD=true',
-         'WITHOUT_GETTEXT=true',
-         'WITHOUT_GMP=true',
-         'WITHOUT_ICONV=true',
-         'WITHOUT_IMAGICK=true',
-         'WITHOUT_IMAP=true',
-         'WITHOUT_INTERBASE=true',
-         'WITHOUT_LDAP=true',
-         'WITH_MBSTRING=true',
-         'WITHOUT_MCAL=true',
-         'WITH_MCRYPT=true',
-         'WITHOUT_MCVE=true',
-         'WITH_MHASH=true',
-         'WITHOUT_MING=true',
-         'WITHOUT_MNOGOSEARCH=true',
-         'WITHOUT_MSSQL=true',
-         'WITH_MYSQL=true',
-         'WITHOUT_NCURSES=true',
-         'WITHOUT_ODBC=true',
-         'WITHOUT_OPENSSL=true',
-         'WITHOUT_ORACLE=true',
-         'WITH_OVERLOAD=true',
-         'WITHOUT_PANDA=true',
-         'WITHOUT_PCNTL=true',
-         'WITH_PCRE=true',
-         'WITHOUT_PDF=true',
-         'WITHOUT_PGSQL=true',
-         'WITH_POSIX=true',
-         'WITHOUT_PSPELL=true',
-         'WITHOUT_READLINE=true',
-         'WITHOUT_RECODE=true',
-         'WITH_SESSION=true',
-         'WITH_SHMOP=true',
-         'WITHOUT_SNMP=true',
-         'WITHOUT_SOCKETS=true',
-         'WITHOUT_SYBASE_CT=true',
-         'WITH_SYSVMSG=true',
-         'WITH_SYSVSEM=true',
-         'WITH_SYSVSHM=true',
-         'WITH_TOKENIZER=true',
-         'WITHOUT_WDDX=true',
-         'WITH_XML=true',
-         'WITHOUT_XMLRPC=true',
-         'WITH_XSLT=true',
-         'WITHOUT_YAZ=true',
-         'WITHOUT_YP=true',
-         'WITH_ZIP=true',
-         'WITH_ZLIB=true',
-         ],
-     'php4-dba-*' =- [
-         'WITH_CDB=true',
-         'WITH_DB4=true',
-         'WITH_GDBM=true',
-         'WITH_INIFILE=true',
-         'WITH_FLATFILE=true',
-         ],
-     'php4-gd-*' =- [
-         'WITH_T1LIB=true',
-         'WITH_TRUETYPE=true',
-         'WITHOUT_JIS=true',
-         'WITH_LZW=true',
-         ],
-     'php4-mbstring-*' =- [
-         'WITH_REGEX=true',
-         ],
*End Quote***

I also wonder why the Makefile, by default, uses the --disable-all option in 
the Makefile with no option to remove it. 

I would be interested in what others have to say and would like to place on 
record my appreciation for all your work in maintaining the ports.

david

-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

--
PHP General Mailing 

[PHP] Re: PHP on FreeBSD - Compiler Bugs and Option selection

2005-09-10 Thread Vizion
On Saturday 10 September 2005 12:49,  the author Vizion contributed to the 
dialogue on-
 PHP on FreeBSD - Compiler Bugs and Option selection: 

Hi ale

I just wanted to check you had received OK the two compiler errors that I
reported for /usr/ports/lang/php5-extensions.

The first error was apparently caused by make expecting  libmagic in an
incorrect path for FreeBSD 5.3. Once a copy was placed in the correct path
compilation resumed.

I meant to say that full credit should be given to 
Kris Kennaway [EMAIL PROTECTED] who made the suggestion to 
copy /usr/src/contrib/file/magic.h to
/usr/include/magic.h 
and see if it works. Which it did.

The second error seems also to be caused by an inability to find requisite
files for wddx.
ext/xml/expat_compat.h
ext/xml/php

As a result of compiling php5 I began to wonder whether it  would be helpful
to users if :
drwxr-xr-x  3 root  wheel 512 May  2 07:06 php5-cli
drwxr-xr-x  3 root  wheel 512 Sep  9 18:00 php5-extensions
drwxr-xr-x  3 root  wheel 512 May 28 10:06 php_doc
were more integrated as choices within make for php5.

I would personally find it helpful if all the build options for php could be
in an editable file for sysadmins to define a repeatable unattended build
from all available build options. A closer integration of the subsidiary
 php5 ports into the php5 make would facilitate this process.

I do not not how welcome these proposals might be or how easy it would be to
make the changes but would be interested to know what others think.

Norberto Meijome [EMAIL PROTECTED] made a very interesting suggestion
 that he uses on his servers to achieve the above goal. He
uses /usr/local/etc/pkgtools.conf for that purpose but my preference would
 be to have a method that is particular to php and does not lead to an
overloading of /usr/local/etc/pkgtools.conf.

I have copied Norbeto's example below:
** Quote***
-if you want to avoid having to choose by hand what you really
-want( or have it preconfigured so all you have to do is press OK, then
-use something like /usr/local/etc/pkgtools.conf which will be read by
-portinstall (sysutils/port-maintenance-tools/)
-my relevant sections for my servers are:
-

-     'php4-*' =- [
-         'WITH_APACHE2=true',
-         'WITHOUT_DEBUG=true',
-         'WITH_BCMATH=true',
-         'WITH_BZ2=true',
-         'WITHOUT_CALENDAR=true',
-         'WITH_CRACK=true',
-         'WITH_CTYPE=true',
-         'WITHOUT_CURL=true',
-         'WITH_DBA=true',
-         'WITHOUT_DBASE=true',
-         'WITHOUT_DBX=true',
-         'WITHOUT_DIO=true',
-         'WITHOUT_DOMXML=true',
-         'WITHOUT_EXIF=true',
-         'WITHOUT_FILEINFO=true',
-         'WITHOUT_FILEPRO=true',
-         'WITHOUT_FRIBIDI=true',
-         'WITH_FTP=true',
-         'WITH_GD=true',
-         'WITHOUT_GETTEXT=true',
-         'WITHOUT_GMP=true',
-         'WITHOUT_ICONV=true',
-         'WITHOUT_IMAGICK=true',
-         'WITHOUT_IMAP=true',
-         'WITHOUT_INTERBASE=true',
-         'WITHOUT_LDAP=true',
-         'WITH_MBSTRING=true',
-         'WITHOUT_MCAL=true',
-         'WITH_MCRYPT=true',
-         'WITHOUT_MCVE=true',
-         'WITH_MHASH=true',
-         'WITHOUT_MING=true',
-         'WITHOUT_MNOGOSEARCH=true',
-         'WITHOUT_MSSQL=true',
-         'WITH_MYSQL=true',
-         'WITHOUT_NCURSES=true',
-         'WITHOUT_ODBC=true',
-         'WITHOUT_OPENSSL=true',
-         'WITHOUT_ORACLE=true',
-         'WITH_OVERLOAD=true',
-         'WITHOUT_PANDA=true',
-         'WITHOUT_PCNTL=true',
-         'WITH_PCRE=true',
-         'WITHOUT_PDF=true',
-         'WITHOUT_PGSQL=true',
-         'WITH_POSIX=true',
-         'WITHOUT_PSPELL=true',
-         'WITHOUT_READLINE=true',
-         'WITHOUT_RECODE=true',
-         'WITH_SESSION=true',
-         'WITH_SHMOP=true',
-         'WITHOUT_SNMP=true',
-         'WITHOUT_SOCKETS=true',
-         'WITHOUT_SYBASE_CT=true',
-         'WITH_SYSVMSG=true',
-         'WITH_SYSVSEM=true',
-         'WITH_SYSVSHM=true',
-         'WITH_TOKENIZER=true',
-         'WITHOUT_WDDX=true',
-         'WITH_XML=true',
-         'WITHOUT_XMLRPC=true',
-         'WITH_XSLT=true',
-         'WITHOUT_YAZ=true',
-         'WITHOUT_YP=true',
-         'WITH_ZIP=true',
-         'WITH_ZLIB=true',
-         ],
-     'php4-dba-*' =- [
-         'WITH_CDB=true',
-         'WITH_DB4=true',
-         'WITH_GDBM=true',
-         'WITH_INIFILE=true',
-         'WITH_FLATFILE=true',
-         ],
-     'php4-gd-*' =- [
-         'WITH_T1LIB=true',
-         'WITH_TRUETYPE=true',
-         'WITHOUT_JIS=true',
-         'WITH_LZW=true',
-         ],
-     'php4-mbstring-*' =- [
-         'WITH_REGEX=true',
-         ],
*End Quote***

I also wonder why the Makefile, by default, uses the --disable-all option in
the Makefile with no option to remove it.

I would be interested in what others have to say and would like to place on

[PHP] Re: PHP on FreeBSD - Compiler Bugs and Option selection

2005-09-10 Thread Vizion
On Saturday 10 September 2005 12:53,  the author Vizion contributed to the 
dialogue on-
 Re: PHP on FreeBSD - Compiler Bugs and Option selection: 

On Saturday 10 September 2005 12:49,  the author Vizion contributed to the
dialogue on-

 PHP on FreeBSD - Compiler Bugs and Option selection:
Hi ale

I just wanted to check you had received OK the two compiler errors that I
reported for /usr/ports/lang/php5-extensions.

The first error was apparently caused by make expecting  libmagic in an
incorrect path for FreeBSD 5.3. Once a copy was placed in the correct path
compilation resumed.

I meant to say that full credit should be given to
Kris Kennaway [EMAIL PROTECTED] who made the suggestion to
copy /usr/src/contrib/file/magic.h to
/usr/include/magic.h
and see if it works. Which it did.

The second error seems also to be caused by an inability to find requisite
files for wddx.
ext/xml/expat_compat.h
ext/xml/php

As a result of compiling php5 I began to wonder whether it  would be
 helpful to users if :
drwxr-xr-x  3 root  wheel 512 May  2 07:06 php5-cli
drwxr-xr-x  3 root  wheel 512 Sep  9 18:00 php5-extensions
drwxr-xr-x  3 root  wheel 512 May 28 10:06 php_doc
were more integrated as choices within make for php5.

I would personally find it helpful if all the build options for php could
 be in an editable file for sysadmins to define a repeatable unattended
 build from all available build options. A closer integration of the
 subsidiary php5 ports into the php5 make would facilitate this process.

I do not not how welcome these proposals might be or how easy it would be
 to make the changes but would be interested to know what others think.

Norberto Meijome [EMAIL PROTECTED] made a very interesting suggestion
 that he uses on his servers to achieve the above goal. He
uses /usr/local/etc/pkgtools.conf for that purpose but my preference would
 be to have a method that is particular to php and does not lead to an
overloading of /usr/local/etc/pkgtools.conf.

I have copied Norbeto's example below:
** Quote***
-if you want to avoid having to choose by hand what you really
-want( or have it preconfigured so all you have to do is press OK, then
-use something like /usr/local/etc/pkgtools.conf which will be read by
-portinstall (sysutils/port-maintenance-tools/)
-my relevant sections for my servers are:
-

-     'php4-*' =- [
-         'WITH_APACHE2=true',
-         'WITHOUT_DEBUG=true',
-         'WITH_BCMATH=true',
-         'WITH_BZ2=true',
-         'WITHOUT_CALENDAR=true',
-         'WITH_CRACK=true',
-         'WITH_CTYPE=true',
-         'WITHOUT_CURL=true',
-         'WITH_DBA=true',
-         'WITHOUT_DBASE=true',
-         'WITHOUT_DBX=true',
-         'WITHOUT_DIO=true',
-         'WITHOUT_DOMXML=true',
-         'WITHOUT_EXIF=true',
-         'WITHOUT_FILEINFO=true',
-         'WITHOUT_FILEPRO=true',
-         'WITHOUT_FRIBIDI=true',
-         'WITH_FTP=true',
-         'WITH_GD=true',
-         'WITHOUT_GETTEXT=true',
-         'WITHOUT_GMP=true',
-         'WITHOUT_ICONV=true',
-         'WITHOUT_IMAGICK=true',
-         'WITHOUT_IMAP=true',
-         'WITHOUT_INTERBASE=true',
-         'WITHOUT_LDAP=true',
-         'WITH_MBSTRING=true',
-         'WITHOUT_MCAL=true',
-         'WITH_MCRYPT=true',
-         'WITHOUT_MCVE=true',
-         'WITH_MHASH=true',
-         'WITHOUT_MING=true',
-         'WITHOUT_MNOGOSEARCH=true',
-         'WITHOUT_MSSQL=true',
-         'WITH_MYSQL=true',
-         'WITHOUT_NCURSES=true',
-         'WITHOUT_ODBC=true',
-         'WITHOUT_OPENSSL=true',
-         'WITHOUT_ORACLE=true',
-         'WITH_OVERLOAD=true',
-         'WITHOUT_PANDA=true',
-         'WITHOUT_PCNTL=true',
-         'WITH_PCRE=true',
-         'WITHOUT_PDF=true',
-         'WITHOUT_PGSQL=true',
-         'WITH_POSIX=true',
-         'WITHOUT_PSPELL=true',
-         'WITHOUT_READLINE=true',
-         'WITHOUT_RECODE=true',
-         'WITH_SESSION=true',
-         'WITH_SHMOP=true',
-         'WITHOUT_SNMP=true',
-         'WITHOUT_SOCKETS=true',
-         'WITHOUT_SYBASE_CT=true',
-         'WITH_SYSVMSG=true',
-         'WITH_SYSVSEM=true',
-         'WITH_SYSVSHM=true',
-         'WITH_TOKENIZER=true',
-         'WITHOUT_WDDX=true',
-         'WITH_XML=true',
-         'WITHOUT_XMLRPC=true',
-         'WITH_XSLT=true',
-         'WITHOUT_YAZ=true',
-         'WITHOUT_YP=true',
-         'WITH_ZIP=true',
-         'WITH_ZLIB=true',
-         ],
-     'php4-dba-*' =- [
-         'WITH_CDB=true',
-         'WITH_DB4=true',
-         'WITH_GDBM=true',
-         'WITH_INIFILE=true',
-         'WITH_FLATFILE=true',
-         ],
-     'php4-gd-*' =- [
-         'WITH_T1LIB=true',
-         'WITH_TRUETYPE=true',
-         'WITHOUT_JIS=true',
-         'WITH_LZW=true',
-         ],
-     'php4-mbstring-*' =- [
-         'WITH_REGEX=true',
-         ],
*End Quote***

I also wonder why the Makefile, by default,