Re: [PHP] Array problem

2010-10-28 Thread Richard Quadling
On 27 October 2010 22:15, Kevin Kinsey  wrote:
> Marc Guay wrote:
>>>
>>> As Nicholas pointed out, the extra underscore in the key is the issue.
>>
>> That's way too easy a fix.  I think he should check to make sure his
>> version of PHP was compiled with the right extensions and that the
>> browser isn't doing something unpredictably bizarre when submitting
>> the form.
>
> Just checked the card file, today's cause is: Sunspots.
>
> KDK
>

I always believed that cosmic radiation was the cause.


-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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



RE: [PHP] Documentation

2010-10-28 Thread Jay Blanchard
[snip]...[/snip]

http://evolt.org/node/21173

This is an article that I wrote long ago (it needs some severe updating)
that speaks to a lot of the phases of documentation. Any application
typically has several audiences; developers, administrators, supporters
and users are just an example of the audiences that can be involved.
Each audience requires their own unique set of documentation. Hope this
helps. 

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



RE: [PHP] Array problem

2010-10-28 Thread Bob McConnell
From: Richard Quadling

> On 27 October 2010 22:15, Kevin Kinsey  wrote:
>> Marc Guay wrote:

 As Nicholas pointed out, the extra underscore in the key is the issue.
>>>
>>> That's way too easy a fix.  I think he should check to make sure his
>>> version of PHP was compiled with the right extensions and that the
>>> browser isn't doing something unpredictably bizarre when submitting
>>> the form.
>>
>> Just checked the card file, today's cause is: Sunspots.
> 
> I always believed that cosmic radiation was the cause.

I'll second the cosmic radiation. We are currently in the low activity portion 
of the 11 year sunspot cycle[1], and predictions of the next high are lower 
than most cycles recorded over the past century[2]. So that one is not an easy 
sell right now.

Bob McConnell

[1] 
[2] 

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



[PHP] PHP Question

2010-10-28 Thread Paulo Work

Hello my name is Paulo Carvalho and I am struggling with the following:

I am building a website with basic CMS functionality.
My problem is that in one of the pages I am using Easyslider to display 
small comments about the clients.


These comments are divided in 3 per slide.
ex:(
comment 1/p>
comment 1/p>
comment 1/p>
)

Now I am struggling with the following:
I am pulling the comments from the db and I would like to know if i can 
split that array in 3's (array_slice) perhaps?


My goal is to within a foreach loop output 3 comments within a 
slide(wrapped in ), so first 3 would output:


(
comment 1/p>
comment 2/p>
comment 3/p>
)
Then another 3

(
comment 4/p>
comment 5/p>
comment 6/p>
)
Thank in advance for all the replies.
Paulo carvalho

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



[PHP] form post question

2010-10-28 Thread Jack
I have a form which has the following: ( quick clip )

 

  http://www.abc.com/processing/process_form.php"; onSubmit="return
preSubmit();">

 

 



Peer Guide

  

  



 

When the form runs process_form.php it emails the content and has several
other fields from the form, but I have some fields like the one above that
don't show up in the result.  The script that builds the message looks like
the below

 

$temp_message .= "Area(s) of Interest: ".
$_POST['area_interest'] ."\n";

 

Is there anything obvious that I am missing?

 

Is there a way for me to show all the fields from the form, and their field
names which are received by process_form?

 

 

Thanks!

Jack

 



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



Re: [PHP] form post question

2010-10-28 Thread Bastien Koert
On Thu, Oct 28, 2010 at 10:12 AM, Jack  wrote:
> I have a form which has the following: ( quick clip )
>
>
>
>   action="http://www.abc.com/processing/process_form.php"; onSubmit="return
> preSubmit();">
>
>
>
>     
>
>                 value="Peer Guide" />
>
>                Peer Guide
>
>              
>
>              
>
> 
>
>
>
> When the form runs process_form.php it emails the content and has several
> other fields from the form, but I have some fields like the one above that
> don't show up in the result.  The script that builds the message looks like
> the below
>
>
>
> $temp_message .= "Area(s) of Interest: ".
> $_POST['area_interest'] ."\n";
>
>
>
> Is there anything obvious that I am missing?
>
>
>
> Is there a way for me to show all the fields from the form, and their field
> names which are received by process_form?
>
>
>
>
>
> Thanks!
>
> Jack
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Check boxes (assuming you have more than one in the set) are generally
coming in as an array. You can see this by running this

echo "";
print_r($_POST);
echo "";

to see the entire post array

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] form post question

2010-10-28 Thread Floyd Resler

On Oct 28, 2010, at 10:12 AM, Jack wrote:

