Re: [PHP] heredoc usage [WAS:

2006-10-25 Thread Robert Cummings
On Wed, 2006-10-25 at 22:53 -0700, Paul Novitski wrote: > > > At 10/25/2006 04:09 PM, Stut wrote: > > > > print ' > > > if ($selected_day_of_month == $day) > > > > print ' selected'; > > > > print '>'.$day.''; > > On Wed, 2006-10-25 at 17:35 -0700, Paul Novitski

[PHP] heredoc usage [WAS:

2006-10-25 Thread Paul Novitski
> At 10/25/2006 04:09 PM, Stut wrote: > > print ' > if ($selected_day_of_month == $day) > > print ' selected'; > > print '>'.$day.''; On Wed, 2006-10-25 at 17:35 -0700, Paul Novitski wrote: > print <<< hdDay > $day > > hdDa

[PHP] Job Opening

2006-10-25 Thread Larry Garfield
Well since the consensus seemed to be to allow job postings, I'll make one. :-) My company is looking for a few good PHP programmers. We are a Chicago-area web consulting firm developing web sites and web applications for a variety of clients, including several large academic institutions.  We

Re: [PHP] How does the Zend engine behave?

2006-10-25 Thread Larry Garfield
On Wednesday 25 October 2006 14:48, Jon Anderson wrote: > Take this with a grain of salt. I develop with PHP, but I am not an > internals guy... > > [EMAIL PROTECTED] wrote: > > Are the include files only compiled when execution hits them, or are > > all include files compiled when the script is fi

Re: [PHP]

2006-10-25 Thread Robert Cummings
On Wed, 2006-10-25 at 17:35 -0700, Paul Novitski wrote: > At 10/25/2006 04:09 PM, Stut wrote: > >Dang that's painful!! Try this... > > > > > foreach (range(1, 31) as $day) > > { > > print ' > if ($selected_day_of_month == $day) > > print ' selected'; > >

Re: [PHP]

2006-10-25 Thread Paul Novitski
At 10/25/2006 04:09 PM, Stut wrote: Dang that's painful!! Try this... '.$day.''; } ?> Ouch! Gnarly mix of logic and markup. I suggest something more like: foreach (range(1, 31) as $day) { $sSelected = ($selected_day_of_month == $day) ? ' selected="sele

Re: Re: [PHP]

2006-10-25 Thread Joe Wollard
...and if you wanted to go an extra step you could try an alternate syntax of the exact same code: ' . $day . ''; ?> Either way, Stut is correct. Don't type this out 31 times unless you really really really like to type. ;-) - Joe On 10/25/06, Stut <[EMAIL PROTECTED]> wrote: Ron Piggott (PHP)

Re: [PHP] foreach on a 3d array

2006-10-25 Thread M.Sokolewicz
M.Sokolewicz wrote: Dotan Cohen wrote: On 24/10/06, Chris Boget <[EMAIL PROTECTED]> wrote: > $languages = array( >"af" => array("Afrikaans", "Afrikaans", "South Africa"), >"sq" => array("Albanian", "Shqipe", "Albania")); > > foreach ($languages as $language){ >if ( strstr

Re: [PHP]

2006-10-25 Thread Stut
Ron Piggott (PHP) wrote: I am creating a form right now. I am using the html SELECT tag. The most number of days in a month is 31 I want the output to be ## based on the value of $selected_day_of_month variable. For the days of the month where the number is not selected the output I am desi

[PHP]

2006-10-25 Thread Ron Piggott (PHP)
I am creating a form right now. I am using the html SELECT tag. The most number of days in a month is 31 I want the output to be ## based on the value of $selected_day_of_month variable. For the days of the month where the number is not selected the output I am desiring is 1 2 etc. to be g

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Gert Cuykens
ok thx all, works great now :) On 10/25/06, Stut <[EMAIL PROTECTED]> wrote: Gert Cuykens wrote: > BINGO :) Indeed. > ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1)Array ( [0] => > ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1) ) 1 > > Can you explain a bit more what this do ?

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Stut
Gert Cuykens wrote: BINGO :) Indeed. ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1)Array ( [0] => ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1) ) 1 Can you explain a bit more what this do ? 2>&1 For example will i only get stderr or do i get stdout and stderr messages ?

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Gert Cuykens
BINGO :) ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1)Array ( [0] => ERROR 2005 (HY000): Unknown MySQL server host 'hhh' (1) ) 1 Can you explain a bit more what this do ? 2>&1 For example will i only get stderr or do i get stdout and stderr messages ? On 10/25/06, Stut <[EMAIL PROTECT

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread David Giragosian
Can't say why you're not getting an error message, but when I have a valid user, password, host, and sql in a .txt file, I get the last record from the select statement I run output in the browser. Maybe start with getting it to work with everything used correctly, then work backwards. HTH, On

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Stut
Gert Cuykens wrote: i do not get any output from mysql except form echo $bin that displays 1 ? I don't know for sure but chances are that mysql outputs errors on stderr not stdout, so you need to redirect stderr to stdout for exec to capture it... exec("mysql -h hhh -u uuu - < test.php

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Gert Cuykens
when i do echo exec... i get a blank screen (print_r $out i get Array() echo $bin i get 1) On 10/25/06, David Giragosian <[EMAIL PROTECTED]> wrote: What do you get if you run: echo exec("mysql -h hhh -u uuu - wrote: > actually something like 'asdadsuiashdiasdh' :) test.php is just some >

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread David Giragosian
What do you get if you run: echo exec("mysql -h hhh -u uuu - wrote: actually something like 'asdadsuiashdiasdh' :) test.php is just some text file i maybe should have renamed it to test.txt sorry. But the thing is i dont get any feedback like 'cant connect to host' or 'invalid sql' etc.

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Gert Cuykens
actually something like 'asdadsuiashdiasdh' :) test.php is just some text file i maybe should have renamed it to test.txt sorry. But the thing is i dont get any feedback like 'cant connect to host' or 'invalid sql' etc. exec(mysqldump...) works but exec(mysql...) doesnt On 10/25/06, David Girag

Re: [PHP] How does the Zend engine behave?

2006-10-25 Thread Jon Anderson
Take this with a grain of salt. I develop with PHP, but I am not an internals guy... [EMAIL PROTECTED] wrote: Are the include files only compiled when execution hits them, or are all include files compiled when the script is first compiled, which would mean a cascade through all statically lin

[PHP] Re: Problem with EXEC and PASSTHRU

2006-10-25 Thread Matt Beechey
Ok - This is a reply to ALL - Thanks for the great help - I now understand why it wasn't displaying - it was all due to caching of data at the client end before displaying in blocks. With some help in the comments of the php manual for flush() I found a nice script that uses echo str_pad('',1024

Re: [PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread David Giragosian
What is the SQL you are running in test.php? David On 10/25/06, Gert Cuykens <[EMAIL PROTECTED]> wrote: i do not get any output from mysql except form echo $bin that displays 1 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] exec("mysql -h hhh -u uuu -pppp

2006-10-25 Thread Gert Cuykens
i do not get any output from mysql except form echo $bin that displays 1 ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How does the Zend engine behave?

2006-10-25 Thread jeff . phplist
Hi, I'm using PHP 4.x and I'm trying to understand a bit about memory usage... Firstly, when I say 'include files' below, I mean all forms, include, require and the _once versions. That said, when a script runs and it's made of several include files, what happens? Are the include files onl

Re: [PHP] PHP 5 Hosting

2006-10-25 Thread Ed Lazor
Hi, I wanted to give some feedback on PHP 5 hosting in case it helps someone. I signed up with DreamHost last Thursday. I also signed up with OCS Solutions to compare the two services. I also maintain a server with CalPop. When I signed up with Dreamhost, I discovered that you have to

Re: [PHP] strtotime

2006-10-25 Thread Google Kreme
On 24 Oct 2006, at 19:07 , Brad Chow wrote: $date=("2006-10-26"); $date=strtotime($date); $date=date('Y-m-1',$date); $now=strtotime("+3 month", strtotime($date)); $lastday=strtotime("-1 day", $now); echo date('Y-m-d',$lastday); //2006-12-31 Yep, that's pretty much exactly what I do. I suspect

[PHP] Re: Problem with EXEC and PASSTHRU

2006-10-25 Thread Myron Turner
Matt Beechey wrote: I am writing a php website for users to edit a global whitelist for Spam Assassin - all is going fairly well considering I hadn't ever used php until a couple of days ago. My problem is I need to restart AMAVISD-NEW after the user saves the changes. I've acheived this using SU

Re: [PHP] strtotime

2006-10-25 Thread clive
Ron Piggott (PHP) wrote: I have used the strtotime command to calculate a week ago (among other things) with syntax like this: $one_week_ago = strtotime("-7 days"); $one_week_ago = date('Y-m-d', $one_week_ago); How would you use this command to figure out the last day of the month in two months

Re: [PHP] foreach on a 3d array

2006-10-25 Thread Dotan Cohen
On 25/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote: Ah, in that case using $HTTP_ACCEPT_LANGUAGE relies on the register_globals setting, which is a security risk (and turned off by default). Please read up on this, so you know what you're up against... See: http://www.php.net/register_glob

Re: [PHP] foreach on a 3d array

2006-10-25 Thread Ivo F.A.C. Fokkema
On Wed, 25 Oct 2006 13:53:47 +0200, Dotan Cohen wrote: > On 25/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote: >> >> Because that wouldn't work :) >> >> This variable may contain stuff like "nl,en-us;q=0.7,en;q=0.3". You'll >> need to do something with this variable first to use >> array_key_

Re: [PHP] foreach on a 3d array

2006-10-25 Thread Dotan Cohen
On 25/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote: Because that wouldn't work :) This variable may contain stuff like "nl,en-us;q=0.7,en;q=0.3". You'll need to do something with this variable first to use array_key_exists (or as you do, isset). That said, I agree that strstr() might not

Re: [PHP] [php] passing variables doesn't work

2006-10-25 Thread Ivo F.A.C. Fokkema
On Wed, 25 Oct 2006 10:19:24 +0200, Max Belushkin wrote: > Whatever form information you want to pass has to be part of the form. > >> WILLEMS Wim (BMB) wrote: >> > > In the second script, the value of this will be in $_POST["database"]. ... which will contain absolutely nothing, since you hav

[PHP] Re: Problem with EXEC and PASSTHRU

2006-10-25 Thread Ivo F.A.C. Fokkema
On Wed, 25 Oct 2006 20:35:29 +1300, Matt Beechey wrote: > I am writing a php website for users to edit a global whitelist for Spam > Assassin - all is going fairly well considering I hadn't ever used php until > a couple of days ago. My problem is I need to restart AMAVISD-NEW after the > user sav

RE: [PHP] IMAP extension causing delays

2006-10-25 Thread Edward Kay
> -Original Message- > From: Edward Kay [mailto:[EMAIL PROTECTED] > Sent: 19 October 2006 14:53 > To: php-general@lists.php.net > Subject: [PHP] IMAP extension causing delays > > Hello, > > I need PHP's IMAP extension for my web app but it is really slowing my > server up. > > My setup: Fed

Re: [PHP] Problem with EXEC and PASSTHRU

2006-10-25 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2006-10-25 20:35:29 +1300: > I am writing a php website for users to edit a global whitelist for Spam > Assassin - all is going fairly well considering I hadn't ever used php until > a couple of days ago. My problem is I need to restart AMAVISD-NEW after the > user saves the c

Re: [PHP] [php] passing variables doesn't work

2006-10-25 Thread Jochem Maas
http://google.com/search?q=phpmyadmin phpmyadmin has all the functionality you are trying to build - and it implements it securely - even if you are writing the code/tool mentioned below as a learning exercise (as opposed to writing it because you need to be able to execute arbitrary queries easil

[PHP] Problem with EXEC and PASSTHRU

2006-10-25 Thread Matt Beechey
I am writing a php website for users to edit a global whitelist for Spam Assassin - all is going fairly well considering I hadn't ever used php until a couple of days ago. My problem is I need to restart AMAVISD-NEW after the user saves the changes. I've acheived this using SUDO and giving the www-

Re: [PHP] [php] passing variables doesn't work

2006-10-25 Thread Max Belushkin
Whatever form information you want to pass has to be part of the form. WILLEMS Wim (BMB) wrote: In the second script, the value of this will be in $_POST["database"]. $wim isn't part of your form - it will /not/ get saved into the next PHP script. You can handle it through input type hid

Re: [PHP] [php] passing variables doesn't work

2006-10-25 Thread Chris
WILLEMS Wim (BMB) wrote: Dear all, I am trying to pass variables from one php-file to another but that doesn't seem to work. Anyone an idea what I am doing wrong? The first file shows a dropdown with all the databases on the server (only 1 for me). You have to select a database and put an S

Re: [PHP] [PEAR] QUICKFORM JSCALENDAR with "multiple dates feature"

2006-10-25 Thread Chris
Marco Sottana wrote: i find jscalendar element for HTML_QuickForm http://www.netsols.de/pear/jscalendar/ Ask on the pear-general list, you'll get more responses. http://pear.php.net/support/lists.php and please don't cross-post. -- Postgresql & php tutorials http://www.designmagick.com/ --

[PHP] [php] passing variables doesn't work

2006-10-25 Thread WILLEMS Wim \(BMB\)
Dear all, I am trying to pass variables from one php-file to another but that doesn't seem to work. Anyone an idea what I am doing wrong? The first file shows a dropdown with all the databases on the server (only 1 for me). You have to select a database and put an SQL query in the textarea. Pus

[PHP] [PEAR] QUICKFORM JSCALENDAR with "multiple dates feature"

2006-10-25 Thread Marco Sottana
i find jscalendar element for HTML_QuickForm http://www.netsols.de/pear/jscalendar/ i need to use multiple dates feature http://www.dynarch.com/demos/jscalendar/multiple-dates.html anyone can help me? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

[PHP] Re: strtotime

2006-10-25 Thread Ivo F.A.C. Fokkema
On Tue, 24 Oct 2006 20:36:08 -0400, Ron Piggott (PHP) wrote: > > I have used the strtotime command to calculate a week ago (among other > things) with syntax like this: > > $one_week_ago = strtotime("-7 days"); > $one_week_ago = date('Y-m-d', $one_week_ago); > > How would you use this command t

Re: [PHP] foreach on a 3d array

2006-10-25 Thread Ivo F.A.C. Fokkema
On Tue, 24 Oct 2006 23:55:49 +0200, M.Sokolewicz wrote: > Dotan Cohen wrote: >> On 24/10/06, Chris Boget <[EMAIL PROTECTED]> wrote: >>> > $languages = array( >>> >"af" => array("Afrikaans", "Afrikaans", "South Africa"), >>> >"sq" => array("Albanian", "Shqipe", "Albania")); >>> > >