php-general Digest 29 Oct 2010 19:06:09 -0000 Issue 7011
Topics (messages 309128 through 309144):
Re: Documentation
309128 by: Jay Blanchard
Re: Array problem
309129 by: Bob McConnell
PHP Question
309130 by: Paulo Work
309135 by: Kevin Kinsey
309142 by: Jim Lucas
form post question
309131 by: Jack
309132 by: Bastien Koert
309133 by: Floyd Resler
309134 by: Kevin Kinsey
Reply to an EMAIL get posted in a mySQL TABLE
309136 by: Don Wieland
309137 by: Bastien Koert
309138 by: PW
309139 by: PW
309140 by: PW
PHP with POSIX style message queues (mq_open() and friends)
309141 by: Jameson Williams
309143 by: Nathan Nobbe
Watermark with GD
309144 by: Gary
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:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
[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.
--- End Message ---
--- Begin Message ---
From: Richard Quadling
> On 27 October 2010 22:15, Kevin Kinsey <[email protected]> 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] <http://www.windows2universe.org/sun/activity/sunspot_cycle.html>
[2] <http://solarscience.msfc.nasa.gov/predict.shtml>
--- End Message ---
--- Begin Message ---
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:(<li>
<p>comment 1/p>
<p>comment 1/p>
<p>comment 1/p>
</li>)
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 <li>), so first 3 would output:
(<li>
<p>comment 1/p>
<p>comment 2/p>
<p>comment 3/p>
</li>)
Then another 3
(<li>
<p>comment 4/p>
<p>comment 5/p>
<p>comment 6/p>
</li>)
Thank in advance for all the replies.
Paulo carvalho
--- End Message ---
--- Begin Message ---
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:(<li>
<p>comment 1/p>
<p>comment 1/p>
<p>comment 1/p>
</li>)
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 <li>), so first 3 would output:
(<li>
<p>comment 1/p>
<p>comment 2/p>
<p>comment 3/p>
</li>)
Then another 3
I'm a hacker, so this is a HACK:
<?php
$data="(<li>
<p>comment 1</p>
<p>comment 2</p>
<p>comment 3</p>
</li>)";
$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
--- End Message ---
--- Begin Message ---
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:(<li>
> <p>comment 1/p>
> <p>comment 1/p>
> <p>comment 1/p>
> </li>)
>
> 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 <li>), so first 3 would output:
>
> (<li>
> <p>comment 1/p>
> <p>comment 2/p>
> <p>comment 3/p>
> </li>)
> Then another 3
>
> (<li>
> <p>comment 4/p>
> <p>comment 5/p>
> <p>comment 6/p>
> </li>)
> 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
--- End Message ---
--- Begin Message ---
I have a form which has the following: ( quick clip )
<form id="form1" name="form1" method="post"
action="http://www.abc.com/processing/process_form.php" onSubmit="return
preSubmit();">
<label>
<input name="area_interest" type="checkbox" id="field13"
value="Peer Guide" />
Peer Guide</label>
<br />
<label>
<input type="submit" value="Submit" />
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
--- End Message ---
--- Begin Message ---
On Thu, Oct 28, 2010 at 10:12 AM, Jack <[email protected]> wrote:
> I have a form which has the following: ( quick clip )
>
>
>
> <form id="form1" name="form1" method="post"
> action="http://www.abc.com/processing/process_form.php" onSubmit="return
> preSubmit();">
>
>
>
> <label>
>
> <input name="area_interest" type="checkbox" id="field13"
> value="Peer Guide" />
>
> Peer Guide</label>
>
> <br />
>
> <label>
>
> <input type="submit" value="Submit" />
>
>
>
> 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 "<pre>";
print_r($_POST);
echo "</pre>";
to see the entire post array
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
On Oct 28, 2010, at 10:12 AM, Jack wrote:
> I have a form which has the following: ( quick clip )
>
>
>
> <form id="form1" name="form1" method="post"
> action="http://www.abc.com/processing/process_form.php" onSubmit="return
> preSubmit();">
>
>
>
> <label>
>
> <input name="area_interest" type="checkbox" id="field13"
> value="Peer Guide" />
>
> Peer Guide</label>
>
> <br />
>
> <label>
>
> <input type="submit" value="Submit" />
>
>
>
> 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:
<input name="area_interest[]" type="checkbox" id="field13" value="Peer Guide" />
Notice I changed area_interest to area_interest[]. This way any checkboxes
that are checked will be passed as an array.
Take care,
Floyd
--- End Message ---
--- Begin Message ---
Bastien Koert wrote:
On Thu, Oct 28, 2010 at 10:12 AM, Jack <[email protected]> wrote:
I have a form which has the following: ( quick clip )
<form id="form1" name="form1" method="post"
action="http://www.abc.com/processing/process_form.php" onSubmit="return
preSubmit();">
<label>
<input name="area_interest" type="checkbox" id="field13"
value="Peer Guide" />
Peer Guide</label>
<br />
<label>
<input type="submit" value="Submit" />
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 "<pre>";
print_r($_POST);
echo "</pre>";
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. "<br />";
}
// Or do_something_useful()
foreach ($_POST as $p => $q) {
do_something_useful($p,$q);
}
HTH,
KDK
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
On Thu, Oct 28, 2010 at 1:24 PM, Don Wieland <[email protected]> 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
--- End Message ---
--- Begin Message ---
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
>
--- End Message ---
--- Begin Message ---
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
>
--- End Message ---
--- Begin Message ---
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
>
--- End Message ---
--- Begin Message ---
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
*
*
--- End Message ---
--- Begin Message ---
On Thu, Oct 28, 2010 at 12:52 PM, Jameson Williams <
[email protected]> 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
--- End Message ---
--- Begin Message ---
I am trying to get the watermark to work, however I am having a problem in
that the image is being called from a database (image sits in images file).
The script in question is this
$image = imagecreatefromjpeg($_GET['src']);
However it produces an error message of
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: Filename
cannot be empty in /home/content/a/l/i/alinde52/html/imagesDetail.php on
line 233
I have tried various methods, for example: ($_GET ['images/'] or ($_GET
['images/$row_WADAimages["image_id"]].
Can anyone shed some light on this for me.
Thank you
Gary
__________ Information from ESET Smart Security, version of virus signature
database 5575 (20101029) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---