> I have a form which has the following: ( quick clip )
> 
> 
> 
>   action="http://www.abc.com/processing/process_form.php"; onSubmit="return
> preSubmit();">
> 
> 
> 
> 
> 
> value="Peer Guide" />
> 
>Peer Guide
> 
>  
> 
>  
> 
> 
> 
> 
> 
> When the form runs process_form.php it emails the content and has several
> other fields from the form, but I have some fields like the one above that
> don't show up in the result.  The script that builds the message looks like
> the below
> 
> 
> 
> $temp_message .= "Area(s) of Interest: ".
> $_POST['area_interest'] ."\n";
> 
> 
> 
> Is there anything obvious that I am missing?
> 
> 
> 
> Is there a way for me to show all the fields from the form, and their field
> names which are received by process_form?
> 
> 
> 
> 
> 
> Thanks!
> 
> Jack

If it's a single checkbox and it's not not checked, nothing will come through.  
However, if it is a series of checkbox with the same name then you will need to 
do this:


Notice I changed area_interest to area_interest[].  This way any checkboxes 
that are checked will be passed as an array.

Take care,
Floyd


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



Re: [PHP] form post question

2010-10-28 Thread Kevin Kinsey

Bastien Koert wrote:

On Thu, Oct 28, 2010 at 10:12 AM, Jack  wrote:

I have a form which has the following: ( quick clip )

 http://www.abc.com/processing/process_form.php"; onSubmit="return
preSubmit();">


   
   Peer Guide
 
 


When the form runs process_form.php it emails the content and has several
other fields from the form, but I have some fields like the one above that
don't show up in the result.  The script that builds the message looks like
the below

$temp_message .= "Area(s) of Interest: ".
$_POST['area_interest'] ."\n";

Is there anything obvious that I am missing?

Is there a way for me to show all the fields from the form, and their field
names which are received by process_form?

Thanks!
Jack



Check boxes (assuming you have more than one in the set) are generally
coming in as an array. You can see this by running this

echo "";
print_r($_POST);
echo "";

to see the entire post array


+1 for Bastien; print_r() and var_dump() are the keys to debugging.
See http://www.phpbuilder.com/board/showthread.php?s=&threadid=10240608
for a decent overview of same.

And I guess you could reinvent the wheel, or actually process your
POSTed data, with foreach():

// Roll your own print_r()
   foreach ($_POST as $p => $q) {
  echo $p. "-".$q. "";
   }

// Or do_something_useful()
   foreach ($_POST as $p => $q) {
  do_something_useful($p,$q);
   }


HTH,
KDK

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



Re: [PHP] PHP Question

2010-10-28 Thread Kevin Kinsey

Paulo Work wrote:

Hello, Paulo!


I am building a website with basic CMS functionality.
My problem is that in one of the pages I am using Easyslider to display 
small comments about the clients.


These comments are divided in 3 per slide.
ex:(
comment 1/p>
comment 1/p>
comment 1/p>
)

I am pulling the comments from the db and I would like to know if i can 
split that array in 3's (array_slice) perhaps?


My goal is to within a foreach loop output 3 comments within a 
slide(wrapped in ), so first 3 would output:


(
comment 1/p>
comment 2/p>
comment 3/p>
)
Then another 3


I'm a hacker, so this is a HACK:


comment 1
comment 2
comment 3
)";

$lines=explode("\n",$data);
array_shift($lines);
array_pop($lines);
print_r($lines);

?>

I'll leave it to the big boys to debate and devise more elegant
solutions.

Kevin Kinsey

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



[PHP] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread Don Wieland

Hi gang,

I use a Project Management System (PM) that generates emails to my  
account. I can REPLY to that email and it will be inserted into the  
PM. I believe the ID is in the subject. I assume the email is sent to  
a specified email and there is a CRON JOB that runs a PHP script to  
query and parse the new emails and insert them in to DB.


Obviously a cool feature, that I want to use in a few of my web apps.  
Anyone have any tips/resource links or a product I can use to do this.


Any feedback is appreciated!

Don

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



Re: [PHP] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread Bastien Koert
On Thu, Oct 28, 2010 at 1:24 PM, Don Wieland  wrote:
> Hi gang,
>
> I use a Project Management System (PM) that generates emails to my account.
> I can REPLY to that email and it will be inserted into the PM. I believe the
> ID is in the subject. I assume the email is sent to a specified email and
> there is a CRON JOB that runs a PHP script to query and parse the new emails
> and insert them in to DB.
>
> Obviously a cool feature, that I want to use in a few of my web apps. Anyone
> have any tips/resource links or a product I can use to do this.
>
> Any feedback is appreciated!
>
> Don
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

This article from evolt is a great place to start

http://evolt.org/incoming_mail_and_php?from=50&comments_per_page=50

Reading from an email box is not tough.

-- 

Bastien

Cat, the other other white meat

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



Re: [PHP] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Oh yeah one other thing that confused me at first...

The various articles talk about having PHP installed as CGI, but all modern PHP 
installs include PHP command line interface (CLI). This serves the same 
purpose. No CGI required.

On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

> Hi gang,
> 
> I use a Project Management System (PM) that generates emails to my account. I 
> can REPLY to that email and it will be inserted into the PM. I believe the ID 
> is in the subject. I assume the email is sent to a specified email and there 
> is a CRON JOB that runs a PHP script to query and parse the new emails and 
> insert them in to DB.
> 
> Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
> have any tips/resource links or a product I can use to do this.
> 
> Any feedback is appreciated!
> 
> Don
> 
> -- 
> 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] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Weird! I just got back on this list by accident last night and I just happen to 
be writing one of these this moment.

