php-general Digest 4 Dec 2008 07:36:37 -0000 Issue 5825

2008-12-03 Thread php-general-digest-help
php-general Digest 4 Dec 2008 07:36:37 - Issue 5825 Topics (messages 284064 through 284080): Re: adding key- value pair to an array 284064 by: Yeti 284065 by: Jencisson Tsu $_POST suddenly empty; $_GET and _$REQUEST fine 284066 by: Alex Kirk 284067 by:

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread Yeti
I have enough trouble getting my rather ancient brain around PHP, and was hoping that I could avoid getting involved with JavaScript. However it seems that it, or CSS, are the only possibilities for this case. If I understood you correctly what you want is to change the style of the page when

[PHP] imap4 search criterias

2008-12-03 Thread Ergün Koray
Hello, I have a Fedora Core 9 system with php 5.2.5 and imap enabled. A little program that uses imap_search results in this error. Does the current php version support imap4 search criterias ? Thanks for your help. Here is the little program : ?php $mbox =

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread Yeti
How should I proceed? Thanks in advance for any suggestions. Since you are looping through the result already, why not do it this way .. $combinedArray = array(); for ($i=0;$icount($myArray);$i++) { $sql = SELECT study,symbol FROM test WHERE study IN ('$myArray[$i]'); $result =

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread Ashley Sheridan
On Wed, 2008-12-03 at 08:00 +0100, Maciek Sokolewicz wrote: Clancy wrote: Oh? Unfortunately I have had great difficulty trying to find out how things really work, as all the books I have seen are recipe books, which tell you how to achieve particular results, but not what is going

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread Yeti
Correcting myself now .. $myArray = array('b2005', 'b2008'); $sql = SELECT study,symbol FROM test WHERE study IN ('$myArray[$i]'); $result = mysql_query($sql); if(mysql_num_rows($result) 0) { while ($myrow = mysql_fetch_array($result)) { if (in_array($myrow['study'], $myArray))

Re: [PHP] Objects and Arrays Conversion

2008-12-03 Thread Nathan Nobbe
On Tue, Dec 2, 2008 at 7:48 PM, Micah Gersten [EMAIL PROTECTED] wrote: VamVan wrote: Hello All, I was stuck with this issue. So just felt the need to reach out to other strugglers. May be people might enjoy this: Here is the code for object to array and array to object conversion:

[PHP] adding key- value pair to an array

2008-12-03 Thread Aniketto
Hi all, Can anybody tell me how can I add key-value pair in an array. My code is as follows $criteria = array(); $criteria['mail_subject'] = $form-subject-getValue(); $criteria['delivery_user_name'] = $form-delivery_user_name-getValue(); $criteria['start_date'] = $form-start_date-getValue();

[PHP] adding key- value pair to an array

2008-12-03 Thread Aniketto
Hi all, Can anybody tell me how can I add key-value pair in an array. My code is as follows $criteria = array(); $criteria['mail_subject'] = $form-subject-getValue(); $criteria['delivery_user_name'] = $form-delivery_user_name-getValue(); $criteria['start_date'] = $form-start_date-getValue();

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread Clancy
On Wed, 03 Dec 2008 08:15:14 +, [EMAIL PROTECTED] (Ashley Sheridan) wrote: Go with what Yeti said. The browser will automatically pick the right stylesheet when the user presses the print button or you issue a window.print() from Javascript. Whatever you do, don't have a separate page for

Re: [PHP] adding key- value pair to an array

2008-12-03 Thread Yeti
//for each row I want to add percentage as new key-value pair // but it gives error 'Undefined variable: percentage' $row-$percentage = ($browseCount / $totalCount ) * 100; Obviously you get the error because $percentage is not defined .. I did not

[PHP] Re: Accessing the 'media' attribute in php

2008-12-03 Thread Colin Guthrie
'Twas brillig, and Ashley Sheridan at 03/12/08 08:15 did gyre and gimble: Whatever you do, don't have a separate page for print view. This is one of those things that some bright spark thought to do on a site at work, and the site in question was already a couple hundred HTML pages, so he

Re: [PHP] imap4 search criterias

2008-12-03 Thread Richard Heyes
I have a Fedora Core 9 system with php 5.2.5 and imap enabled. A little program that uses imap_search results in this error. Does the current php version support imap4 search criterias ? It does, and has done for a while. I used it my Vwebmail application (which I no longer have I'm afraid).

[PHP] Picture downloading in IE

2008-12-03 Thread HostWare Kft.
Hi, I have a strange error / misfunction with PHP header and IE7. I render a JPG from a database BLOB to show it on a page. In Firefox, when the user clicks on the image, and selects Save image as... , (s)he can download it in JPG format. But when a user in IE7 does the same, (s)he only can

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread Michael Kubler
A couple of sites about making CSS print stylesheets. http://www.alistapart.com/articles/goingtoprint/ http://www.webdesignschoolreview.com/css-printing.html I'd send you links to more, but my Internet connection is shaped, and it's too slow to look through many more. Michael Kubler *G*rey

Re: [PHP] Picture downloading in IE

2008-12-03 Thread HostWare Kft.
I don't think, because it happens on different machines, with different users. (one of them is a fresh install) SanTa - Original Message - From: Ramesh Thiruchelvam To: Sándor Tamás (HostWare Kft. ) Sent: Wednesday, December 03, 2008 12:05 PM Subject: Re: [PHP] Picture

Re: [PHP] Picture downloading in IE

2008-12-03 Thread mike
I've seen this issue on a normally healthy machine. I think it's a memory issue, or IE just corrupting itself sometimes. I don't change anything and it seems to go away (probably fresh browser session) Although I am sure invalid/confusing headers won't help. On Wed, Dec 3, 2008 at 3:08 AM,

Re: [PHP] imap4 search criterias

2008-12-03 Thread Ergün Koray
Thanks for the quick reply, There is no SENTSINCE keyword in the critera parameter section, so I believe that no SENTSINCE queries can be performed againts the server. The problem with the SINCE keyword is that it returns the wrong results. On Wed, Dec 3, 2008 at 12:07 PM, Richard Heyes [EMAIL

Re: [PHP] Accessing the 'media' attribute in php

2008-12-03 Thread ceo
but I gather from your reply that the browser issues the new (printer) page without reference to the server. Is this what actually happens? Yes, this is what actually happens for the browser print button. You could do something like a Printer Friendly button to generate a PDF on the

RE: [PHP] How to type arguments

2008-12-03 Thread ceo
I'm surprised nobody mentioned: http://php.net/assert in this thread yet. Perhaps I missed it? You should really consider doing this: 1) At the outer API layer, do a typecast (possibly with preg_match first) to convert the input data to acceptable form. 2) For inner API layer[s],

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread Andrej Kastrin
Thanks Yeti, it works. Best, Andrej Yeti wrote: Correcting myself now .. $myArray = array('b2005', 'b2008'); $sql = SELECT study,symbol FROM test WHERE study IN ('$myArray[$i]'); $result = mysql_query($sql); if(mysql_num_rows($result) 0) { while ($myrow = mysql_fetch_array($result)) {

Re: [PHP] imap4 search criterias

2008-12-03 Thread ceo
As I recall, there needs to be a \SENTSINCE instead of just SENTSINCE, and the PHP online manual ended up stripping out the \ business... Or maybe that was in some kind of flags somewhere else... Check the user contributed notes -- Those are invaluable for what can go wrong type of

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread ceo
I actually would do more like: $myArray[$study][$symbol] = true; No need to call in_array. Probably won't matter, really, but it's a good practice for when you end up doing the same kind of code for an array with thousands of elements. -- PHP General Mailing List

Re: [PHP] SELECT into array of arrays

2008-12-03 Thread Yeti
And yet another thing i have overseen in my statement .. If you remove the first for loop, also change the sql query. But I'm sure you saw that already NEW QUERY: $sql = SELECT study,symbol FROM test WHERE study IN ('.implode(', ', $myArray).'); -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] adding key- value pair to an array

2008-12-03 Thread Jim Lucas
Yeti wrote: //for each row I want to add percentage as new key-value pair // but it gives error 'Undefined variable: percentage' $row-$percentage = ($browseCount / $totalCount ) * 100; Obviously you get the error because $percentage is not defined ..

Re: [PHP] adding key- value pair to an array

2008-12-03 Thread Jim Lucas
Aniketto wrote: Hi all, Can anybody tell me how can I add key-value pair in an array. My code is as follows $criteria = array(); $criteria['mail_subject'] = $form-subject-getValue(); $criteria['delivery_user_name'] = $form-delivery_user_name-getValue(); $criteria['start_date'] =

Re: [PHP] adding key- value pair to an array

2008-12-03 Thread Nathan Rixham
Jim Lucas wrote: I don't think the above will work either, afaik php doesn't allow you to have variable names start with numbers. well debatable.. # $12 = 'value'; Parsing Error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' # $varname =

Re: [PHP] adding key- value pair to an array

2008-12-03 Thread Yeti
//you can get really stupid with this.. ${false} = 'some string here'; echo ${''}; //echos some string here I like stupid things -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] adding key- value pair to an array

2008-12-03 Thread Jencisson Tsu
haha,is funny, i like it. Date: Wed, 3 Dec 2008 12:40:39 -0800 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; php-general@lists.php.net Subject: Re: [PHP] adding key- value pair to an array //you can get really stupid with this.. ${false} = 'some string here'; echo

[PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly formed HTML

[PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Nathan Rixham
Alex Kirk wrote: I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly

RE: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Wolf
-Original Message- From: Alex Kirk I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never

Re: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread ceo
There are httpd.conf settings to reject POST requests, but I don't think it would behave like that... But maybe it's a bit more complicated than what I've ever seen for httpd.conf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Jim Lucas
Nathan Rixham wrote: Alex Kirk wrote: I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting

Re: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Chris
[EMAIL PROTECTED] wrote: There are httpd.conf settings to reject POST requests, but I don't think it would behave like that... But maybe it's a bit more complicated than what I've ever seen for httpd.conf Could be mod_security getting in the way and killing some content. -- Postgresql php

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly formed HTML forms.

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Chris
Did you check the apache logs or the php error logs? Apache logs show no errors at all. The PHP error log is more interesting - I turned on logging to /var/log/php.err once I started trying to diagnose this, and that file has yet to be created. Apache can't write to that location. You

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Nathan Rixham
Alex Kirk wrote: I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly

Re: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Daniel P. Brown
On Wed, Dec 3, 2008 at 6:03 PM, Alex Kirk [EMAIL PROTECTED] wrote: It works like a charm on a different machine with an essentially identical config (it's a newer version of FreeBSD, but that's about it); however, it never displays the contents of $_POST['testvar'] on the machine that

Re: [PHP] $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
Quoting Daniel P. Brown [EMAIL PROTECTED]: On Wed, Dec 3, 2008 at 6:03 PM, Alex Kirk [EMAIL PROTECTED] wrote: It works like a charm on a different machine with an essentially identical config (it's a newer version of FreeBSD, but that's about it); however, it never displays the contents of

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
touch /var/log/php.err chown apache:apache /var/log/php.err adjust apache with your webserver user/group (check httpd.conf) though I doubt anything will show up there. Well, done anyway, just in case. Do you have mod_security enabled in apache? Maybe it's catching something it shouldn't.

Re: [PHP] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly formed HTML forms.

Re: [PHP] [RESOLVED] Re: $_POST suddenly empty; $_GET and _$REQUEST fine

2008-12-03 Thread Alex Kirk
I've got an Apache 2.2.3 server running PHP 5.2.6 on top of FreeBSD 6.2. It's worked quite well for over a year now. However, as of some time last night, phpBB broke; upon investigation, I realized that the problem was that $_POST was never getting populated, even on properly formed HTML forms.

Re: [PHP] Short circuit evaluation and include

2008-12-03 Thread David Ansermot
include and include_once dont throw fatal exception. You should use require or require_once and catch the exception with try{}catch{} block [EMAIL PROTECTED] a écrit : include and require are not functions. They are language constructs. They probably don't return values nor short-circuit