[PHP] MySQL connector installation/upgrade problems

2007-10-22 Thread David Zentgraf
Hi, I'm trying to upgrade a server running CentOS 3 to an up-to-date MySQL 5 installation + PHP4. I installed the MySQL 5 package, server and client, via RPMs and they work fine, the client tells me it's version 5.0.45. I went on to recompile PHP 4.4.7 --with-mysql, but it's still using M

RE: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 19:59 -0400, Bastien Koert wrote: > I am sure that I am late to the party, but am sure that > double or single quotes at least are needed around the > attribute values to make this work Late to the party and completely off the mark taboot. Don't need quotes at all. It's bad p

RE: [PHP] problem with foreach

2007-10-22 Thread Bastien Koert
I am sure that I am late to the party, but am sure that double or single quotes at least are needed around the attribute values to make this work Civil Rights bastien > Date: Mon, 22 Oct 2007 12:20:55 -0500> From: [EMAIL PROTECTED]> CC: php-genera

RE: [PHP] Php generated html email

2007-10-22 Thread Jay Blanchard
[snip] How can I create a html email directly from a web page via Php? The page will include tables, background colors and pictures within the tables. The received email should be readable without Internet connection (pictures, must be sent with the email) [/snip] Google is your friend... http:/

[PHP] Php generated html email

2007-10-22 Thread Ronald Wiplinger
How can I create a html email directly from a web page via Php? The page will include tables, background colors and pictures within the tables. The received email should be readable without Internet connection (pictures, must be sent with the email) bye Ronald -- PHP General Mailing List (h

[PHP] Thoughts on multiple servers

2007-10-22 Thread Ronald Wiplinger
At current stage I have two servers installed, whereby the first one does all, but the second is a database server. I need to install on different location a server pair, which should work together, fail-fall-over, ... The idea is to have in the dns for the servers: abc.example.com <

RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?

2007-10-22 Thread Daevid Vincent
DOH!. I'm sorry I didn't read the fact that this was on Windows. My bad... Um. Out of curiosity, why would you run LAMP as WAMP? It just seems so wrong. Not to start an OS religion war, I use XP all day long, but I would never use it as my dedicated web server -- that's why God invented Unix/Linux

RE: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?

2007-10-22 Thread Daevid Vincent
What we do is setup 'sudo' to run certain commands (or a shell/ruby script for example), then have PHP/Apache exec() the script via sudo (or use a DBUS call to a 'root' enabled ruby daemon), which then restarts apache or whatever we want. Be VERY careful with the way you do this or you can give cr

Re: [PHP] problem with foreach

2007-10-22 Thread Greg Donald
On 10/22/07, Nathan Hawks <[EMAIL PROTECTED]> wrote: > Also, AFAIK, PHP has always thrown a warning or notice if you use > foreach() on a non-associative array. PHP arrays are always associative: > cat array.php #!/usr/bin/env php ./array.php Array ( [0] => 1 [1] => 2 [2] => 3 ) Array (

Re: [PHP] problem with foreach

2007-10-22 Thread Nathan Hawks
Also, AFAIK, PHP has always thrown a warning or notice if you use foreach() on a non-associative array. That doesn't mean it won't work, but the strict standard is apparently: foreach ($assoc as $key => $val) not foreach ($indexed as $item) However, as we all know, the latter still works fine.

Re: [PHP] problem with foreach

2007-10-22 Thread Philip Thompson
On 10/22/07, Adam Williams <[EMAIL PROTECTED]> wrote: > > I have an html page with checkboxes: > > > Modern > Mississippi Change to: ... Someone mentioned this earlier, but I thought I'd reiterate. I'm not sure how the browser will deal with *arrays* that aren't quoted. It's very good practice

Re: [PHP] problem with foreach

2007-10-22 Thread Stut
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) {

Re: [PHP] problem with foreach

2007-10-22 Thread Ludovic André
Adam Williams a écrit : I have an html page with checkboxes: [...] but I'm getting the error: you selected: *Warning*: Invalid argument supplied for foreach() in */var/www/sites/mdah-test/museum/mmhsurvey/mailform2.php* on line *81* I googled some checkbox/foreach pages on google, but I don'

Re: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 12:20 -0500, Adam Williams wrote: > > Yeah, thats the problem I'm having for some reason. When I do: > > print_r($_POST['option']); > > it prints nothing. It's usually more informative to see everything that was posted so you might have more of an idea what may have went

RE: [PHP] problem with foreach

2007-10-22 Thread Jay Blanchard
[snip] print_r($_POST['option']); it prints nothing. [/snip] Try resetting the array first, you may be at the end of the array; reset($_POST); print_r($_POST); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] problem with foreach

2007-10-22 Thread Adam Williams
Robert Cummings wrote: On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a)

Re: [PHP] problem with foreach