The general scheme is:

-Create a mail alias that points to a PHP cli script.

-Write a script that parses out the DB stuff you need etc. (How hard can that 
be!?)

No need for cron or anything unless you expect heavy traffic and need to manage 
a queue.

It is a really cool feature. Next I need to handle attachments.

Google has some good stuff on this.

Good luck, Phred


On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

> Hi gang,
> 
> I use a Project Management System (PM) that generates emails to my account. I 
> can REPLY to that email and it will be inserted into the PM. I believe the ID 
> is in the subject. I assume the email is sent to a specified email and there 
> is a CRON JOB that runs a PHP script to query and parse the new emails and 
> insert them in to DB.
> 
> Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
> have any tips/resource links or a product I can use to do this.
> 
> Any feedback is appreciated!
> 
> Don
> 
> -- 
> 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] Reply to an EMAIL get posted in a mySQL TABLE

2010-10-28 Thread PW
Weird! I just got back on this list by accident last night and I just happen to 
be writing one of these this moment.

The general scheme is:

-Create a mail alias that points to a PHP cli script.

-Write a script that parses out the DB stuff you need etc. (How hard can that 
be!?)

No need for cron or anything unless you expect heavy traffic and need to manage 
a queue.

It is a really cool feature. Next I need to handle attachments.

Google has some good stuff on this.

Good luck, Phred


On Oct 28, 2010, at 12:24 PM, Don Wieland wrote:

> Hi gang,
> 
> I use a Project Management System (PM) that generates emails to my account. I 
> can REPLY to that email and it will be inserted into the PM. I believe the ID 
> is in the subject. I assume the email is sent to a specified email and there 
> is a CRON JOB that runs a PHP script to query and parse the new emails and 
> insert them in to DB.
> 
> Obviously a cool feature, that I want to use in a few of my web apps. Anyone 
> have any tips/resource links or a product I can use to do this.
> 
> Any feedback is appreciated!
> 
> Don
> 
> -- 
> 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] PHP with POSIX style message queues (mq_open() and friends)

2010-10-28 Thread Jameson Williams
Hello,

I need some way to interact with a POSIX message queue from PHP. I am
already aware that the PHP library provides for manipulation of Sys V style
queues (msg_get_queue(), etc.), but I cannot change the queue. I am hoping
to accomplish this capability in a portable way, avoiding external
dependencies if possible. So far, these are two solutions I have thought of:

* Build a PHP extension which exposes these functions.
* Build a set of wrapper binaries that can be called via shell_exec() or
shell()

For performance reasons, the second is nearly a non-option. Is, then, the
first option the only way to go about this?

Thank you,
Jameson Williams
*
*


Re: [PHP] PHP Question

2010-10-28 Thread Jim Lucas
Paulo Work wrote:
> Hello my name is Paulo Carvalho and I am struggling with the following:
> 
> I am building a website with basic CMS functionality.
> My problem is that in one of the pages I am using Easyslider to display
> small comments about the clients.
> 
> These comments are divided in 3 per slide.
> ex:(
> comment 1/p>
> comment 1/p>
> comment 1/p>
> )
> 
> Now I am struggling with the following:
> I am pulling the comments from the db and I would like to know if i can
> split that array in 3's (array_slice) perhaps?
> 
> My goal is to within a foreach loop output 3 comments within a
> slide(wrapped in ), so first 3 would output:
> 
> (
> comment 1/p>
> comment 2/p>
> comment 3/p>
> )
> Then another 3
> 
> (
> comment 4/p>
> comment 5/p>
> comment 6/p>
> )
> Thank in advance for all the replies.
> Paulo carvalho
> 

This looks like a job for modulo man.

I was hoping to simply give you a list of examples from google, but I couldn't
find any that showed exactly what you were trying to do, so... I wrote this
article for my site.  Let me know if you have any questions.

http://www.bendsource.com/phpModulo


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



Re: [PHP] PHP with POSIX style message queues (mq_open() and friends)

2010-10-28 Thread Nathan Nobbe
On Thu, Oct 28, 2010 at 12:52 PM, Jameson Williams <
jame...@jamesonwilliams.com> wrote:

> Hello,
>
> I need some way to interact with a POSIX message queue from PHP. I am
> already aware that the PHP library provides for manipulation of Sys V style
> queues (msg_get_queue(), etc.), but I cannot change the queue. I am hoping
> to accomplish this capability in a portable way, avoiding external
> dependencies if possible. So far, these are two solutions I have thought
> of:
>
> * Build a PHP extension which exposes these functions.
> * Build a set of wrapper binaries that can be called via shell_exec() or
> shell()
>
> For performance reasons, the second is nearly a non-option. Is, then, the
> first option the only way to go about this?
>

wouldn't calling the wrapper binaries via exec() be faster w/o the shell
overhead?

-nathan