2007-10-22 Thread Robert Cummings
On Mon, 2007-10-22 at 18:07 +0100, Stut wrote: > Adam Williams wrote: > > I have an html page with checkboxes: > > > > > > Modern > > Mississippi > > Civil Rights > > MilitaryHistory > > > > > > and mailform2.php containing: > > > > echo "you selected: "; > > /* line 81 */ foreach ($_POST[opt

Re: [PHP] problem with foreach

2007-10-22 Thread Andrew Ballard
On 10/22/07, Adam Williams <[EMAIL PROTECTED]> wrote: > I have an html page with checkboxes: > > > Modern > Mississippi > Civil Rights > MilitaryHistory > > > and mailform2.php containing: > > echo "you selected: "; > /* line 81 */ foreach ($_POST[option] as $a) > { > echo "$a"; >

Re: [PHP] problem with foreach

2007-10-22 Thread Stut
Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) { echo "$a"; } but I'm getting the error: you selected: *Warn

Re: [PHP] problem with foreach

2007-10-22 Thread Jason Pruim
On Oct 22, 2007, at 1:01 PM, Adam Williams wrote: I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) { echo "$a"; } but I'm getting t

[PHP] problem with foreach

2007-10-22 Thread Adam Williams
I have an html page with checkboxes: Modern Mississippi Civil Rights MilitaryHistory and mailform2.php containing: echo "you selected: "; /* line 81 */ foreach ($_POST[option] as $a) { echo "$a"; } but I'm getting the error: you selected: *Warning*: Invalid argument

[PHP] TLS transport for Windows

2007-10-22 Thread Matt Arnilo S. Baluyos (Mailing Lists)
Hi all, I'm looking for a PHP environment for Windows (like XAMPP), that already has TLS transport built-in. Would anyone know of something like it? If not, any pointers on how to get TLS transport for a PHP Windows environment? Thanks, Matt -- Stand before it and there is no beginning. Follow

Re: [PHP] Securing PHP

2007-10-22 Thread Greg Donald
On 10/22/07, Philip Thompson <[EMAIL PROTECTED]> wrote: > One resource: http://phpsec.org/ I find it very helpful to look at the actual exploits and understand why they work: http://www.securityfocus.com/swsearch?metaname=alldoc&query=php -- Greg Donald http://destiney.com/ -- PHP General Ma

Re: [PHP] Securing PHP

2007-10-22 Thread Philip Thompson
On 10/20/07, Grant <[EMAIL PROTECTED]> wrote: > > Hi all, > > You've all likely heard this before"I was hacked..." , "Had register > globals on..." etc etc. > > Well, this is true of me as well. > > Does anyone know of a site that would help a semi professional lock down > php, i.e. > > Perhaps

[PHP] php suexec

2007-10-22 Thread Grant
Hi again all, Has anyone on this had succees setting up php to use suexec? If I am reading things right, it appears that php must be run as CGI and then it will use the built in (Apache2) suexec wrapper in the same fassion as perl does. If the above is correct I am looking for a primer on how

Re: [PHP] running Batch process using php

2007-10-22 Thread Ashley M. Kirchner
Javed Khan wrote: Hello Everone, I want to run a script in php which should execute at particular condition and if the condition is true then it will send out emails to the recipients. Can anyone suggest how can I achieve this. Thanx, Javed Without spending a whole lot of brain cel

[PHP] running Batch process using php

2007-10-22 Thread Javed Khan
Hello Everone, I want to run a script in php which should execute at particular condition and if the condition is true then it will send out emails to the recipients. Can anyone suggest how can I achieve this. Thanx, Javed _ Exp

Re: [PHP] Is it possible to restart Windows Apache (service) on a PHP script?

2007-10-22 Thread Peter Ford
You could try using exec to set up an "AT" job with a short delay which will then run 'net apache restart' - I'm not a total windows guru so I can't give you the exact recipe... Something like exec('AT 12:00 "net apache restart"'); Check the documentation on the AT command... One possible extra

Re: [PHP] Re: Unsetting a header

2007-10-22 Thread Richard Heyes
Freyjkell wrote: D Richard Heyes wrote: Does anyone know of a way to unset a header? I have an Expires: header that I believe Apache is setting, and I don't want it. Thanks. Do you really need to remove this header? I do. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.c

[PHP] Re: Proposal of DOM non-standard method: DOMDocument::loadCharacterEntitiesFromDtd($path)

2007-10-22 Thread Rob
Freyjkell wrote: DOMDocument::loadCharacterEntitiesFromDtd($path); I like to load character entities (not whole document type definition). When I try to do that by creating my own DTD with only character entities, and setting resolveExternals to true, then DTD parser complains that it didn't oc

[PHP] Re: Proposal of DOM boolean property: DOMDocument::omitXMLDeclaration

2007-10-22 Thread Rob
Freyjkell wrote: (bool) DOMDocument::omitXMLDeclaration; Does not need a comment. Implemented in XSLT. // I sent this post to php.xml.dev, but I didn't get reply for long time. parser option LIBXML_NOXMLDECL or if no DTD just save the root element. Rob -- PHP General Mailing List (http://ww

[PHP] Proposal of DOM non-standard method: DOMDocument::loadCharacterEntitiesFromDtd($path)

2007-10-22 Thread Freyjkell
DOMDocument::loadCharacterEntitiesFromDtd($path); I like to load character entities (not whole document type definition). When I try to do that by creating my own DTD with only character entities, and setting resolveExternals to true, then DTD parser complains that it didn't occur root definitio

[PHP] Proposal of DOM boolean property: DOMDocument::omitXMLDeclaration

2007-10-22 Thread Freyjkell
(bool) DOMDocument::omitXMLDeclaration; Does not need a comment. Implemented in XSLT. // I sent this post to php.xml.dev, but I didn't get reply for long time. -- Freyjkell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Different size of file on server and on output

2007-10-22 Thread Colin Guthrie
M. Sokolewicz wrote: > Pavel Janda wrote: >> Hello to everybody, >> >> I have this problem with downloading files via PHP. For illustration - >> I am using this fragment of code: >> >> > >> header("Content-type: $contenttype; name=\"$outputfilename\""); >> header("Content-disposition: form-

[PHP] Re: Unsetting a header

2007-10-22 Thread Freyjkell
D Richard Heyes wrote: Does anyone know of a way to unset a header? I have an Expires: header that I believe Apache is setting, and I don't want it. Thanks. Do you really need to remove this header? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/uns

[PHP] Re: Different size of file on server and on output

2007-10-22 Thread Pavel Janda
Thanks a lot. However there wasn't any visible whitespace in code, leaving of ?> helped... I haven't known, that it is not required :o). Thank you very much again! Pavel M. Sokolewicz napsal(a): Pavel Janda wrote: Hello to everybody, I have this problem with downloading files via PHP. For il

[PHP] Re: Different size of file on server and on output

2007-10-22 Thread M. Sokolewicz
Pavel Janda wrote: Hello to everybody, I have this problem with downloading files via PHP. For illustration - I am using this fragment of code: The problem is, that the file on server has 16857 bytes and saved file has 16858. In another case downloaded file has everytime 1 byte more than

[PHP] Different size of file on server and on output

2007-10-22 Thread Pavel Janda
Hello to everybody, I have this problem with downloading files via PHP. For illustration - I am using this fragment of code: The problem is, that the file on server has 16857 bytes and saved file has 16858. In another case downloaded file has everytime 1 byte more than the original file on

Re: [PHP] Unsetting a header

2007-10-22 Thread Richard Heyes
Richard Heyes wrote: FWIW, I found what was setting the cache headers - sessions. I may be able to use session_cache_limiter(). Not Sure. Further, I found this to be what I needed: session_cache_limiter('private_no_expire'); Cheers. -- Richard Heyes +44 (0)800 0213 172 http://www.websupports

Re: [PHP] Unsetting a header

2007-10-22 Thread Richard Heyes
FWIW, I found what was setting the cache headers - sessions. I may be able to use session_cache_limiter(). Not Sure. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support -- PHP General Mailing Lis

Re: [PHP] Unsetting a header

2007-10-22 Thread Richard Heyes
Sorry, I didn't articulate what I meant very well. What I meant was that you know the churn rate of your pages, so put in sensible expiry headers based on that info. Unfortunately I can't foresee when the pages are changed (it won't be me who changes them). But the better way to solve it is

Re: [PHP] Unsetting a header

2007-10-22 Thread Stut
Richard Heyes wrote: I'm well-aware of what the headers are for, but you can construct expiry headers that match the last-modified header. If I do that the Expiry: header will be in the past and the page will be considered expired. Sorry, I didn't articulate what I meant very well. What I me

Re: [PHP] Unsetting a header

2007-10-22 Thread Richard Heyes
I'm well-aware of what the headers are for, but you can construct expiry headers that match the last-modified header. If I do that the Expiry: header will be in the past and the page will be considered expired. -- Richard Heyes +44 (0)800 0213 172 http://www.websupportsolutions.co.uk Knowled

Re: [PHP] Unsetting a header

2007-10-22 Thread Stut
Richard Heyes wrote: Maybe I'm being dense, but why not set it to what you want it to be? Clearing it is leaving the decision up to the browser which will not necessarily have the effect you want for all users. Incidentally, it might not be possible if Apache is setting it. Not sure if PHP ha

Re: [PHP] Unsetting a header

2007-10-22 Thread Richard Heyes
Maybe I'm being dense, but why not set it to what you want it to be? Clearing it is leaving the decision up to the browser which will not necessarily have the effect you want for all users. Incidentally, it might not be possible if Apache is setting it. Not sure if PHP has the ability to overr