[PHP] MySql Rollback in PHP within a website

2003-07-13 Thread bruce
Hey...

I have a question. I need to be able to try to perform a database update,
but if it doesn't succeed, I need to be able to rollback the changes, and to
inform the user that the changes didn't succeed.

I've looked at the MySql site, and can see somewhat how the Commit/RollBack
functions work. However, I'm not sure how to create the required PHP code to
implement this kind of process...

Basically I need to:

Create query...
Perform Update on the table(s)
Perform my check(s)
If the checks fail
alert user
rollback updates
else
success

It's my understanding that I need to somehow set "START TRANSACTION" prior
to beginning the update. But I'm not sure how to do that within the PHP
code... Nor am I sure if there's something else I need to do...

Any examples/hints/sample code will be appreciated. Thanks for any
assistance!

Regards,

Bruce
[EMAIL PROTECTED]
(925) 866-2790



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



[PHP] apache/web site question...

2003-12-24 Thread bruce
hi...

a very basic (i hope) question...

i know i can have a web page that uses PHP/ASP/Etc... and i can do a kind of
include, such that i can incorporate content/text from another file. i'm
curious to know if there is a way to do that such that i can incorporate
text from a file on another server on a separate domain/IP address???

any examples/sample pages demonstrating this would be helpful!!!

I would like to be able to accomplish this from within the apache httpd.conf
file if possible, where i simply define a website/page and the httpd.conf
directive points to the file on the separate PC. If this isn't possible,
I'll take the PHP/ASP/Etc.. approach where I can include a file that resides
on another completely different server/PC...

thanks...

bruce douglas
[EMAIL PROTECTED]
(925) 866-2790


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

RE: [PHP] Re: exec works with some, but not all commands

2004-07-24 Thread bruce
when running shell commands form php/web apps... it's a good idea to check
the ownership/privs/permissions of both the exe being run, as well as any
output/input files for the exe app.

you should also check the web/apache/iis error/log files to determine if
everything is correct...

regards,



-Original Message-
From: news [mailto:[EMAIL PROTECTED] Behalf Of Chris Martin
Sent: Saturday, July 24, 2004 6:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: exec works with some, but not all commands


Matthew Sims wrote:
>>why would exec("touch /var/www/testfile.txt") work but not
>>
>>exec("/usr/bin/gpg --homedir /home/testuser/.gnupg blah blah blah")
>>
>>the dir used in homedir has mode 777 just for testing
>>
>>
>>this is the actual command I'm trying to run...
>>exec("/usr/bin/gpg --homedir /home/testdir/.gnupg --armor --output e.gpg
>>-e -r uid_someuser sf.txt");
>>
>>if I run it from the command line, it works fine...
>>
>
>
> I'm not sure but what if you defined an absolute path for your output
> files (e.gpg and sf.txt).
>
I'm not sure either, but I was thinking absolute too.

Also you might try system(), shell_exec(), or passthru() if you're
trying to get output back.

--
Chris Martin
Web Developer
Open Source & Web Standards Advocate
http://www.chriscodes.com/

--
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 mysql--mysqli persistent connections...

2004-07-30 Thread bruce
hi..

in looking over mysqli/mysql constructs, i noticed that mysqli doesn't
appear to support persistent connections. is this correct, did i miss
something..???

without using persistent connections/transactional processing, how is one
supposed to accomplish handling db transactions across multiple pages..???

if persistent connections are still supported with mysqli, how?

and if the persistent connection is no longer available, can someone explain
why it was dropped..???

thanks

-bruce

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



RE: [PHP] php mysql--mysqli persistent connections...

2004-07-30 Thread bruce
php/mysql supported persistent connections..

i had assumed that mysqli would as well

it appears that it doesn't...

-bruce


-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 10:54 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] php mysql--mysqli persistent connections...


> without using persistent connections/transactional
> processing, how is one
> supposed to accomplish handling db transactions across
> multiple pages..???

At what point was this ever allowed or even capable of being done? Are you
saying you're doing this now?

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



RE: RE: [PHP] php mysql--mysqli persistent connections...

2004-07-30 Thread bruce
never worked with them

but i'm getting close in an app that i believes requires them...

i'm going to need to do transactional processing across multiple pages for a
test app. i was looking at the mysqli functions which work for the
rollback/commit which is ok. but it's my understanding that once the page
closes, the db connection is lost, which would trigger a rollback of any db
queries/processing currently in process. however, if i had a persistent
connection, then the connection should be open, and the rollback shouldn't
be triggered, and the app could proceed with the db processing, followed by
a commit!

at least this was the plan, until i couldn't find the persistent hook within
mysqli...

what am i missing..??

-bruce


-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 11:09 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: RE: [PHP] php mysql--mysqli persistent connections...


> php/mysql supported persistent connections..

Have you ever used persistant connections. I don't think they work the way
you are thinking. Persistant connections rarely had any benifit except in
certain server configurations.

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

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



[PHP] db transactions across multiple pages...

2004-07-30 Thread bruce
i can't be the only one to need to do this

since it appears that php5/mysqli no longer supports pconnect, how does this
get done???

it almost seems that there needs to be a small intermediate server/app that
php would talk to, that would in turn talk with the mysql server. this app
would essentially make the connection, and maintain the connection with the
mysql db/server. the php app could then be free to make any required calls
with the mysql db, knowing that there's a persistent connection available
from the intermediate server.

in essence, the intermediate server would basically be a container for db
connections...

comments/criticisms/etc...

-bruce



-Original Message-----
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 11:33 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: RE: [PHP] php mysql--mysqli persistent connections...


never worked with them

but i'm getting close in an app that i believes requires them...

i'm going to need to do transactional processing across multiple pages for a
test app. i was looking at the mysqli functions which work for the
rollback/commit which is ok. but it's my understanding that once the page
closes, the db connection is lost, which would trigger a rollback of any db
queries/processing currently in process. however, if i had a persistent
connection, then the connection should be open, and the rollback shouldn't
be triggered, and the app could proceed with the db processing, followed by
a commit!

at least this was the plan, until i couldn't find the persistent hook within
mysqli...

what am i missing..??

-bruce


-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 11:09 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: RE: [PHP] php mysql--mysqli persistent connections...


> php/mysql supported persistent connections..

Have you ever used persistant connections. I don't think they work the way
you are thinking. Persistant connections rarely had any benifit except in
certain server configurations.

---John Holmes...

UCCASS - PHP Survey System
http://www.bigredspark.com/survey.html

--
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] db transactions across multiple pages...

2004-07-30 Thread bruce
we want to have the ability to perform db queries/actions with the db across
multiple pages.

the pconnect supposedly allowed an app to use the same connection if one was
available. so an app would establish the connection on page 1, and page 2
could use the same db connection... this is required as i understand it if
you're going to do transactional processing, as once the connect dies, the
actions being performed are rolled back if you haven't done a "commit"...

-bruce


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 1:45 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


bruce wrote:
> i can't be the only one to need to do this
>
> since it appears that php5/mysqli no longer supports pconnect, how does
this
> get done???
>
> it almost seems that there needs to be a small intermediate server/app
that
> php would talk to, that would in turn talk with the mysql server. this app
> would essentially make the connection, and maintain the connection with
the
> mysql db/server. the php app could then be free to make any required calls
> with the mysql db, knowing that there's a persistent connection available
> from the intermediate server.
>
> in essence, the intermediate server would basically be a container for db
> connections...
>
> comments/criticisms/etc...
>
> -bruce

I'm not sure I understand what it is exactly you want to do.  Is it that
you want to open a connection to the db on page one, and have that
connection remain open on pages two, three, etc.?  If that's the case, I
don't think (I could be wrong, never used pconnect) pconnect ever did
this.  My understanding is that PHP will close _all_ db connections when
the page is finished executing, no matter how that connection was opened.

If this is what you want to do, why do you need the connection to remain
open after a page executes?  No queries are going to be run after
execution stops.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
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] db transactions across multiple pages...

2004-07-30 Thread bruce
not sure if it's php/mysqli... but if you check the php.net for the "mysqli"
not "mysql" functions... you won't see the persistent attribute listed for
the php.ini attributes...

-bruce

you're learning more every day


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 2:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


bruce wrote:
> we want to have the ability to perform db queries/actions with the db
across
> multiple pages.
>
> the pconnect supposedly allowed an app to use the same connection if one
was
> available. so an app would establish the connection on page 1, and page 2
> could use the same db connection... this is required as i understand it if
> you're going to do transactional processing, as once the connect dies, the
> actions being performed are rolled back if you haven't done a "commit"...
>
> -bruce

You're right...according to the docs, my understanding of what pconnect
did was wrong.  I can't find where it says that this feature is going
away in php5 though.

--
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] db transactions across multiple pages...

2004-07-30 Thread bruce
you also won't see the mysqli pconnect function... which tells me that at
least for now, it's not there...

-bruce


-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


bruce wrote:
> not sure if it's php/mysqli... but if you check the php.net for the
"mysqli"
> not "mysql" functions... you won't see the persistent attribute listed for
> the php.ini attributes...

I wouldn't worry too much about that though.  I mean if persistant
connections are required for transactions, I'm sure it will be there.
The only reason we may not be seeing it now is because the PHP5
documentation is full of holes (with it not being a production release
yet).  I know of a few items that are available in PHP5 that aren't
documented on php.net yet.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--
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] db transactions across multiple pages...

2004-07-31 Thread bruce
yeah...

i saw that write up. i've also inquired with bugs.mysql as to if/whether
this might be reinserted.. we'll see.

that said, it appears that there would need to be an approach similar to the
apache::dbi mod for perl, where you have an app that essentially does
connection pooling. in this model, an intermediate app becomes the app that
has the connection with the mysql server, and never shuts down. the web app
would 'talk' to the intermediate app to get the connection id/handle,
ensuring that the web app could get the same handle for all subsequent mysql
interaction on the pages of the web app

ie
  +<--->app1>>>>+
  | v
mysql<--- pool app
  | ^
  +<--->app2>>>>+

in this case app1/app2 are both web apps running on apache
app1/app2 would talk to the 'pool app' to get the initial mysql db 'handle'.
the handle is stored/maintained for the life of the client web app.
once the pool app gets the handle, the web app fetches the handle at the
start of every page that has to perform db functions with mysql. subsequent
db functions for the page are then performed between the web app and mysql,
using the handle provided by the pool app

that's the theory, not sure how it would work, or what other issues would
be. but if it did work, it could be extended to support any given web
app/server that needed to be able to maintain the connection with the db
over multiple pages...

-bruce


-Original Message-
From: Jim Grill [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 10:48 PM
To: [EMAIL PROTECTED]; 'John Nichel'; [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


It's my understanding that persistent connections via the old ext/mysql was
a  flawed misfeature to begin with. This was one of several misfeatrures
corrected by the new mysqli extension. There is some information on the
subject here: http://www.zend.com/php5/articles/php5-mysqli.php

It would be my guess that pconnect will be a thing of the past. It's sort of
a drag, but running out of connections - as pconnect can cause - is a real
drag too. ;)

Jim Grill
Web-1 Hosting
http://www.web-1hosting.net

- Original Message -
From: "bruce" <[EMAIL PROTECTED]>
To: "'John Nichel'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, July 31, 2004 12:10 AM
Subject: RE: [PHP] db transactions across multiple pages...


> you also won't see the mysqli pconnect function... which tells me that at
> least for now, it's not there...
>
> -bruce
>
>
> -Original Message-
> From: John Nichel [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 30, 2004 8:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] db transactions across multiple pages...
>
>
> bruce wrote:
> > not sure if it's php/mysqli... but if you check the php.net for the
> "mysqli"
> > not "mysql" functions... you won't see the persistent attribute listed
for
> > the php.ini attributes...
>
> I wouldn't worry too much about that though.  I mean if persistant
> connections are required for transactions, I'm sure it will be there.
> The only reason we may not be seeing it now is because the PHP5
> documentation is full of holes (with it not being a production release
> yet).  I know of a few items that are available in PHP5 that aren't
> documented on php.net yet.
>
> --
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] db transactions across multiple pages...

2004-07-31 Thread bruce
curt...

the method i described allows one to essentially have/maintain persistent
connections...

-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 31, 2004 8:59 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


* Thus wrote bruce:
> yeah...
>
> i saw that write up. i've also inquired with bugs.mysql as to if/whether
> this might be reinserted.. we'll see.

You don't need persistant connections with the method you describe.
The pool app simply manages multiple connections.




Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--
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] db transactions across multiple pages...

2004-07-31 Thread bruce
the method i described gives the user/app a potential way of
establsihing/maintaining/using the same connection thoughout the life of the
web app/session...

with this approach, one could possible have the 'persistent' conection
handle to the db that i've been talking about... which would then allow for
transactional processing across multiple pages within a web app



-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 31, 2004 8:59 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] db transactions across multiple pages...


* Thus wrote bruce:
> yeah...
>
> i saw that write up. i've also inquired with bugs.mysql as to if/whether
> this might be reinserted.. we'll see.

You don't need persistant connections with the method you describe.
The pool app simply manages multiple connections.




Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--
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] function similar to to sizeof

2004-07-31 Thread bruce
does php have a function similar to the 'C' sizeof function...

i'm looking to copy an object, and i'd like to be able to copy it at the
binary level

but i need to be able to determine the size of the object...

any thoughts/comments..???

thanks

-bruce

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



RE: [PHP] function similar to to sizeof

2004-07-31 Thread bruce
specifically, i'm looking to return an object using the socket_write(). this
requires that i be able to give it the size of the object being passed...

if you know of another approach, i'm more than interested...

-thanks


-Original Message-
From: raditha dissanayake [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 31, 2004 6:16 PM
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] function similar to to sizeof


bruce wrote:

>does php have a function similar to the 'C' sizeof function...
>
>
yep in PHP 5 but it's just an alias for count.

>i'm looking to copy an object, and i'd like to be able to copy it at the
>binary level
>
>
So how about using the clone feature of PHP5 instead of doing this manually.

>but i need to be able to determine the size of the object...
>
>
not sure why you want to do that.

>any thoughts/comments..???
>
>

quick and dirty way to copy and object serialize it into a string and
deserialize it back again.

>thanks
>
>-bruce
>
>
>


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

--
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] Upgrade PHP?

2004-08-01 Thread bruce
i've successfully built php5 on rh8 with no issues...

if you search through the achives of this mailing list you'll see what i
did. look for mysqli/php.

what issues are you haveing when you build from source...???

let us know, and i'm sure someone can help



-Original Message-
From: Will Collins [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 01, 2004 6:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Upgrade PHP?


I'm having problems upgrading PHP from 4.2.2 to 4.3.8 on RedHat 9.  I've
tried simply making the 4.3.8 from source, but RedHat didn't use the default
PHP folder structure is seems, since there has been no change in my PHP
version.  I also tried the "./configure" string returned by 'phpinfo()'
(assuming that the correct path info was included) with no luck.  Does
anyone have any tips on an easier way to upgrade?



Thanks,

Will

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



[PHP] pconnect...

2004-08-02 Thread bruce
hi...

since pconnect is not supported in php5, i'm wondering if the issue is that
mysql no longer supports the underlying functions to implement pconnect, or
if the decision to leave it out was based upon other factors.

also, is there anybody i can talk to who has looked at the actual code
within the earlier php4 regarding the pconnect issue?

thanks

-bruce

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



RE: [PHP] pconnect...

2004-08-02 Thread bruce
i meant mysqli/php5 regarding pconnect. although, i've since seen
information that leads me to believe htat pconnect would necessarily in and
of itself be my solution.

i'm starting to believe that a real solution for this would have to be
implemented within mysql itself...

-bruce


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 11:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] pconnect...


* Thus wrote bruce:
> hi...
>
> since pconnect is not supported in php5, i'm wondering if the issue is
that
> mysql no longer supports the underlying functions to implement pconnect,
or
> if the decision to leave it out was based upon other factors.

php5 has pconnect.  You're getting mysql/mysqli confused:

  mysql_pconnect();  // valid
  mysqli_pconnect(); // NOT valid

pconnect was removed from the mysqlImproved extension because
it usually causes more problems than it solves. mysqli is only for
mysql database versions >= 4.1.2, anything less you will still use
mysql.


Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--
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] pconnect...

2004-08-02 Thread bruce
i meant mysqli/php5 regarding pconnect. although, i've since seen
information that leads me to believe that pconnect would "not" necessarily
in and of itself be my solution.

i'm starting to believe that a real solution for this would have to be
implemented within mysql itself...

-bruce


-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 11:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] pconnect...


* Thus wrote bruce:
> hi...
>
> since pconnect is not supported in php5, i'm wondering if the issue is
that
> mysql no longer supports the underlying functions to implement pconnect,
or
> if the decision to leave it out was based upon other factors.

php5 has pconnect.  You're getting mysql/mysqli confused:

  mysql_pconnect();  // valid
  mysqli_pconnect(); // NOT valid

pconnect was removed from the mysqlImproved extension because
it usually causes more problems than it solves. mysqli is only for
mysql database versions >= 4.1.2, anything less you will still use
mysql.


Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

--
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] Upgrade PHP?

2004-08-02 Thread bruce
provide us with a copy of the attributes you used when you compiled...

ie ./configure --attributeA --ldapetc...


-Original Message-
From: Will Collins [mailto:[EMAIL PROTECTED]
Sent: Monday, August 02, 2004 12:21 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Upgrade PHP?


Well I uninstalled PHP, Apache, and all dependant RPMs.  I compiled both
from source, and although the compile went well, I'm having problems getting
modules installed into PHP.  For example, when using phpinfo(), I am told
that GD is installed, but trying to use GD functions won't work.  What now,
guys?

Will

-Original Message-
From: Support [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 01, 2004 10:11 PM
To: Will Collins; [EMAIL PROTECTED]
Subject: Re: [PHP] Upgrade PHP?

I've dealt with a similar problem with Mandrake. Some distros have their own
idea of where things should go. I prefer to install major applications like
apache, perl, mysql, php myself and never install from rpm or accept default
distro packages when installing an os from scratch.

IMHO: Although handy for some things, I still can't figure out why people
put up with rpms. :-)

What I finally did is use rpm to uninstall php, apache, and mysql. I also
followed dependencies and deleted them as well.

This approach is not really a great idea if you're not used to building from
source, but I have my own idea of where I like things to go so this works
for me. Usually /usr/local is a good choice for installing.

Since mysql and apache both come with their own start up scripts using
chckconfig to add them to the system is about as easy as it gets.

Jim Grill
Web-1 Hosting
http://www.web-1hosting.net

- Original Message -
From: "Will Collins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 01, 2004 8:03 PM
Subject: [PHP] Upgrade PHP?


> I'm having problems upgrading PHP from 4.2.2 to 4.3.8 on RedHat 9.  I've
> tried simply making the 4.3.8 from source, but RedHat didn't use the
default
> PHP folder structure is seems, since there has been no change in my PHP
> version.  I also tried the "./configure" string returned by 'phpinfo()'
> (assuming that the correct path info was included) with no luck.  Does
> anyone have any tips on an easier way to upgrade?
>
>
>
> Thanks,
>
> Will
>
>

--
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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] looking for a solid/good basic registration/login app/script

2004-08-07 Thread bruce
hi...

i'm looking for a good/solid login/registration script that's in the open
source domain.

it can have it's own db/table structure. i can always rearchitect...

i'd like it to have an admin function, and the ability to verify users via
email, etc...

anybody have a favorite/good app that they've used/implemented.

i've look through lots of scripts, and decided to check here for additional
input.

thanks

-bruce

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



[PHP] updating a frame from within php...

2004-08-10 Thread bruce
hi...

this probably doens't belong here.. but i'll try!

i have a two frame window. when the user logs into the 'main' window, i want
to be able to 'update' the 'main' window and then hte 'nav' window. some
underlying vars are getting set, and i need to be be able to refresh
elements/links in the 'nav' window with the new values...

searching through google, hasn't really shed any insight/light on the best
approach for this..

any ideas/pointers/comments/thoughts...

thanks

-bruce

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



[PHP] redirecting to another frame using php header function

2004-08-11 Thread bruce
hi...

can anyone point me to a way to do a page redirect using the php 'Header'
function to another frame. I have a page in one frame, when the user does a
submit, i want to have the app do a redirect using the 'Header' function,
with the subsequent page being displayed in another frame.

didn't find anything from google/php.net

thanks

-bruce



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

RE: [PHP] updating a frame from within php...

2004-08-11 Thread bruce
in the event the user disbales j'script, i'm looking for an alternative...

in my case, it should be pretty easy, because i'm looking to reload the
entire page into the "_top"/"parent" frame/window. however, when i send the
header, it gets interpreted as reloading in the same frame. which is not
what i want to occur!!!

i've seen some references to meta-tag attributes within the HEADER that
alude to being able to specify the target window for the content...

regards.



-Original Message-
From: Ed Lazor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 11:23 AM
To: 'Scot L. Harris'; [EMAIL PROTECTED]
Subject: RE: [PHP] updating a frame from within php...


> Have been trying to find a way to do this myself.  One idea I had to do
> this from within PHP was to define the nav frame as a function which
> would be called based on the actions in the main window.  The nav frame
> function would use the target elements to send their output to the
> correct frame.
>
> Have not tried this yet so I am not sure that would work.  Have not been
> able to think of any other way to do it from PHP.

In case it helps, think of PHP as server-side only.  PHP processes scripts
and outputs a web page that gets sent to the client / browser.  Any activity
occuring on the client/browser side needs to be handled by something like
Javascript.

Do a google on "javascript frame reload" and you'll see several examples of
how to do this.

-Ed

--
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] download file question...

2004-08-19 Thread bruce
hi...

i can allow files to be uploaded to my app. are there corresponding
scripts/code to allow files to be downloaded to the user via the browser??

just occurred to me that i'll want to do this...

nothing jumps out at me searching google/php.net for this...

thanks

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



[PHP] php err msg/issue...

2004-10-13 Thread bruce
hi...

i'm dealing with an app that's throwing an err/warning msg.. i'm using php5,
on a linux rh8.0 system.

i believe the code was written for php4.

the code is:

if($rec)
 {
$rs->append($setDefaults);
$rs->rows[$rs->pos]->fields=$rec;  <<<<<rows[$rs->pos]->id=-1;
}

$rec = Array ( [0] => 0 [1] => admin [2] => 21232f297a57a5a743894a0e4a801fc3
[3] => [4] => TRUE )


the err msg being generated is:
Php-Txt-Db-Access Error:
PHP Error: [2048] Creating default object from empty value [Line: 1537]
[File: /var/www/html/blast/txtdbapi/resultset.php]


i'm not sure why this is generated, or what's going on, or even how/why to
correct it!! apparently this doesn't happen with php4, but i'm not certain.

any thoughts/opinions/comments would be helpful...

thanks

-bruce

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



RE: [PHP] php err msg/issue...

2004-10-13 Thread bruce
$rec is not empty

jason...

1st, if $rec was empty.. the 'if' section would not be called, and the err
would not be thrown

2nd.. i printed the value of '$rec' below the 'if' block of code...

but.. umm thanks...



-Original Message-
From: Jason Davidson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 13, 2004 9:51 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] php err msg/issue...


I gather $rec is empty.. :)  make sure there is something in it before
you assign it to that object member.

Jason
<[EMAIL PROTECTED]> wrote:
>
> hi...
>
> i'm dealing with an app that's throwing an err/warning msg.. i'm using
php5,
> on a linux rh8.0 system.
>
> i believe the code was written for php4.
>
> the code is:
>
> if($rec)
>  {
> $rs->append($setDefaults);
> $rs->rows[$rs->pos]->fields=$rec;  <<<<< $rs->rows[$rs->pos]->id=-1;
> }
>
> $rec = Array ( [0] => 0 [1] => admin [2] =>
21232f297a57a5a743894a0e4a801fc3
> [3] => [4] => TRUE )
>
>
> the err msg being generated is:
> Php-Txt-Db-Access Error:
> PHP Error: [2048] Creating default object from empty value [Line: 1537]
> [File: /var/www/html/blast/txtdbapi/resultset.php]
>
>
> i'm not sure why this is generated, or what's going on, or even how/why to
> correct it!! apparently this doesn't happen with php4, but i'm not
certain.
>
> any thoughts/opinions/comments would be helpful...
>
> thanks
>
> -bruce
>
> --
> 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] php err msg/issue...

2004-10-13 Thread bruce
curt...

when i print $rs, i get the following:
displaying $rs shows that $rs is:

ResultSet Object (
[colNames] =>
Array ( [0] => id [1] => username [2] => password [3] => email [4] =>
is_super )
[colAliases] =>
Array ( )
[colTables] =>
Array ( )
[colTableAliases] =>
Array ( )
[colTypes] =>
Array ( [0] => inc [1] => str [2] => str [3] => str [4] => str )
[colDefaultValues] =>
Array ( [0] => 0 [1] => noname [2] => d41d8cd98f00b204e9800998ecf8427e [3]
=> [EMAIL PROTECTED] [4] => FALSE )
[colFuncs] => Array ( )
[colFuncsExecuted] => Array ( )
[rows] => Array ( ) <<<<<<<<<<<<<<<
[pos] => 0 <<<<<<<<<<<<<<<<<
[orderColNrs] => Array ( )
[orderTypes] => Array ( ) )

when i print $rs->pos, i get '0'

so are you saying that the code can't handle '$rs->rows[0] = $rec'

if this is the case, how can this be corrected

i guess it boils down to, how do you create/initialize/add a row to the db
structure..???

thanks...

-bruce


ps..

i tried to print $rs->rows[0], and got an 'Undefined offset: 0' err msg
so this would seem to support what you're saying...

so how can i correct/modify this!



-Original Message-
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 13, 2004 10:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] php err msg/issue...


* Thus wrote bruce:
> hi...
>
> i'm dealing with an app that's throwing an err/warning msg.. i'm using
php5,
> on a linux rh8.0 system.
>
> i believe the code was written for php4.
>
> the code is:
>
> if($rec)
>  {
> $rs->append($setDefaults);
> $rs->rows[$rs->pos]->fields=$rec;  <<<<<...
>
> the err msg being generated is:
> Php-Txt-Db-Access Error:
> PHP Error: [2048] Creating default object from empty value [Line: 1537]
> [File: /var/www/html/blast/txtdbapi/resultset.php]

This is because the element in $rs->rows[$rs->pos] is not defined
so php made a stdClass before it can assign the ->fields member.


Curt
--
Quoth the Raven, "Nevermore."

--
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] looking for a few php partners/developers....

2004-10-14 Thread bruce
hi...

i'm curious.. if i'm putting together a project, and am looking for a few
php developers as sweat equity partners, is this an appropriate place to
post my request..???

thanks

-bruce
[EMAIL PROTECTED]


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

[PHP] looking for a few php partners/developers....

2004-10-14 Thread bruce
Hi.

We're currently working on a project and need a few php developers to really
ramp up the creation of the application/system. 

We're building an overall system to allow college students to buy/sell used
books online. The systems to support this effort have a number of components
that have to be fleshed out/created. The role of the developer will be to
essentially create the support apps. As a developer, you will be part of the
team, with a sweat equity position. We do not look at this as being a full
time commit, nor do we believe that the initial implementation should take a
great deal of time.

While we could do the development ourselves, we need to greatly accelerate
the process!!

I've intentionally kept this short, as I don't want to abuse the bandwidth.
If you're interested, drop me a line, and we can discuss what we're doing,
and how we're going to get there...

Thanks for reading!

-Bruce Douglas
[EMAIL PROTECTED]



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

[PHP] returning values/information from perl apps to php apps..

2004-10-04 Thread bruce
hi...

i'm trying to return values/information from a perl app to a php app. what's
the best way??

foo.php

blah
res = system(dog.pl)
.
.

---
dog.pl

$vars
.
.
.

--

the issue i'm having is that perl only seems to allow an app to have an
'exit' value of a short int. i need to return values that might be multiple
arrarys. should i simply write the perl return values into an output file,
and read the output vars from the output file in the php file...

comments/thoughts/etc

thanks

-bruce

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



[PHP] RE: returning values/information from perl apps to php apps..

2004-10-04 Thread bruce
eric...

how does using serialize allow the information from the perl app to be used
by the php parent app. unless you're implying that the serialized
information is stored in an external file, that's then read by the php
calling/parent app...

-bruce


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Eric Germann
Sent: Monday, October 04, 2004 7:49 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: returning values/information from perl apps to php apps..


Php::serialize

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
bruce
Sent: Monday, October 04, 2004 9:55 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: returning values/information from perl apps to php apps..

hi...

i'm trying to return values/information from a perl app to a php app. what's
the best way??

foo.php

blah
res = system(dog.pl)
.
.

---
dog.pl

$vars
.
.
.

--

the issue i'm having is that perl only seems to allow an app to have an
'exit' value of a short int. i need to return values that might be multiple
arrarys. should i simply write the perl return values into an output file,
and read the output vars from the output file in the php file...

comments/thoughts/etc

thanks

-bruce



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

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



[PHP] probs generating multiple drop down select lists within a single form

2004-10-17 Thread bruce
hi...

i have a prob/issue that i can't see.. i'm trying to geneate a page with
multiple lists so that the user has to select an item from all 3 lists in
order to access the next page...

the 1st select/list allows the user to select either one or more items. the
2nd/3rd select lists require the user to select only a single item from the
lists.

ie:
list1  list2list3  >submitBTN<

the user would select the items from all three lists, and hit the selectBTN,
to go to the next page...

the prob that i'm having is that if i simply select item(s) from the 1st
list, then the code allows the user to continue...in other words, the app
looks as though the user has selected an item from the 2nd/3rd even though
they haven't been selected... in examining the code, it appears that the
last item in the 2nd/3rd lists is being somehow read/inserted into the
items, and are somehow included in the querystring...

my code is:

   /*
  generate the state list
   */
   echo"
  
  
  
  
   ";

  $state_query = "select * from stateTBL";
  $res = mysqli_query($link, $state_query);
  //$res = mysql_query($query);

  //go ahead and process/populate the drop down
  //menu
  echo "All States\n";
  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
  {
 echo "".$row['name']."\n";

  }

   echo"
  
  
   ";


   /*
  generate the year list
   */
   echo"
  
  
   ";

  $year_query = "select * from yearTBL";
  $res = mysqli_query($link, $year_query);
  //$res = mysql_query($query);

  //go ahead and process/populate the drop down
  //menu
  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
  {
 echo "".$row['year']."\n";
  }

   echo"
  
  
   ";


   /*
  generate the terms list
   */
   echo"
  
  
   ";

  $term_query = "select * from termTBL";
  $res = mysqli_query($link, $term_query);
  //$res = mysql_query($query);

  //go ahead and process/populate the drop down
  //menu
  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
  {
 echo "".$row['term']."\n";
  }

   echo"
  
  
   ";

   $blah = $userdata['session_id'];

   echo"
  
  
  
  
  
  
  
   ";


in foo.php, i simply display the $_GET['state'], $_GET['year'],$_GET['term']
vars to see what they are...

if i make all the select vars for the query terms arrays, it works as it
should, in that if all three lists aren't selected, then the user can't
proceed. however, if i use the select  for the 2nd/3rd
lists, then the logic screws up...

any idea why this is occuring

is there a better way/example of using multiple drop down lists within a
single form.

any thoughts/comments/pointers would be helpful.. i'm pretty sure that the
issue/prob is rather straight forward/simple, but i can't see it right
now

thanks...

-bruce

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



RE: [PHP] probs generating multiple drop down select lists within a single form

2004-10-18 Thread bruce
the code is pretty much as i provided. the issue is that the query seems to
insert a value into the query string for the select lists, even though i
don't actually select an item.

i'm trying to figure out what has to happen to allow the select vars to be
'' if the user hasn't selected anything.

this should be pretty straight forward, but i'm missing something...

thanks

-bruce


-Original Message-
From: Greg Donald [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 17, 2004 6:14 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] probs generating multiple drop down select lists
within a single form


On Sun, 17 Oct 2004 17:23:14 -0700, bruce <[EMAIL PROTECTED]> wrote:
> i have a prob/issue that i can't see.. i'm trying to geneate a page with
> multiple lists so that the user has to select an item from all 3 lists in
> order to access the next page...
>
> the 1st select/list allows the user to select either one or more items.
the
> 2nd/3rd select lists require the user to select only a single item from
the
> lists.
>
> ie:
>list1  list2list3  >submitBTN<
>
> the user would select the items from all three lists, and hit the
selectBTN,
> to go to the next page...
>
> the prob that i'm having is that if i simply select item(s) from the 1st
> list, then the code allows the user to continue...in other words, the app
> looks as though the user has selected an item from the 2nd/3rd even though
> they haven't been selected... in examining the code, it appears that the
> last item in the 2nd/3rd lists is being somehow read/inserted into the
> items, and are somehow included in the querystring...
>
> my code is:
>
>   /*
>  generate the state list
>   */
>   echo"
>  
>  

Why $foo here?  Maybe not enough context for me to understand the
reason, I dunno.

>  
>  
>   ";
>
>  $state_query = "select * from stateTBL";
>  $res = mysqli_query($link, $state_query);
>  //$res = mysql_query($query);
>
>  //go ahead and process/populate the drop down
>  //menu
>  echo "All States\n";
>  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
>  {
> echo " ='".$row['val']."'>".$row['name']."\n";
>
>  }
>
>   echo"
>  
>  
>   ";
>
>   /*
>  generate the year list
>   */
>   echo"
>  
>  
>   ";

Did you mean year[] here?  Otherwise why multiple?

>  $year_query = "select * from yearTBL";
>  $res = mysqli_query($link, $year_query);
>  //$res = mysql_query($query);
>
>  //go ahead and process/populate the drop down
>  //menu
>  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
>  {
> echo " ='".$row['year']."'>".$row['year']."\n";
>  }
>
>   echo"
>  
>  
>   ";
>
>   /*
>  generate the terms list
>   */
>   echo"
>  
>  
>   ";
>
>  $term_query = "select * from termTBL";
>  $res = mysqli_query($link, $term_query);
>  //$res = mysql_query($query);
>
>  //go ahead and process/populate the drop down
>  //menu
>  while($row = mysqli_fetch_array($res, MYSQL_ASSOC))
>  {
> echo "".$row['term']."\n";
>  }
>
>   echo"
>  
>  
>   ";
>
>   $blah = $userdata['session_id'];
>
>   echo"
>  
>  
>  
>  
>  
>  
>  
>   ";
>
> in foo.php, i simply display the $_GET['state'],
$_GET['year'],$_GET['term']
> vars to see what they are...
>
> if i make all the select vars for the query terms arrays, it works as it
> should, in that if all three lists aren't selected, then the user can't
> proceed. however, if i use the select  for the
2nd/3rd
> lists, then the logic screws up...
>
> any idea why this is occuring
>
> is there a better way/example of using multiple drop down lists within a
> single form.

Possibly.  I'd recommend using print_r($_GET) to see your form
submissions.  To make sure your actually getting what you want to be
getting.

> any thoughts/comments/pointers would be helpful.. i'm pretty sure that the
> issue/prob is rather straight forward/simple, but i can't see it right
> now

Not sure exactly what is broken, is that your entire script as posted?


--
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

--
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] how to create multiple selects within php

2004-10-18 Thread bruce
hi...

i can create a form with a single select by something like:



fff
aaa




however, i need to know how to create a multiple menu/list within a single
form.

i've tried a few different approaches, but i'm doing something wrong, in
that the querystring is being populated with a value for the select list var
even though i don't select the item.

if someone can point me to an actual working example of php code that
generates multiple lists/menus within a form, i'd appreciate it!!

thanks

-bruce

ps. if needed, i can supply the actual test code i've used to create the
condition i'm describing...

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



RE: [PHP] how to create multiple selects within php

2004-10-18 Thread bruce
ok...

it appears to be a case of user err.. the spec seems to state that if the
user doesn't select/specify an item, the select should return the 1st item
within the list... arrrgggh!! this is what's happening...

so my question is still, how can i implement some logic that requires the
user to actually select an item? or, how can i detect when a user has
actually selected a list item??

thanks...

-bruce


-Original Message-----
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Monday, October 18, 2004 7:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] how to create multiple selects within php


hi...

i can create a form with a single select by something like:



fff
aaa




however, i need to know how to create a multiple menu/list within a single
form.

i've tried a few different approaches, but i'm doing something wrong, in
that the querystring is being populated with a value for the select list var
even though i don't select the item.

if someone can point me to an actual working example of php code that
generates multiple lists/menus within a form, i'd appreciate it!!

thanks

-bruce

ps. if needed, i can supply the actual test code i've used to create the
condition i'm describing...

--
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] how to create multiple selects within php

2004-10-18 Thread bruce
john...

the code (and the rfc) seems to suggest otherwise. personally, i would have
thought, if the user doesn't select a menu, then the 'menu item' should not
have anything with regards to the querystring...

however, the spec implies something different:
http://www.w3.org/TR/REC-html40/interact/forms.html#edef-OPTION


17.6.1 Pre-selected options
Zero or more choices may be pre-selected for the user. User agents should
determine which choices are pre-selected as follows:

If no OPTION element has the selected attribute set, user agent behavior for
choosing which option is initially selected is undefined. Note. Since
existing implementations handle this case differently, the current
specification differs from RFC 1866 ([RFC1866] section 8.1.3), which states:
The initial state has the first option selected, unless a SELECTED attribute
is present on any of the  elements.
Since user agent behavior differs, authors should ensure that each menu
includes a default pre-selected OPTION.
-

if you can manage to create a sample that has 2 menu lists, each with a few
items that has the behavior you say should occur, i'd like to take a look.

i currently have code which lists 3 menus, each of which has a few items in
the list...

all the menu/lists are within a single form, with a single "inputBTN".

if the user selects the menu/list for states that has a multiple select,
then the other two lists return their 1st items, even though they haven't
been selected

thanks

-bruce



-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: Monday, October 18, 2004 7:31 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how to create multiple selects within php


bruce wrote:
> ok...
>
> it appears to be a case of user err.. the spec seems to state that if the
> user doesn't select/specify an item, the select should return the 1st item
> within the list... arrrgggh!! this is what's happening...

Not true.  If the user doesn't select anything, nothing will be
submitted (unless you have one or more of your option tags like this
)

> so my question is still, how can i implement some logic that requires the
> user to actually select an item? or, how can i detect when a user has
> actually selected a list item??

Test to see if anything has been submitted.  If your select tag is as
such...



When you submit the form, you can check it like this...

if ( isset ( $_POST['foo'] ) ) {
//user has selected something
do stuff
} else {
//user did not select anything
do other stuff
}

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
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] how to create multiple selects within php

2004-10-18 Thread bruce
i've decided to punt...

and do something similar to what i had initially created, which implements
basically what you have below... the user will just have to be satisfied
with seeing the 1st item that's a default/dummy item...

thanks...

-bruce


-Original Message-
From: Silvio Porcellana [mailto:[EMAIL PROTECTED]
Sent: Monday, October 18, 2004 7:44 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how to create multiple selects within php


You can do something like this:



 - - choose one - -
fff
aaa
.



and then in your PHP:


Anyway, you can catch this only *after* the form is submitted: in case you
want to block
the user from submitting the form if the 'foo' select is empty you need to
use some
javascript:

function check_form(form) {
if (form.foo.value == '') {
alert("C'mon!!!");
return false;
}
}


and in your HTML you need to add something like this to the  tag:








Anyway, this has more to do with HTML and JavaScript than PHP...


HTH, cheers
Silvio Porcellana

bruce wrote:
> ok...
>
> it appears to be a case of user err.. the spec seems to state that if the
> user doesn't select/specify an item, the select should return the 1st item
> within the list... arrrgggh!! this is what's happening...
>
> so my question is still, how can i implement some logic that requires the
> user to actually select an item? or, how can i detect when a user has
> actually selected a list item??
>
> thanks...
>
> -bruce
>
>
> -Original Message-
> From: bruce [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 18, 2004 7:07 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] how to create multiple selects within php
>
>
> hi...
>
> i can create a form with a single select by something like:
>
> 
> 
> fff
> aaa
> 
> 
> 
>
> however, i need to know how to create a multiple menu/list within a single
> form.
>
> i've tried a few different approaches, but i'm doing something wrong, in
> that the querystring is being populated with a value for the select list
var
> even though i don't select the item.
>
> if someone can point me to an actual working example of php code that
> generates multiple lists/menus within a form, i'd appreciate it!!
>
> thanks
>
> -bruce
>
> ps. if needed, i can supply the actual test code i've used to create the
> condition i'm describing...
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] people/projects looking for developers...

2004-10-18 Thread bruce
hi...

a question for consideration. are there sites set up for people who have
ideas/projects, who are looking for developers. or vice versa, are there
sites for developers who are looking to be part of projects.

i'm not referring to open source projects, rather projects that are intended
to be revenue generating businesses.

thanks

Bruce Douglas
[EMAIL PROTECTED]

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



RE: [PHP] people/projects looking for developers...

2004-10-18 Thread bruce
interesting...

for the most part, people have responded with contract resource sites...
(guru.com/elance.com/etc)

no one has mentioned any kind of site specifically geared towards people who
want to come together to kind of build applications. ala the old
garage/basement type of process were you get a few guys together with a few
sales guys, and they build/start to sale the app, and create a biz...

so my question i guess, is why the hell isn't there more of an interest in
this kind of atmosphere..

have people just been too dam* burned too many times, or are people really
just satisfied with their jobs

interesting...

thanks

-bruce


-Original Message-
From: Dan Joseph [mailto:[EMAIL PROTECTED]
Sent: Monday, October 18, 2004 6:57 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] people/projects looking for developers...


> a question for consideration. are there sites set up for people who have
> ideas/projects, who are looking for developers. or vice versa, are there
> sites for developers who are looking to be part of projects.
>
> i'm not referring to open source projects, rather projects that are
intended
> to be revenue generating businesses.

www.itmoonlighter.com is one that I use to use.  It has both companies
looking to find developers for their projects, and developers looking
for extra work.  I'm sure there are other sites, but I can't think of
'em.

-Dan Joseph

--
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] ability to find include files...

2008-11-17 Thread bruce
hi t!!

strace is something i would have used.. but unfortunately, strace (at least as 
far as i can tell) doesn't work with web based apps...

thanks


-Original Message-
From: Thodoris [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 16, 2008 11:42 PM
To: Andrew Ballard
Cc: bruce; php-general@lists.php.net
Subject: Re: [PHP] ability to find include files...




On Sat, Nov 15, 2008 at 6:07 PM, bruce <[EMAIL PROTECTED]> wrote:
  
Hi list...

starting to go through a debug/understanding session of a couple of php web
apps. i'm wondering if there's any kind of tool/method that i can use to see
which files are accessed/included/required when a given page is displayed..

this would allow me to quickly understand the "flow" of the apps. searching
via google hasn't really turned up anything...

thoughts/comments/pointers welcome.

thanks!



Yes. How about get_included_files().

http://www.php.net/get_included_files

Andrew

  

This of course shows the included files but if you *really* need to go much 
deeper (although this is probably an overkill) you could try tracing when the 
process opens a file using strace along with grep if you are in unix.


-- 
Thodoris


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



RE: [PHP] while-question

2008-11-17 Thread bruce
curious qiestion

to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..

or is the majority of the work here from people who've grabbed the tools and
started programming... ?


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 9:53 AM
To: Stut
Cc: Nathan Rixham; php-general@lists.php.net
Subject: Re: [PHP] while-question


On Mon, 2008-11-17 at 14:54 +, Stut wrote:
> On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
> > if you really want a challenge try this one..
> >
> > task: add the numbers 5 and 17 together, using php, without using
> > the + operator. fill it in:
> >
> > function add($a , $b) {
> > //code here but no + - / * operators
> > return $answer;
> > }
> >
> > echo add(5, 17);
>
> Elemental my dear Mr Rixham...

What level is that elemental?

> function add($a , $b)
> {
>$answer = $a ^ $b;
>while (0 != ($a & $b))
>{
>  $b = ($a & $b) << 1;
>  $answer = $answer ^ $b;
>}
>return $answer;
> }

He only said you couldn't use the + operator... nothing was said about
using the - operator.

$total = -(-5 - 17);

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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] Scheduling scripts?

2008-11-18 Thread bruce
he's looking to create a script/app for his own.clent usage..

not to just use google's cal app,,,

check out freshmeat.net, or sourceforge if you haven't already...


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf
Of Richard Heyes
Sent: Tuesday, November 18, 2008 3:42 PM
To: tedd
Cc: PHP General Mailing List
Subject: Re: [PHP] Scheduling scripts?


> Dones anyone have any scheduling scripts that they might share OR can give
> me a link to some?
>
> I need a way for a user to register an appointment via a calendar.
>
> I don't want to write something that's already been done and available.

Not sure if it does what you want, but you might try looking at Google
calendar. It's very good.

--
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 15th)

--
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] while-question

2008-11-19 Thread bruce
interesting points regarding college and programming..

my degrees bsee/msee covered alot more than pure programing.. as a double 
ee/cs, the ability to articulate an issue/problem, and bring to mind a cogent 
thought process was valuable. the ability to understand how different 
algorithms worked, and how code actually played with the lower intracacies of 
the processor where quite valuable. 

and no.. i'm no longer the engineer i was a time ago..

so.. interesting...


-Original Message-
From: Wolf [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 11:55 AM
To: tedd
Cc: php-general@lists.php.net
Subject: RE: [PHP] while-question


> Dabbling?
> 
> I think that making a living from it isn't dabbling, so I may not be 
> qualified to speak for the dabblers.
> 
> But for me, I was writing code before there were such courses. Later, 
> when I went to college I was taught adventures in keypunching and 
> received several "next to worthless" degrees.
> 
> I say "next to worthless" only because what they taught really wasn't 
> applicable to real world programming. As for management, clients, and 
> hr types, the degrees mattered, but not for much more than that.
> 
> In any event, I doubt if any college courses are keeping up with 
> current web technology -- there has always been a lag between what's 
> practiced and what's taught. What I've seen of college web sites, 
> seems to support that claim.
> 
> If I was taught in college all I needed to know, then what am I doing 
> with these dozens of web books scattered about my office? I probably 
> read a new book every other week.

I don't "dabble" in it either, unless you consider making my living from being 
a dabbler, in which case I'll continue to dabble and see the pay for it.  My 
alma-mater tried to stay current to some degree, but when they let someone who 
wrote the C++ book try to teach it, well they gave that person more rope then 
they needed.

Tedd, glad you got hooked on Phonics.  One of these days I hope from graduating 
from just looking at the pictures, but right now the pictures are oh so 
enticing!. ;)  

Wolf

-- 
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] Model Web Site

2008-11-21 Thread bruce
hi...

for what it's worth. the best approach might be to find a few sites that
have the functionality/layout you like. there are probably a few of them
that you'll run across that meet what you have in mind. use these as your
basic guides. add additional features that you'd like.

you now have (roughly speaking) the requirements/functions that you want
your final site to have. from here, you can figure out which "scripts" you
want to apply, and what you're still going to have to provide. keep in mind
that you can't simply throw scripts together, but you can use them to get a
sense of the underlying logic. you can also use them to see how to develop
your look/feel of your site.

looking at various scripts also gives you a chance to think about how you
want to implement your security/setup, as well as the underlying database
schema..

you can find plenty of apps/scripts on freshmeat.net/sourceforge.net as
well.

have fun!


-Original Message-
From: Stephen [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2008 2:17 PM
To: PHP-General
Subject: [PHP] Model Web Site


My prime hobby is photography and the next is web site building.

So now I have a young model (18+) asking me about getting a web site.

The idea is members can see content, that will include, photos, her blog
and a discussion forum.

I like the idea of building it, but it includes a lot of things I have
no experience in.

Can someone point me to documentation/tutorials/scripts or anything that
might help.

I don't want a turnkey solution. I want to learn how to do this.

Thank you!
Stephen

--
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] array/iteration issue!!

2008-11-27 Thread bruce
hi.

i have the following test multidiminsional array. i'm trying to figure out
how to iterate through the array, to produce something like

foo, physics, sss
foo, physics, sffgg
foo, english, sss
foo, english, sffgg

can't quite seem to get it right!!

thoughts/comments... etc...

thanks


$a=array("college"=> "foo",
 "dept"=>array("dept"=> "physics",
  "class"=>array("class1"=>"sss","class2"=>"sffgg")
),
"dept"=>array("dept"=> "english",
"class"=>array("class1"=>"sss","class2"=>"sffgg")
)
);


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



RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
hey robert..

ok.. so if i changed the array to have a dept1, and a dept2

$a=array("college"=> "foo",
 "dept1"=>array("dept"=> "physics",
  "class"=>array("class1"=>"sss","class2"=>"sffgg")
),
"dept2"=>array("dept"=> "english",
"class"=>array("class1"=>"sss","class2"=>"sffgg")
)
);
how would i iterate through this..??

thanks


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2008 6:18 PM
To: bruce
Cc: 'PHP General list'
Subject: Re: [PHP] array/iteration issue!!


On Thu, 2008-11-27 at 17:31 -0800, bruce wrote:
> hi.
>
> i have the following test multidiminsional array. i'm trying to figure out
> how to iterate through the array, to produce something like
>
> foo, physics, sss
> foo, physics, sffgg
> foo, english, sss
> foo, english, sffgg
>
> can't quite seem to get it right!!
>
> thoughts/comments... etc...
>
> thanks
>
> 
> $a=array("college"=> "foo",
>"dept"=>array("dept"=> "physics",
>   "class"=>array("class1"=>"sss","class2"=>"sffgg")
>   ),
>   "dept"=>array("dept"=> "english",
> "class"=>array("class1"=>"sss","class2"=>"sffgg")
> )
>   );

You can't. You're array is valid but the second 'dept' key overwrites
the first. Thus the physics dept is lost.

Check it for yourself... print_r( $a )

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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] array/iteration issue!!

2008-11-27 Thread bruce
hey robert!!

thanks. and yeah, you're right, it's not the best.. so tell me, given that
i'm ripping through this on the fly, and i can have the structure in any way
i choose. this is just to simulate/populate some test tbls.. what's a better
way to create an array structure to have a collegename, followed by some
deptnames, followed by some classnames for the depts...

perhaps something like this??

$a = array
(
"college" => "foo",
array
(
"dept"  => "physics",
"class" => array
(
"class1" => "sss",
"class2" => "sffgg"
)
),
array
(
"dept"  => "english",
"class" => array
(
"class1" => "sss",
"class2" => "sffgg"
)
)
);


-Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2008 7:10 PM
To: bruce
Cc: 'PHP General list'
Subject: RE: [PHP] array/iteration issue!!


On Thu, 2008-11-27 at 18:55 -0800, bruce wrote:
> hey robert..
>
> ok.. so if i changed the array to have a dept1, and a dept2
>
> $a=array("college"=> "foo",
>"dept1"=>array("dept"=> "physics",
>   "class"=>array("class1"=>"sss","class2"=>"sffgg")
>   ),
>   "dept2"=>array("dept"=> "english",
> "class"=>array("class1"=>"sss","class2"=>"sffgg")
> )
>   );
> how would i iterate through this..??

Your array is terribly structured. But the following provides traversal
in the way you want:

 "foo",
"dept1"   => array
(
"dept"  => "physics",
"class" => array
(
"class1" => "sss",
"class2" => "sffgg"
)
),
"dept2" => array
(
"dept"  => "english",
"class" => array
(
"class1" => "sss",
"class2" => "sffgg"
)
)
);

$college = $a['college'];
foreach( $a as $deptKey => $deptInfo )
{
if( strpos( $deptKey, 'dept' ) === 0 )
{
$dept = $deptInfo['dept'];
foreach( $deptInfo['class'] as $class )
{
echo "$college, $dept, $class\n";
}
}
}

?>

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


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



RE: [PHP] array/iteration issue!!

2008-11-27 Thread bruce
much props guys!!!

thanks!!


-Original Message-
From: Micah Gersten [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2008 8:23 PM
To: Robert Cummings
Cc: bruce; 'PHP General list'
Subject: Re: [PHP] array/iteration issue!!


Robert Cummings wrote:
> On Thu, 2008-11-27 at 19:36 -0800, bruce wrote:
>
>> hey robert!!
>>
>> thanks. and yeah, you're right, it's not the best.. so tell me, given
that
>> i'm ripping through this on the fly, and i can have the structure in any
way
>> i choose. this is just to simulate/populate some test tbls.. what's a
better
>> way to create an array structure to have a collegename, followed by some
>> deptnames, followed by some classnames for the depts...
>>
>> perhaps something like this??
>>
>> $a = array
>> (
>> "college" => "foo",
>> array
>> (
>> "dept"  => "physics",
>> "class" => array
>> (
>> "class1" => "sss",
>> "class2" => "sffgg"
>> )
>> ),
>> array
>> (
>> "dept"  => "english",
>> "class" => array
>> (
>> "class1" => "sss",
>> "class2" => "sffgg"
>> )
>> )
>> );
>>
>
> Not quite. The following is probably what you want:
>
> 
> $colleges = array
> (
> array
> (
> 'name'  => 'Blah Blah University',
> 'depts' => array
> (
> array
> (
> 'name'=> 'physics',
> 'classes' => array
> (
> 'sss',
> 'sffgg',
> ),
> ),
> array
> (
> 'name'=> 'english',
> 'classes' => array
> (
> 'sss',
> 'sffgg',
> ),
> ),
> ),
> ),
> array
> (
> 'name'  => 'Glah Gleh University',
> 'depts' => array
> (
> array
> (
> 'name'=> 'physics',
> 'classes' => array
> (
> 'sss',
> 'sffgg',
> ),
> ),
> array
> (
> 'name'=> 'english',
> 'classes' => array
> (
> 'sss',
> 'sffgg',
> ),
> ),
> ),
> ),
> );
>
> foreach( $colleges as $college )
> {
> $collegeName = $college['name'];
> foreach( $college['depts'] as $dept )
> {
> $deptName = $dept['name'];
> foreach( $dept['classes'] as $className )
> {
> echo "$collegeName, $deptName, $className\n";
> }
> }
> }
>
> ?>
>
> Cheers,
> Rob.
>
This is actually a much smaller data structure.

$colleges = array
(
'Blah Blah University' =>
array
(
'physics' => array
(
'sss',
'sffgg',
),
'english' => array
(
'sss',
'sffgg',
)
),
'Glah Gleh University' =>
array
(
'physics' => array
(
'sss',
'sffgg',
),
'english' => array
(
'sss',
'sffgg',
),
)
 );


foreach( $colleges as $collegeName => $depts )
{
 foreach( $depts as $deptName => $classes)
{
foreach( $classes as $className )
{
echo "$collegeName, $deptName, $className\n";
}
}
}


Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com





--
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] array/iteration issue!!

2008-11-27 Thread bruce
both ways work...!!!

this is a really simple/quick issue to populate some test db tbls.. i've
only played with multi php arrays (sp??) in passing... and my days of being
a serious eng/software guy are long over!!

although.. with this economy!

thanks




-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2008 8:40 PM
To: Micah Gersten
Cc: bruce; 'PHP General list'
Subject: Re: [PHP] array/iteration issue!!


On Thu, 2008-11-27 at 22:22 -0600, Micah Gersten wrote:
>
> This is actually a much smaller data structure.
>
> $colleges = array
> (
>   'Blah Blah University' =>
> array
> (
> 'physics' => array
> (
> 'sss',
> 'sffgg',
> ),
> 'english' => array
> (
> 'sss',
> 'sffgg',
> )
>   ),
>   'Glah Gleh University' =>
> array
> (
> 'physics' => array
> (
> 'sss',
> 'sffgg',
> ),
> 'english' => array
> (
> 'sss',
> 'sffgg',
> ),
> )
>  );
>
>
> foreach( $colleges as $collegeName => $depts )
> {
>  foreach( $depts as $deptName => $classes)
> {
> foreach( $classes as $className )
>     {
> echo "$collegeName, $deptName, $className\n";
> }
> }
> }

Yes, I thought of that one too, but it's less flexible. What if you need
to add other fields to the college, or department. Then you'd need to
redo the whole structure to something more similar to what I did. Since
bruce was having issues, I gave him a flexible format that could handle
other fields if they arose.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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] Trre/Drop Down quick app for testing database tbls

2008-11-28 Thread bruce
Hi.

I've got a few tbls that I'm testing. I'd like to have a simple web app to
be able to iterate through the tbls to test out what I have in them.

I'd like to be able to have each tbl as a drop-down/select box, so I select
from selecta, which lists items from TBL-A, which then uses the id from
TBL-A, to get the items from TBL-B that matches. Selecting from drop-down
for TBL-B, then gets me the list on TBL-C...

I've got 3-4 tbls that are linked by their id.

Rather than reinvent the wheel, I'm asking if anyone has a quick app that
they can point to that I can extract/modify the functionality for my
needs...

thanks


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



RE: [PHP] category and sub category traversal

2008-12-01 Thread bruce
hey vamvan...

you might pop this to the mysql email list as well, if you haven't already!

[EMAIL PROTECTED]


-Original Message-
From: VamVan [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2008 5:13 PM
To: php List
Subject: [PHP] category and sub category traversal


Hello,

I need some help in figuring out this logic.

I have two tables one for category and other for category_hierarchy.
category_hirerarchy has a column to determine the parent.

So the query I have to retrieve tree of one specific category is:

SELECT t.tid, t.*, parent FROM term_data t INNER JOIN term_hierarchy h ON
t.tid = h.tid WHERE t.vid = 16 ORDER BY weight, name;

The ones with parent = 0 is the top category

Now I need to prepare an associative array with parent child relation.

So bascially I need to retrieve [parentID] => array('childID', 'chidName')

Can anyone shed some light on the logic involved in preparation of this
array with out using multiple sql queries?

Thanks


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



[PHP] trying to figure out how to create the right query...

2008-12-11 Thread bruce
Hi.

I have the following test db/tbl setup. 

stateTBL
+--+
| stateName|
| stateID  |>>>+
+--+   V
   V
   V
collegeTBL V
+--+   V
| collegeName  |   V
| stateID  |<<<+
| collegeID|>>>+
+--+   V
   V
   V
deptTBLV
+--+   V
| deptName |   V
| collegeID|<<<+
| deptID   |>>>+
+--+   V
   V
   V
courseTBL  V
+--+   V
| courseName   |   V
| deptID   |<<<+
| courseID |>>>+
+--+   V
   V
   V
facultyTBL V
+--+   V
| facultyName  |   V
| courseID |<<<+
| ID   |
+--+


my intended app will allow the user to select a given
 item (college, dept, course, faculty) and to store
 this data. when a user is displaying a list of
 items, i'd like to have my app determine if the
 child of the item has been selected by the user.

so. if a user has selected stanford, i'd like to
 be able to have a query that returns 'true' for
 any item, that has a 'child' (leaf) already selected by
 the user. (this should work for any level of
 childTBL)

so if a user has selected a course, from the 
 stanford, physics dept, physics 101, i'd like to 
 have a query that returns 'true' if the user 
 selects 'stanford' from the list of colleges...

i can't quite seem to figure out the sql to make it happen...

thoughts/comments/etc..


i'm hoping that this makes sense!!

thanks



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



[PHP] Need a brain to bounce some Mysql/DB thoughts off of!!

2008-12-11 Thread bruce
Hi guys.

Architecting an app that's going to have users interacting with different
levels of the db/tbls, and trying to figure out a few things.

The highlevel layout looks like:
 collegeTBL
 deptTBL

 with ->collegeTBL.id = deptTBL.colID

I also have a status tbl for each collegeTBL/deptTBL

 college_statusTBL
   userID
   collegeID

 dept_statusTBL
   userID
   deptID

 with:
  collegeTBL.id=college_statusTBL.collegeID
  deptTBL.id=dept_statusTBL.deptID

So I limk the statusTBLs to the college/dept TBLs...

This is due to the fact that a user can elect to work on either a college,
or a given dept of the college.

I'm struggling with a good/best way to figure out how to develop a query to
determine what level of a college, (if any) a user has elected to work with.

I can do a multiple join across the collegeTBL/deptTBL, and the statusTBLs,
but this simply gets a large tbl, and I'd have to then parse the results...
I'm trying to figure out if there's a better way, with a single query. The
query would look at the college(status), and then at the dept(status) to
determine what level (if any ) the user has selected.

I've got a mysql layout of the various tbls, and inserts if anyone's
interested in helping me shake my mind out on this...

thanks

-bruce




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



[PHP] email app/script/needs...

2009-01-03 Thread bruce
HI...

Playing around with an app and I need to implement some functionality
allowing a user to email some text.

Basically, I want to allow the user to select some text from a dropdown
list. I then want to allow the user to edit the text if needed, and to then
submit the text for email to a given user. In order to perform some basic
QA, I want to have an additional user be notified of the email/text to be
sent, and to then have to authorize the email/text in order for it to be
sent.

The QA process is required as this is going to be part of a kind of stripped
down call center process.

I'm asking the list to see if anyone has come across this kind of
functionality in an app that you can point me to. I've been searching the
'net with no luck, and I'd rather not reinvent the wheel on this one..

Pointers/Comments appreciated!

Thanks!!!




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



RE: [PHP] setting up FTP account names via PHP

2009-01-05 Thread bruce
merlin..

if you're going to allow a user to use the same user/passwd for the site,
and the FTP server.. i would strongly argue that you should allow the user
only the minimal access on the FTP server. if someone hacks your site, no
need to have them running rampant over your FTP server.

i would actually argue that you can have the same username, but separate
passwds, but i don'w know exactly what you're going to have on the FTP
server, nor do I know your skill at securing servers/services...

it doesn't really make a difference if you have separate dbs for the
user/passwd auth systems. if you secure the overall system, it's secure. if
you don't, well you're going to run into issues..

you might also look into existing web based mgmt apps for FTP servers to see
if any already exist.



-Original Message-
From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
Sent: Monday, January 05, 2009 6:56 AM
To: php-general@lists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP


Yes, it would be great if he could use the already existing username and
password. It should not be a one time password.

I am just now looking into mysql support for pure ftpd. One solution I
have in mind is to write the password into the pureftp DB upon signup.
That would be the easiest. The other solution to write to a conf file
would be OK, too. What do you think?

bruce wrote:
> are you trying to allow a user who logs in, to use his same username when
> interfacing with the FTP server?
>
> obviously, the password for the FTP server will be different. Or are you
> looking to dynamically create a one time user/passwd for the user so that
it
> changes each time they access the FTP server?
>
>
> -Original Message-
> From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
> Sent: Monday, January 05, 2009 6:44 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Marc Steinert wrote:
>> Merlin Morgenstern schrieb:
>>> Hello everybody,
>>>
>>> I am running a real estate site where I would like to enable bulk
>>> upload via real estate software that exports an xml file into an ftp
>>> account.
>>>
>>> In order to give every user unique access I would need to generate
>>> individual ftp name and passwords for each member. I can not see how
>>> this should work. My portal is written in PHP 4.x and there every
>>> members loges in with a unique ID. The FTP Server runns on the same
>>> linux machine. How could I generate users for this FTP server with
>>> php, for example on sign up?
>>>
>>> Thank you for any help on this.
>>>
>>> Best regards,
>>>
>>> Merlin
>>>
>> What ftp server are you using?
>>
>
> I just installed pureftpd. One possible sollution as I figured is to
> alter the virtual user table of the ftp server with php.
>
> Is this the way to go, or does somebody have a better idea that saves
> dev. time?
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] setting up FTP account names via PHP

2009-01-05 Thread bruce
are you trying to allow a user who logs in, to use his same username when
interfacing with the FTP server?

obviously, the password for the FTP server will be different. Or are you
looking to dynamically create a one time user/passwd for the user so that it
changes each time they access the FTP server?


-Original Message-
From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
Sent: Monday, January 05, 2009 6:44 AM
To: php-general@lists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP


Marc Steinert wrote:
> Merlin Morgenstern schrieb:
>> Hello everybody,
>>
>> I am running a real estate site where I would like to enable bulk
>> upload via real estate software that exports an xml file into an ftp
>> account.
>>
>> In order to give every user unique access I would need to generate
>> individual ftp name and passwords for each member. I can not see how
>> this should work. My portal is written in PHP 4.x and there every
>> members loges in with a unique ID. The FTP Server runns on the same
>> linux machine. How could I generate users for this FTP server with
>> php, for example on sign up?
>>
>> Thank you for any help on this.
>>
>> Best regards,
>>
>> Merlin
>>
> What ftp server are you using?
>

I just installed pureftpd. One possible sollution as I figured is to
alter the virtual user table of the ftp server with php.

Is this the way to go, or does somebody have a better idea that saves
dev. time?


--
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] setting up FTP account names via PHP

2009-01-05 Thread bruce
are you moving the files from the ftpdir, to a separate dir?

if you are, you can run your cron process from the top level dir... get a
list of any underlying files, and then iterate through the list to copy the
files to whereever you need to copy them...

you'd use the 'ls -R...' or the 'find' cmd for what you're looking to
do...



-Original Message-
From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
Sent: Monday, January 05, 2009 3:56 PM
To: php-general@lists.php.net
Subject: Re: [PHP] setting up FTP account names via PHP


Hello everybody,

thank you all for your help. I got a solution running. In pure-ftpd you
can authenticate via mysql. Via a user table, exactly the thing I was
searching for.

However, there is a problem araising. Every user get's his own directory
for uploads. My next step would have been to create a php script which
will be run by cron every 5 minutes that scans one dir and if there is
content inside import it into the mysql db.
With the current setup I would need to scan all dirs to see if there are
changes inside.

Is there some kind of command where I could find out if there are new
files inside those folders? I don't see any other solution.

Any suggestions?

Thank you for any help,

merlin

bruce schrieb:
> merlin..
>
> if you're going to allow a user to use the same user/passwd for the site,
> and the FTP server.. i would strongly argue that you should allow the user
> only the minimal access on the FTP server. if someone hacks your site, no
> need to have them running rampant over your FTP server.
>
> i would actually argue that you can have the same username, but separate
> passwds, but i don'w know exactly what you're going to have on the FTP
> server, nor do I know your skill at securing servers/services...
>
> it doesn't really make a difference if you have separate dbs for the
> user/passwd auth systems. if you secure the overall system, it's secure.
if
> you don't, well you're going to run into issues..
>
> you might also look into existing web based mgmt apps for FTP servers to
see
> if any already exist.
>
>
>
> -Original Message-
> From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
> Sent: Monday, January 05, 2009 6:56 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] setting up FTP account names via PHP
>
>
> Yes, it would be great if he could use the already existing username and
> password. It should not be a one time password.
>
> I am just now looking into mysql support for pure ftpd. One solution I
> have in mind is to write the password into the pureftp DB upon signup.
> That would be the easiest. The other solution to write to a conf file
> would be OK, too. What do you think?
>
> bruce wrote:
>> are you trying to allow a user who logs in, to use his same username when
>> interfacing with the FTP server?
>>
>> obviously, the password for the FTP server will be different. Or are you
>> looking to dynamically create a one time user/passwd for the user so that
> it
>> changes each time they access the FTP server?
>>
>>
>> -Original Message-
>> From: Merlin Morgenstern [mailto:merli...@fastmail.fm]
>> Sent: Monday, January 05, 2009 6:44 AM
>> To: php-general@lists.php.net
>> Subject: Re: [PHP] setting up FTP account names via PHP
>>
>>
>> Marc Steinert wrote:
>>> Merlin Morgenstern schrieb:
>>>> Hello everybody,
>>>>
>>>> I am running a real estate site where I would like to enable bulk
>>>> upload via real estate software that exports an xml file into an ftp
>>>> account.
>>>>
>>>> In order to give every user unique access I would need to generate
>>>> individual ftp name and passwords for each member. I can not see how
>>>> this should work. My portal is written in PHP 4.x and there every
>>>> members loges in with a unique ID. The FTP Server runns on the same
>>>> linux machine. How could I generate users for this FTP server with
>>>> php, for example on sign up?
>>>>
>>>> Thank you for any help on this.
>>>>
>>>> Best regards,
>>>>
>>>> Merlin
>>>>
>>> What ftp server are you using?
>>>
>> I just installed pureftpd. One possible sollution as I figured is to
>> alter the virtual user table of the ftp server with php.
>>
>> Is this the way to go, or does somebody have a better idea that saves
>> dev. time?
>>
>>
>> --
>> 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 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] Looking for an app...

2009-01-15 Thread bruce
Hi List!


I know this is somewhat basic.. and I am searching google as I type! I'm
looking for a client/server app that allows me to have a quick/dirty client
that can upload/download a file to a server app, with the server app copying
the file to a given dir...

Code samples, or pointers to a site where I can download this would be
great!! I don't want a straight FTP, as I want to do more things with the
server piece...

And yes, a php/apache kind of app would be cool..

thanks!!

-g


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



[PHP] killing a child process from pcntl_exec

2009-01-22 Thread bruce
Hi..

I fork a child process, using pcntl_exec. I see the process from the cmdline
(using pgrep 123), but I can't seem to kill the pid from the cmdline, using
"kill -9 123"..

Is there something that I need to implement within the php test in order for
the kill signal to be effective?

If I wait, the child eventually dies.. but I'd like to be able to kill it
from the cmdline.

thoughts/pointers/comments...

thanks


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



RE: [PHP] Re: killing a child process from pcntl_exec

2009-01-22 Thread bruce
hi carlos..

yeah.. the pid is correct.

it appears that spawning/creating a child process using pcntl_exec(foo)
results in a child process that you can see running from the cmdline, but
that you can't kill using "kill -9". php might allow some other function
within the parent app to allow the kill signal to be received by the child,
but i'm not familiar enough with php to know.

if i spawn the child process using something like "system()" then i can kill
the child, but i essentially have a bunch of parent processes running as
well. (ie, one parent process for each child process in the pid tbl)

what i really want, is the ability to spawn/create multiple external child
apps, each with their own child process ID, so I can kill it from the
cmdline. I'd also like to have a single parent processID in the pid tbl...

thoughts/comments/etc...

thanks


-Original Message-
From: Carlos Medina [mailto:i...@simply-networks.de]
Sent: Thursday, January 22, 2009 8:04 AM
To: php-general@lists.php.net
Subject: [PHP] Re: killing a child process from pcntl_exec


bruce schrieb:
> Hi..
>
> I fork a child process, using pcntl_exec. I see the process from the
cmdline
> (using pgrep 123), but I can't seem to kill the pid from the cmdline,
using
> "kill -9 123"..
>
> Is there something that I need to implement within the php test in order
for
> the kill signal to be effective?
>
> If I wait, the child eventually dies.. but I'd like to be able to kill it
> from the cmdline.
>
> thoughts/pointers/comments...
>
> thanks
>
Hi Bruce,
my ask: it is the pnum really 123? Check it out with ps -aux or ps -aix

Regards

Carlos Medina

--
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] killing a child process from pcntl_exec

2009-01-22 Thread bruce
i'm pretty sure that's not the issue...

i should be able to spawn/fork any kind of external app/process... "kill -9
pid", especially if done as root, should terminate the process...

i suspect that the issue has to do with zombie processes, and how
php/pnctl_exec/etc.. operates.



-Original Message-
From: c...@l-i-e.com [mailto:c...@l-i-e.com]
Sent: Thursday, January 22, 2009 10:00 AM
To: php-general@lists.php.net
Subject: Re: [PHP] killing a child process from pcntl_exec



There are functions/settings in pcntl docs about how to "listen" for
specific signals.

If you don't listen for -9, maybe you don't get it.

http://php.net/manual/en/function.pcntl-signal.php


--
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 spawing/forking issues

2009-01-22 Thread bruce
Hi...

Playing around with a test app to spawn external child processes.

I'd like to be able to spawn/fork/run am external child process, that:
 -allows the child processes to run as separate independent processes (pid)
 -allows the child process(es) to be terminated via cmdline (kill -9 pid)


i've got a dynamic situation, where i'm reading from an array, and for each
item in the array, i want to spawn/fork the child process. i'd like to be
able to have 10 copies of the spawned child process running at the same
time.

the only way i've been able to get my test working, is to spawn a group of
processes, and then to iterate through the group, using an array of pids,
and doing a wait for each pid in the array. however, this doesn't satisfy me
wanting to have a certain number of simultaneous processes running at the
same time..

thoughts/comments/pointers to articles that might demonstrate this would be
useful.

thanks...

i can easily post the sample chunk of code i'm playing with if someone wants
to look at it!




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



[PHP] process creation

2009-01-23 Thread bruce
A simple question (or so I thought).

Does php allow an app to create/start a process/application that can
continue to run on its own, after the initiating program/app terminates?

It appears that the spawning/forking functions might work, but the child
apps would be in a zombie status, and couldn't be killed by an external
program.

Basically, I'd like to create a bunch of test apps/processes, and then to be
able to kill them by a separate process if the apps take too long to run..

So.. thoughts/comments would be appreciated!

thanks



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



RE: [PHP] process creation

2009-01-23 Thread bruce
Hi Török.

My test code had/has something similar.. but it kept displaying zombie 
processes as well as legitimate processes in the ps tbl/display...

Turns out I had a mistake in the test "client" ap/process that I was 
creating... This was causing the child process to die, resulting in a "zombie" 
process, until the parent got around to doing a waitpid call...

i think it's ok now...

thanks

ps, torok... are you in the US/Canada? Also, are you up to talking to me about 
this project that I'm playing with?



-Original Message-
From: Török Alpár [mailto:torokal...@gmail.com]
Sent: Friday, January 23, 2009 10:09 AM
To: bruce
Cc: php-general@lists.php.net
Subject: Re: [PHP] process creation


2009/1/23 bruce 

> A simple question (or so I thought).
>
> Does php allow an app to create/start a process/application that can
> continue to run on its own, after the initiating program/app terminates?
>
> It appears that the spawning/forking functions might work, but the child
> apps would be in a zombie status, and couldn't be killed by an external
> program.
>
> Basically, I'd like to create a bunch of test apps/processes, and then to
> be
> able to kill them by a separate process if the apps take too long to run..

  You can have the  parent sleep, and then clean up like :

$aPids = array();
for ($i=0;$i
> So.. thoughts/comments would be appreciated!
>
> thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Torok, Alpar Istvan


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



[PHP] php forking/spawning question...

2009-01-27 Thread bruce
Hi...

got the follwoing example... basically, when i call the function "spawn_" i
get the passed vars for appname/args...

the $appname,$args are valid when the spawn_ function is initially invoked.
however, when the app does the fork, the $appname, $args get lost. when the
function gets to the pcntl_exec, the vars ($appname, $args) are no longer
set.

so what did i miss, how is this process supposed to work?

thoughts/comments...

thanks


=
/*
test func to spawn client thread
*/
function spawn_($appname, $args)
{
print "appname =".$appname."\n";
print_r($args);
//exit();

$pid = pcntl_fork();
if ($pid == -1)
{
die('cannot fork');
}
elseif ($pid)
{
print "child pid = ".$pid."\n";
//pcntl_waitpid($pid, $status);
//break;
//exit();
$par=1;
}
else
{
// Note that pcntl_exec() automatically prepends the program
name
// to the array of arguments; the program name cannot be
spoofed.
print "running cmd \n";
 pcntl_exec($appname, $args);
//system("./clientmgr.php");
 exit();
}
}



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



RE: [PHP] Connect local app to a web app

2009-02-05 Thread bruce
hi...

can you describe in psuedocode what you're trying to accomplish?

might be able to help if i have a better understanding of where you're
trying to go.



-Original Message-
From: Jônatas Zechim [mailto:zechim@gmail.com]
Sent: Thursday, February 05, 2009 11:25 AM
To: php-general@lists.php.net
Subject: [PHP] Connect local app to a web app


Hi there, i'm here again, but now with another doubt.

What's the best way to connect a local app write in php or php-gtk to a web
app writen in php.
The database is MySql, and i need to do this connection every 3s to check
data, get the data back and save into localhost database.


--
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] preg_match question...

2009-02-06 Thread bruce
hi...

trying to figure out the best approach to using preg_match to extract the
number from the follwing type of line...

" 131646 sometext follows.."

basically, i want to extract the number, without the text, but i have to be
able to match on the "text"

i've been playing with different preg_match regexs.. but i'm missing
something obvious!

thoughts/comments..


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



RE: [PHP] Re: preg_match question...

2009-02-06 Thread bruce
hmmm...

tried your preg__match/regex...

i get:
0 - 1145 total
1 - 1145
2 - l

i would have thought that the 2nd array item should have had "total"...



-Original Message-
From: Frank Stanovcak [mailto:blindspot...@comcast.net]
Sent: Friday, February 06, 2009 6:15 AM
To: php-general@lists.php.net
Subject: [PHP] Re: preg_match question...



""bruce""  wrote in message 
news:234801c98863$88f27260$0301a...@tmesa.com...
> hi...
>
> trying to figure out the best approach to using preg_match to extract the
> number from the follwing type of line...
>
> " 131646 sometext follows.."
>
> basically, i want to extract the number, without the text, but i have to 
> be
> able to match on the "text"
>
> i've been playing with different preg_match regexs.. but i'm missing
> something obvious!
>
> thoughts/comments..
>

How about
preg_match('#(\d+)(.)+#',$haystack,$match)

if I remember right
$match[0] would be all of it
$match[1] would be the numbers
$match[2] would be the text 



-- 
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] webapp to drive/monitor a bunch of system processes

2009-02-11 Thread bruce
hi...

i've got a project (goal) where i'm looking for a webbased app that
drives/runs/monitors different linux/system processes. i'm basically looking
for different apps that i can look at to get ideas/see their
layout/structure. i'm going to have to create a similar app to run some
processes that i'm dealing with.

i'm currently looking/searchin sourceforge.net/freshmeat/etc.. but i thought
i'd fire off the question here as well, in case someone has an app that
they're aware of that you can pass on to me..

my overall/ultimate goal is going to be to interface with underlying
database/tbls, to drive processes on a distributed network of machines that
i'm putting together... so i'm going to need to be able to to
monitor/start/stop a number of different apps that i create. i'm also
looking to be able to see past history of the apps that have been run using
the webapp...

but for now, any app that i can find that allows a user to manage/start/stop
different processes on a server/network would be useful.. (already looked at
nagios!)

thanks!!




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



[PHP] fork/spawnzombie question

2009-02-12 Thread bruce
Hi Nathan/Torok...

Hey guys... got a bit of a question.

I'm playing around with the php/for/pcntl_exec functions and I've got a process 
that spawns off a bunch of child processes. Unfortunately, I'm getting to where 
I have 100's of zombie child processes that I can see from the 
linux/processTBL. 

I don't want to have my master loop do a waitpid() call, as it would block on 
the wait for one of the child processes to exit. I recognize that the 
zombie/child process is essentially a placeholder in the processTBL slt, and 
really doesn't take up any system resources, but I'd still like to have the 
zombie processes removed. 

I'm wondering. Is it possible to fork off a process, and have it essentially do 
the wait on all the zombie/shild processes from the parent app? Or would this 
be a peer process, waiting on it's peers?


Thanks

-bruce
bedoug...@earthlink.net
925-249-1844





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



[PHP] redirecting output for a spawned child process..

2009-02-21 Thread bruce
hi...

got a situation where i have a parent app that spawns children. trying to
figure out how to get the output of the spawned/forked children to be
written to an external file...

can't seem to find any examples of how to accomplish this... do i have to
insert something within the child php app itself to redirect the output
that's currently being sent to the term? i'd prefer to have the output
displayed, as well as redirected...

these are cli apps...

code chunks would be appreciated..

thanks



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



[PHP] file locking...

2009-02-28 Thread bruce
Hi.

Got a bit of a question/issue that I'm trying to resolve. I'm asking this of
a few groups so bear with me.

I'm considering a situation where I have multiple processes running, and
each process is going to access a number of files in a dir. Each process
accesses a unique group of files, and then writes the group of files to
another dir. I can easily handle this by using a form of locking, where I
have the processes lock/read a file and only access the group of files in
the dir based on the  open/free status of the lockfile.

However, the issue with the approach is that it's somewhat synchronous. I'm
looking for something that might be more asynchronous/parallel, in that I'd
like to have multiple processes each access a unique group of files from the
given dir as fast as possible.

So.. Any thoughts/pointers/comments would be greatly appreciated. Any
pointers to academic research, etc.. would be useful.

thanks




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



RE: [PHP] file locking...

2009-03-01 Thread bruce
hi rob...

here's the issue in more detail..

i have multiple processes that are generated/created and run in a
simultaneous manner. each process wants to get XX number of files from the
same batch of files... assume i have a batch of 50,000 files. my issue is
how do i allow each of the processes to get their batch of unique files as
fast as possible. (the 50K number is an arbotrary number.. my project will
shrink/expand over time...

if i dump all the 50K files in the same dir, i can have a lock file that
would allow each process to sequentially read/write the lock file, and then
access the dir to get the XX files the process is needing. (each process is
just looking to get the next batch of files for processing. there's no
searching based on text in the name of the files. it's a kind of fifo queing
system) this approach could work, but it's basically sequential, and could
in theory get into race conditions regarding the lockfile.

i could also have the process that creates the files, throw the files in
some kind of multiple directory processes, where i split the 50K files into
separate dirs and somehow implement logic to allow the cient process to
fetch the files from the unique/separate dirs.. but this could get ugly.

so my issue is essentially how can i allow as close to simultaneous access
by client/child processes to a kind of FIFO of files...

whatever logic i create for this process, will also be used for the next
iteration of the project, where i get rid of the files.. and i use some sort
of database as the informational storage.

hopefully this provides a little more clarity.

thanks


-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Sunday, March 01, 2009 2:50 AM
To: bruce
Cc: php-general@lists.php.net
Subject: Re: [PHP] file locking...


On Sat, 2009-02-28 at 21:46 -0800, bruce wrote:
> Hi.
>
> Got a bit of a question/issue that I'm trying to resolve. I'm asking this
of
> a few groups so bear with me.
>
> I'm considering a situation where I have multiple processes running, and
> each process is going to access a number of files in a dir. Each process
> accesses a unique group of files, and then writes the group of files to
> another dir. I can easily handle this by using a form of locking, where I
> have the processes lock/read a file and only access the group of files in
> the dir based on the  open/free status of the lockfile.
>
> However, the issue with the approach is that it's somewhat synchronous.
I'm
> looking for something that might be more asynchronous/parallel, in that
I'd
> like to have multiple processes each access a unique group of files from
the
> given dir as fast as possible.
>
> So.. Any thoughts/pointers/comments would be greatly appreciated. Any
> pointers to academic research, etc.. would be useful.

Threads? Or spawn off child processes. Maybe I'm not understanding your
issues well enough.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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] file locking...

2009-03-01 Thread bruce
hi rob...

what you have written is similar to my initial approach... my question, and
the reason for posting this to a few different groups.. is to see if someone
has pointers/thoughts for something much quicker...

this is going to handle processing requests from client apps to a
webservice.. the backend of the service has to quickly process the files in
the dir as fast as possible to return the data to the web client query...

thanks



-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Sunday, March 01, 2009 9:54 AM
To: bruce
Cc: php-general@lists.php.net
Subject: RE: [PHP] file locking...


On Sun, 2009-03-01 at 09:09 -0800, bruce wrote:
> hi rob...
>
> here's the issue in more detail..
>
> i have multiple processes that are generated/created and run in a
> simultaneous manner. each process wants to get XX number of files from the
> same batch of files... assume i have a batch of 50,000 files. my issue is
> how do i allow each of the processes to get their batch of unique files as
> fast as possible. (the 50K number is an arbotrary number.. my project will
> shrink/expand over time...
>
> if i dump all the 50K files in the same dir, i can have a lock file that
> would allow each process to sequentially read/write the lock file, and
then
> access the dir to get the XX files the process is needing. (each process
is
> just looking to get the next batch of files for processing. there's no
> searching based on text in the name of the files. it's a kind of fifo
queing
> system) this approach could work, but it's basically sequential, and could
> in theory get into race conditions regarding the lockfile.
>
> i could also have the process that creates the files, throw the files in
> some kind of multiple directory processes, where i split the 50K files
into
> separate dirs and somehow implement logic to allow the cient process to
> fetch the files from the unique/separate dirs.. but this could get ugly.
>
> so my issue is essentially how can i allow as close to simultaneous access
> by client/child processes to a kind of FIFO of files...
>
> whatever logic i create for this process, will also be used for the next
> iteration of the project, where i get rid of the files.. and i use some
sort
> of database as the informational storage.
>
> hopefully this provides a little more clarity.

Would I be right in assuming that a process grabs X of the oldest
available files and then begins to work on them. Then the next process
would essentially grab the next X oldest files so on and so forth over
and over again? Also is the file discarded once processed? Would I be
correct in presuming that processing of the files takes longer than
grabbing the files wanted? If so then I would have a single lock upon
which all processes wait. Each process grabs the lock when it can and
then moves X oldest files to a working directory where it can then
process them.

So... directory structure:

/ROOT
/ROOT/queue
/ROOT/work

Locks...

/ROOT/lock

So let's say you have 500 files:

/ROOT/queue/file_001.dat
/ROOT/queue/file_002.dat
/ROOT/queue/file_003.dat
...
/ROOT/queue/file_499.dat
/ROOT/queue/file_500.dat

And you have 5 processes...

/proc/1
/proc/2
/proc/3
/proc/4
/proc/5

Now to start all processes try to grab the lock at the same time, by
virtue of lock mechanics only one process gets the lock... let's say for
instance 4 While 4 has the lock all the other processes go to sleep
for say... 1 usecs... upon failing to get the lock.

So process 4 transfers file_001.dat through to file_050.dat
into /ROOT/work.

/ROOT/work/file_001.dat
/ROOT/work/file_002.dat
/ROOT/work/file_003.dat
...
/ROOT/work/file_049.dat
/ROOT/work/file_050.dat

Then it releases the lock and begins processing meanwhile the other
processes wake up and try to grab the lock again... this time PID 2 gets
it. It does the same...

/ROOT/work/file_043.dat
/ROOT/work/file_044.dat
/ROOT/work/file_045.dat
...
/ROOT/work/file_049.dat
/ROOT/work/file_100.dat

/ROOT/queue/file_101.dat
/ROOT/queue/file_102.dat
/ROOT/queue/file_103.dat
...
/ROOT/queue/file_499.dat
/ROOT/queue/file_500.dat

Now while it was doing that PID 4 finished and all it's files are now
deleted. The first thing it does is try to get the lock so it can get
more... but it's still owned by PID 2 so PID 4 goes to sleep. Once PID 2
gets it's files it releases the lock and off it goes and the cycle
continued. Now there's still an issue with respect to incoming partially
written files. During the incoming process those should be written
elsewhere... lets say /ROOT/incoming. Once writing of the file is
complete it can be moved to /ROOT/queue. Also if you don't want
processes to delete the

[PHP] RE: file locking...

2009-03-03 Thread bruce
Hi Dennis...

Thanks for the reply... Here's my solution up to now.. might change in the
future...

The problem:
App has a bunch of clients that need to get a separate/unique list of files
from a master server app. The files are created by the master server
process, and reside on the filesystem behind the server process. (this is a
client/server based app. client sends a request to the server.. the backend
operation of the server fetches the required files, and returns them to the
client app.)

A key issue is that I don't want to run into potential race conditions,
which would result in a given client never being served the files it's
trying to fetch.

Potential Soln:
1) Invoke a form of file locking, with each client processes waiting
   until it gets its lock.
2) Invoke some form of round-robin process, where the master process
   puts files in different dirs, so each client can have a better
   chance of getting a "lock" for the different dir..

Final Soln: (for now)
I decided to cheat!
I realized that since each client process is essentially unique, I can
create a uniqueId (uuid) for each process. Remember, the client app is
hitting the master server/file process via a webservice. So I have each
client send it's uuid to the master server via the webprocess. this
information is appended to a file, which gives me kind of a fifo approach
for creating unique dirs for each client. the server (on the backend) then
reads the fifo file, for the uuid. in getting the uuid for the 'client', a
master cron process then reads the fifo file, and for each uuid in the file,
creates a tmp dir for the uuid. the master cron process then populates this
dir, with the required files for the given client.

on the client side, the client loops through a wait loop, checking to see if
anything is created/placed in its tmp 'uuid' dir.. if files are there, it
fetches the files, and proceeds..

This approach ensures that a client would never run into a situation where
it might never get files where files are available for processing. in the
event there are no files, the client simply sleeps until there are files..
in the event a client requests files via the sending of the uuid, and the
client dies before getting the files, but the master cron had already placed
them in the uuid dir.. there will be a cleanup process to reabsorb those
files back into the system...

thanks to all who gave input/pointers!!

thoughts/comments/etc...



-Original Message-
From: python-list-bounces+bedouglas=earthlink@python.org
[mailto:python-list-bounces+bedouglas=earthlink@python.org]on Behalf
Of Dennis Lee Bieber
Sent: Sunday, March 01, 2009 11:41 AM
To: undisclosed-recipients:
Subject: Re: file locking...


On Sun, 1 Mar 2009 10:00:54 -0800, "bruce" 
declaimed the following in comp.lang.python:

>
> Except in my situation.. the client has no knowledge of the filenaming
> situation, and i might have 1000s of files... think of the FIFO, first in,
> first out.. so i'm loking for a fast solution that would allow me to
create
> groups of say, 500 files, that get batched and processed by the client
> app...
>
My silly thoughts...

Main process creates temp/scratch directories for each subprocess;
spawn each subprocess, passing the directory path to it;
main process then just loops over the files moving them, one at a time,
to one of the temp/scratch directories, probably in cyclic order to
distribute the load;
when main/input directory is empty, sleep then check again (or, if the
OS supports it -- use some directory change notification) for new files.

Each subprocess only sees its files in the applicable temp/scratch
directory.
--
WulfraedDennis Lee Bieber   KD6MOG
wlfr...@ix.netcom.com   wulfr...@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff:   web-a...@bestiaria.com)
HTTP://www.bestiaria.com/
--
http://mail.python.org/mailman/listinfo/python-list


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



RE: [PHP] whoami explanation

2009-03-03 Thread bruce
hi pj...

single quotes are entered via the key directly left from the "return/enter"
key on most/all qwerty keyboards...

the 'backtic' is normally the shift '~' key... the key, right to the left of
the '1' key... in the upper left position of the keyboard...




-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Tuesday, March 03, 2009 7:57 AM
To: Per Jessen
Cc: php-general@lists.php.net
Subject: Re: [PHP] whoami explanation


Per Jessen wrote:
> PJ wrote:
>
>
>> This really needs some explanation
>> I found this on the web:
>> 
>> with it there was the comment "the direction of those single-quotes
>> matters" (WHY ?) and it works
>>
>>
>
> GIYF - look up "back quotes".
>
>
>> But this (_*FROM THE PHP MANUAL***_ * -  exec()* executes the given
>> /command/ ) does not,
>> COPIED AND PASTED:
>> |> // outputs the username that owns the running php/httpd process
>> // (on a system with the "whoami" executable in the path)
>> echo exec('whoami');
>> ?> |
>> What is going on here?
>>
>
> What sort of error did you get?  (it works fine here).
>
>
> /Per
>
forgot to add:
What's the difference between back ticks or quotes and regular single
quotes?
How does one enter back quotes from the keyboard?

--

Phil Jourdan --- p...@ptahhotep.com
   http://www.ptahhotep.com
   http://www.chiccantine.com


--
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] Re: Problems with exec() on windows

2009-03-19 Thread bruce
hey...

if you're going to deal with file/pathnames in windows/linux.. you're going
to have to encapsulate them with "" or with '' ie double/single quotes...



-Original Message-
From: Kyohere Luke [mailto:l...@beyonic.com]
Sent: Thursday, March 19, 2009 10:18 AM
To: Bastien Koert
Cc: Shawn McKenzie; php-general@lists.php.net
Subject: Re: [PHP] Re: Problems with exec() on windows


Eventually settled for getting rid of the spaces in the path. That worked.
Thanks.
Luke

On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert  wrote:

>
>
> On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke  wrote:
>
>> Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
>> spaces in it
>> Haliphax, thanks for your comments. I tried escapeshellarg() to no end.
>>
>> I'm exploring your reply regarding proc_open, but how exactly does
>> proc_open
>> separate the arguments from the command?
>>
>> Unless i'm mistaken, data written to the process's stdin (for the other
>> process) is not treated like an argument.
>>
>> If I add the arguments to the process name/path? I'm back to square one.
>>
>> Luke.
>>
>> On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie > >wrote:
>>
>> > Kyohere Luke wrote:
>> > > Hi,
>> > > I'm trying to use exec to call gammu.exe and send sms on windows XP.
>> > >
>> > > This works from commandline:
>> > >
>> > > C:\path\to\gammu.exe 1 --sendsms EMS 200 -text "test1 test2"
>> > >
>> > > But if I run it through php like this:
>> > >
>> > > $command = "\"C:\path\to\gammu.exe\" --sendsms EMS 200 -text \"test1
>> > > test2\"".;
>> > > @exec($command, $response, $retval);
>> > >
>> > > This always fails, returns 1 and the response is empty.
>> > >
>> > > If the last argument is a string with no spaces, and the double
quotes
>> > were
>> > > omitted, it works perfectly.
>> > >
>> > > If the double quotes are added around the string with no spaces, it
>> fails
>> > > again, which makes me believe that the problem is with the double
>> quotes.
>> > >
>> > > I've used procmon and it shows that when the double quotes are added
>> > around
>> > > the last argument, gammu.exe is not even called at all.
>> > >
>> > > Problem is that the double quotes are required by gammu to send an
sms
>> > with
>> > > spaces in it.
>> > >
>> > > Any ideas? :-(
>> > >
>> > > Luke
>> > >
>> >
>> > Why not try:
>> >
>> > $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text "test1
test2"';
>> >
>> > --
>> > Thanks!
>> > -Shawn
>> > http://www.spidean.com
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>>
>
> try double slashes for the path and wrap the pathin quotes if there are
> spaces in it. Or if possible get rid of the spaces in the folder names
>
> --
>
> 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] Re: Problems with exec() on windows

2009-03-20 Thread bruce
when dealing with windows.. or any file/pathname.. you can't simply
quote/double quote the name using the "~" symbol as well..

haven't done it for awhile.. but i believe you need to explode/derive the
complete path/filename and then quote/double quote it for use by the app...



-Original Message-
From: l...@beyonic.com [mailto:l...@beyonic.com]on Behalf Of Kyohere
Luke
Sent: Thursday, March 19, 2009 11:48 PM
To: Shawn McKenzie
Cc: php-general@lists.php.net
Subject: Re: [PHP] Re: Problems with exec() on windows


You might have something there - never really thought about how windows
forms the 8.3 names... & not many resources online about it ...

The actual path is "c:\Program File\Gammu 1.23.91\bin\gammu.exe"
I'd used "c:\Progra~1\Gammu~1\bin\gammu.exe"

Luke

On Thu, Mar 19, 2009 at 8:57 PM, Shawn McKenzie wrote:

> Kyohere Luke wrote:
> > Hi,
> >
> > Tried all that - it'd work well until one of the arguments also had
> spaces
> > and thus had "" or '' encapsulating it - this weirdness is the reason
for
> > this post.
> > Shawn, even the good old "C:\pathwi~1\gammu.exe" failed :-(
>
> Well, you didn't do it properly then.  What is the actual path?
>
> >
> > The only way I've gotten it to work was to get rid of the spaces in the
> > path/to/exe.
> >
> > Luke.
> >
> > On Thu, Mar 19, 2009 at 8:24 PM, bruce  wrote:
> >
> >> hey...
> >>
> >> if you're going to deal with file/pathnames in windows/linux.. you're
> going
> >> to have to encapsulate them with "" or with '' ie double/single
> quotes...
> >>
> >>
> >>
> >> -Original Message-
> >> From: Kyohere Luke [mailto:l...@beyonic.com]
> >> Sent: Thursday, March 19, 2009 10:18 AM
> >> To: Bastien Koert
> >> Cc: Shawn McKenzie; php-general@lists.php.net
> >> Subject: Re: [PHP] Re: Problems with exec() on windows
> >>
> >>
> >> Eventually settled for getting rid of the spaces in the path. That
> worked.
> >> Thanks.
> >> Luke
> >>
> >> On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert 
> wrote:
> >>
> >>>
> >>> On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke 
> wrote:
> >>>
> >>>> Thanks, but I tried this. Doesn't work because the path\to\gammu.exe
> has
> >>>> spaces in it
> >>>> Haliphax, thanks for your comments. I tried escapeshellarg() to no
> end.
> >>>>
> >>>> I'm exploring your reply regarding proc_open, but how exactly does
> >>>> proc_open
> >>>> separate the arguments from the command?
> >>>>
> >>>> Unless i'm mistaken, data written to the process's stdin (for the
> other
> >>>> process) is not treated like an argument.
> >>>>
> >>>> If I add the arguments to the process name/path? I'm back to square
> one.
> >>>>
> >>>> Luke.
> >>>>
> >>>> On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie  >>>>> wrote:
> >>>>> Kyohere Luke wrote:
> >>>>>> Hi,
> >>>>>> I'm trying to use exec to call gammu.exe and send sms on windows
XP.
> >>>>>>
> >>>>>> This works from commandline:
> >>>>>>
> >>>>>> C:\path\to\gammu.exe 1 --sendsms EMS 200 -text "test1 test2"
> >>>>>>
> >>>>>> But if I run it through php like this:
> >>>>>>
> >>>>>> $command = "\"C:\path\to\gammu.exe\" --sendsms EMS 200 -text
\"test1
> >>>>>> test2\"".;
> >>>>>> @exec($command, $response, $retval);
> >>>>>>
> >>>>>> This always fails, returns 1 and the response is empty.
> >>>>>>
> >>>>>> If the last argument is a string with no spaces, and the double
> >> quotes
> >>>>> were
> >>>>>> omitted, it works perfectly.
> >>>>>>
> >>>>>> If the double quotes are added around the string with no spaces, it
> >>>> fails
> >>>>>> again, which makes me believe that the problem is with the double
> >>>> quotes.
> >>>>>> I've used procmon and it shows that when the double quotes are
added
> >>>>> around
> >>>>>> the last argument, gammu.exe is not even called at all.
> >>>>>>
> >>>>>> Problem is that the double quotes are required by gammu to send an
> >> sms
> >>>>> with
> >>>>>> spaces in it.
> >>>>>>
> >>>>>> Any ideas? :-(
> >>>>>>
> >>>>>> Luke
> >>>>>>
> >>>>> Why not try:
> >>>>>
> >>>>> $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text "test1
> >> test2"';
> >>>>> --
> >>>>> Thanks!
> >>>>> -Shawn
> >>>>> http://www.spidean.com
> >>>>>
> >>>>> --
> >>>>> PHP General Mailing List (http://www.php.net/)
> >>>>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>>>
> >>>>>
> >>> try double slashes for the path and wrap the pathin quotes if there
are
> >>> spaces in it. Or if possible get rid of the spaces in the folder names
> >>>
> >>> --
> >>>
> >>> Bastien
> >>>
> >>> Cat, the other other white meat
> >>>
> >>
> >
>
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> 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] linux sha1sum .vs php sha1

2009-03-20 Thread bruce
hi...

doing some testing with linux sha1sum, and php's sha1 function... are they
both supposed to return the same results for the same chunk of text.

test

file "a.dat" = "1234567890"

linux:
 echo a.dat > sha1sum -t!= php 

any thoughts...

thanks



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



[PHP] quick question - need a site i can more or less copy from

2009-03-22 Thread bruce
Hi...

Working on a test app, and I need a web interface to test/view the
underlying information. Looking for (hopefully) quick pointers/suggestions.

I'm dealing with a number of cli web crawling apps that return data. I'm
trying to find a quick app that I can modify the db schema, as well as some
of the underlying logic to display my data.

my returned data consists of:
 university
   school
 dept
  class
   classname
   classID
   classdescription
   classA
   classB
   faculty


The above is a represenation of the levels of data. I'm looking to have
multiple tbls, each of which links to the child tbl...

I'm not a web dev, and i'm looking for some sort of web app that i might rip
apart/modify so i can start to be able to view this data on a web app..

i'm currently looking through sourceforge/freshmeat/etc...

thanks...



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



[PHP] webmin mods..

2009-03-22 Thread bruce
oh...

has anyone ever played/used/modified the webmin app??

i'm looking for a web based app/tool that i can modify to be able to manage
my distribbuted client/server crawler on my network of boxes. i'd rather
start with an existing framework/app that already kind of works with
modules/apps on a system, and then modify it to meet my needs...

i'm ultimately looking for a php based web app that i can modify to allow me
to schedule running my crawler... along with a huge number of additional
functions..

thanks



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



RE: [PHP] Regex

2009-03-26 Thread bruce
hi...

if you haven't solved your issue... can you tell me in detail what you're
trying to accomplish? what are the steps to running the script?

thanks


-Original Message-
From: jesse.ha...@arvatousa.com [mailto:jesse.ha...@arvatousa.com]
Sent: Thursday, March 26, 2009 1:23 PM
To: php-general@lists.php.net
Subject: [PHP] Regex


Hi,

 

Brand new to regex. So I have a cli which runs a regex on users input,
to make sure that only 0-9 and A-Z are accepted. It should strip
everything else. My problem is that when you press control-Z (on
Windows; I have not yet tested this on linux, and I will, but I would
like this to be compatible with both OS's) it loops infinitely saying
invalid data (because of the next method call, which decides what to do
based on your input). So, here is the input code. Is there a way I can
ensure that control commands are stripped, here?

 

 

 

 

 

public function getSelection() {

 

$choice =
$this->validateChoice(trim(strtoupper(fgets(STDIN;

return $choice;

 

}

 

private function validateChoice($choice) {

 

$choice =
ereg_replace("/[^0-9A-Z]/","",$choice);

return $choice;

 

}

 

 

 

I have tried a ton of different things to try and fix this. Tried
/\c.|[^0-9A-Z]/, and many variations of \c and the [^0-9A-Z], to no
avail. I also tried using both preg_replace() as well as ereg_replace().
I spent a lot of time on the regex section of the PHP manual, but I am
not finding anything. Any advise on how to accomplish this?

 

 

 

Thanks,

 

Jesse Hazen


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

[PHP] Workflow app for software

2009-03-31 Thread bruce
Ladies/Gents...

Hi. Trying to get some input to a web based app for dealing with managing
software apps/scripts.

Basically, i'm envisioning a system where people register/signup, and then
check in/out apps for development/testing/production... I need a way of
dealing with users, assigning/accepting roles for the users, and to manage
the flow of the "file" as it moves through the basic
"development/testing/production" process. i'd like to have a database
backend, combines with some kind of source/file reqpository...

I've seen things like knowledgetree, owl, etc... but figured I'd get input
from here. So, any thoughts to open source apps that you guys have actual
experience using??

Thanks



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



RE: [PHP] Workflow app for software

2009-03-31 Thread bruce
hey todd...

just toook a look at the polarion svn-web app i thought that was closed 
source... i see that it's open!!!

-Original Message-
From: haliphax [mailto:halip...@gmail.com]
Sent: Tuesday, March 31, 2009 2:18 PM
To: bruce; php-general@lists.php.net
Subject: Re: [PHP] Workflow app for software


On Tue, Mar 31, 2009 at 1:47 PM, bruce  wrote:
> Ladies/Gents...
>
> Hi. Trying to get some input to a web based app for dealing with managing
> software apps/scripts.
>
> Basically, i'm envisioning a system where people register/signup, and then
> check in/out apps for development/testing/production... I need a way of
> dealing with users, assigning/accepting roles for the users, and to manage
> the flow of the "file" as it moves through the basic
> "development/testing/production" process. i'd like to have a database
> backend, combines with some kind of source/file reqpository...
>
> I've seen things like knowledgetree, owl, etc... but figured I'd get input
> from here. So, any thoughts to open source apps that you guys have actual
> experience using??

This sounds like something Subversion (SVN) is suited for. Three
repositories in the same realm: dev, test, prod. Slap a web front-end
on it like Polarion's "svn-web" (for JSP/Tomcat) and you're in
business.

-- 
// Todd

-- 
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] Workflow app for software

2009-04-01 Thread bruce
and haliphax...

i specifically sent the reply to only you.. you then felt the need to reply
to the list as a whole

hmm.. ok.. this thread is officially dead!!

unless of course it gets back to the initial question...

peace!!


-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Wednesday, April 01, 2009 9:30 AM
To: haliphax
Cc: php-general@lists.php.net
Subject: Re: [PHP] Workflow app for software


On Wed, 2009-04-01 at 11:25 -0500, haliphax wrote:
> On Wed, Apr 1, 2009 at 8:33 AM, bruce  wrote:
> > not another top/side/bottom post thread again!!!
> >
> >
> >
> > -Original Message-
> > From: haliphax [mailto:halip...@gmail.com]
> > Sent: Wednesday, April 01, 2009 5:38 AM
> > To: php-general@lists.php.net
> > Subject: Re: [PHP] Workflow app for software
> >
> >
> > On Tue, Mar 31, 2009 at 4:37 PM, bruce  wrote:
> >> hey todd...
> >>
> >> just toook a look at the polarion svn-web app i thought that was
closed source... i see that it's open!!!
> >>
> >> -----Original Message-
> >> From: haliphax [mailto:halip...@gmail.com]
> >> Sent: Tuesday, March 31, 2009 2:18 PM
> >> To: bruce; php-general@lists.php.net
> >> Subject: Re: [PHP] Workflow app for software
> >>
> >>
> >> On Tue, Mar 31, 2009 at 1:47 PM, bruce  wrote:
> >>> Ladies/Gents...
> >>>
> >>> Hi. Trying to get some input to a web based app for dealing with
managing
> >>> software apps/scripts.
> >>>
> >>> Basically, i'm envisioning a system where people register/signup, and
then
> >>> check in/out apps for development/testing/production... I need a way
of
> >>> dealing with users, assigning/accepting roles for the users, and to
manage
> >>> the flow of the "file" as it moves through the basic
> >>> "development/testing/production" process. i'd like to have a database
> >>> backend, combines with some kind of source/file reqpository...
> >>>
> >>> I've seen things like knowledgetree, owl, etc... but figured I'd get
input
> >>> from here. So, any thoughts to open source apps that you guys have
actual
> >>> experience using??
> >>
> >> This sounds like something Subversion (SVN) is suited for. Three
> >> repositories in the same realm: dev, test, prod. Slap a web front-end
> >> on it like Polarion's "svn-web" (for JSP/Tomcat) and you're in
> >> business.
> >
> > Well, whether it's open source or not, the software is free to use...
> > that's all I ever really cared about. :)
> > (Please stop top-posting.)
>
> Again, please do not top-post. It is the agreed-upon procedure in this
> list to bottom-post when replying to threads. (I am not just going
> "renegade thread-Nazi" on you.)

Could you show me the signed agreement list. While it's convention on
this list, it's certainly not something everyone agreed upon.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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] Workflow app for software

2009-04-01 Thread bruce
so haliphax...

since you seem to be the primary person with this issue.. at least for now... 
i'll ahead and nominate you to the guy in charge of making sure posters follow 
the written rule to not top/down/side/left/right post...

have fun!!!



-Original Message-
From: haliphax [mailto:halip...@gmail.com]
Sent: Wednesday, April 01, 2009 11:42 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Workflow app for software


On Wed, Apr 1, 2009 at 1:38 PM, Robert Cummings  wrote:
> On Wed, 2009-04-01 at 13:30 -0500, haliphax wrote:
>> On Wed, Apr 1, 2009 at 11:53 AM, bruce  wrote:
>> > and haliphax...
>> >
>> > i specifically sent the reply to only you.. you then felt the need to reply
>> > to the list as a whole
>> >
>> > hmm.. ok.. this thread is officially dead!!
>> >
>> > unless of course it gets back to the initial question...
>> >
>> > peace!!
>> >
>> >
>> >> > -Original Message-
>> >> > From: haliphax [mailto:halip...@gmail.com]
>> >> > Sent: Wednesday, April 01, 2009 5:38 AM
>> >> > To: php-general@lists.php.net
>> >> > Subject: Re: [PHP] Workflow app for software
>>
>> --8<--
>>
>> >> Again, please do not top-post. It is the agreed-upon procedure in this
>> >> list to bottom-post when replying to threads. (I am not just going
>> >> "renegade thread-Nazi" on you.)
>> >
>> > Could you show me the signed agreement list. While it's convention on
>> > this list, it's certainly not something everyone agreed upon.
>>
>> To Rob,
>> I meant agreed-upon as in: it's been written... so somebody had to
>> agree to it up to the point that it was posted here -
>> http://us3.php.net/reST/php-src/README.MAILINGLIST_RULES
>
> "It has been written" and "it has been agreed upon" are two completely
> different things. Many things have been written, few things are agreed
> upon.

Unless the PHP development process has become a dictatorship, I'm
pretty sure more than one person decided it was a good idea before
putting it in the mailing list rules.


-- 
// Todd

-- 
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] Workflow app for software

2009-04-01 Thread bruce
now that.. was funny

actually laughed out loud!


-Original Message-
From: George Larson [mailto:george.g.lar...@gmail.com]
Sent: Wednesday, April 01, 2009 12:08 PM
To: Robert Cummings
Cc: bruce; haliphax; php-general@lists.php.net
Subject: Re: [PHP] Workflow app for software


Please quit side-posting.  Thanks.

On Wed, Apr 1, 2009 at 2:58 PM, Robert Cummings wrote:

> I for one don't find you very  | On Wed, 2009-04-01 at 11:46 -0700,
> funny Bruce. It's common knowledge | bruce wrote: so haliphax...
> that it's very difficult to follow | >
> side posts. If not already, then   | > since you seem to be the primary
> they should certainly be   | > person with this issue.. at
> dictatorily banned from being used.| > least for now... i'll ahead and
>| > nominate you to the guy in
> Cheers,| > charge of making sure posters
> Rob.   | > follow the written rule to not
>| > top/down/side/left/right post...
>   | >
>   | > have fun!!!
>   | >
>   | >
>   | >
>   | > -Original Message- From:
>   | > haliphax
>   | > [mailto:halip...@gmail.com]
>   | > Sent: Wednesday, April 01, 2009
>   | > 11:42 AM To:
>   | > php-general@lists.php.net
>   | > Subject: Re: [PHP] Workflow app
>   | > for software
>   | >
>   | >
>   | > On Wed, Apr 1, 2009 at 1:38 PM,
>   | > Robert Cummings
>   | >  wrote:
>   | > > On Wed, 2009-04-01 at 13:30
>   | > >> -0500, haliphax wrote: On
>   | > >> Wed, Apr 1, 2009 at 11:53
>   | > >> > AM, bruce
>   | > >> > 
>   | > >> > wrote: and haliphax...
>   | > >> >
>   | > >> > i specifically sent the
>   | > >> > reply to only you.. you
>   | > >> > then felt the need to reply
>   | > >> > to the list as a whole
>   | > >> >
>   | > >> > hmm.. ok.. this thread is
>   | > >> > officially dead!!
>   | > >> >
>   | > >> > unless of course it gets
>   | > >> > back to the initial
>   | > >> > question...
>   | > >> >
>   | > >> > peace!!
>   | > >> >
>   | > >> >
>   | > >> >> > -Original
>   | > >> >> > Message- From:
>   | > >> >> > haliphax
>| > >> >> > Sent: Wednesday, April
>   | > >> >> > 01, 2009 5:38 AM To:
>   | > >> >> > php-general@lists.php.net
>   | > >> >> > Subject: Re: [PHP]
>   | > >> >> > Workflow app for
>   | > >> >> > software
>   | > >>
>   | > >> --8<--
>   | > >>
>   | > >> >> Again, please do not
>   | > >> >> top-post. It is the
>

[PHP] Out of the blue question..

2009-04-06 Thread bruce
Hi Ladies/Gents of the list...

I've got an issue/question and figured I'd fire it to the list.

Over time, I've had a few projects that I've worked on, where I've required
someone with skills way beyond mine for a given area. And rather than spend
hours trying to figure it out, I've sometimes hired someone to aid for a
very short amount of time..

The issues have ranged from serious db optimization, to server security
issues, etc...

I was wondering, I'm assuming that other developers here have had similar
issues. Has anyone thought about doing a group hire of someone with the
advanced skills to solve the particular issue for the problem domain.

IE if enough people have, or know you're going to have mysql questions...
Then we find someone who's good/skilled and more or less have that person on
retainer for the group. This of course depends on how many people would want
to use the person's skills, and how often we'd need the person, and other
issues...

I figured that I'd post here to see what the list thinks/thought.. etc...


thanks

ps. And no, I have no one in mind, and this isn't an around the way
solicitation for $$$/work!!! (for all you cynics out there!!)



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



RE: [PHP] Out of the blue question..

2009-04-07 Thread bruce
chris...

did you read the entire msg.. this isn't/wasn't a hunt for someone for a
project...

please re-read..


-Original Message-
From: Chris [mailto:dmag...@gmail.com]
Sent: Monday, April 06, 2009 8:14 PM
To: bruce
Cc: php-general@lists.php.net
Subject: Re: [PHP] Out of the blue question..


bruce wrote:
> Hi Ladies/Gents of the list...
>
> I've got an issue/question and figured I'd fire it to the list.
>
> Over time, I've had a few projects that I've worked on, where I've
required
> someone with skills way beyond mine for a given area. And rather than
spend
> hours trying to figure it out, I've sometimes hired someone to aid for a
> very short amount of time..
>
> The issues have ranged from serious db optimization, to server security
> issues, etc...
>
> I was wondering, I'm assuming that other developers here have had similar
> issues. Has anyone thought about doing a group hire of someone with the
> advanced skills to solve the particular issue for the problem domain.
>
> IE if enough people have, or know you're going to have mysql questions...
> Then we find someone who's good/skilled and more or less have that person
on
> retainer for the group. This of course depends on how many people would
want
> to use the person's skills, and how often we'd need the person, and other
> issues...
>
> I figured that I'd post here to see what the list thinks/thought.. etc...

You can post job requests for stuff like this on elance.com,
rentacoder.com and I'm sure hundreds of other places.

I don't think this list is the appropriate place for it really but
that's just my opinion.

--
Postgresql & php tutorials
http://www.designmagick.com/


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



RE: [PHP] 800 pound gorilla

2009-04-20 Thread bruce
hmmm...

a developer might not (won't) give you voting rights? (is there sucj a
thing!!!)

however, if you put together a number of really skilled c/c++ (whatever)
developers, then you could easily take the current existing sourcebase of
code, and go ahead and fork your own version, and never need to worry about
what oracle is going to do with the current tree...

of course i'd have a better chance of winning the lottery!! but stranger
thing have happened...

but you should also remember that some major companies are using mysql for
various projects, and they could/might get together to form a dev core team
to keep it moving...

peace..


-Original Message-
From: Marc Christopher Hall [mailto:m...@hallmarcwebsites.com]
Sent: Monday, April 20, 2009 6:58 AM
To: 'Daniel Brown'
Cc: php-general@lists.php.net
Subject: RE: [PHP] 800 pound gorilla




-Original Message-
From: paras...@gmail.com [mailto:paras...@gmail.com] On Behalf Of Daniel
Brown
Sent: Monday, April 20, 2009 9:52 AM
To: Marc Christopher Hall
Cc: php-general@lists.php.net
Subject: Re: [PHP] 800 pound gorilla

On Mon, Apr 20, 2009 at 09:48, Marc Christopher Hall
 wrote:
> Sun buys MySQL and now Oracle buys Sun (not final, yet). What will happen
> with the main db we PHP'ers have come to know and love especially since v
5

Become a MySQL developer and help make the decision.

--

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1


Ahhh, I love the smell of condescension first thing in the morning. BTW I am
a MySQL developer thank you. A developer does not an owner make. Where do
you get the idea that Oracle would put this to a democratic vote?


--
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] Need Help! - Looking over a wireframe doc...

2009-05-05 Thread bruce
Hi..

I'm playing around with creating an app to allow users to
add/checkin/checkout docs from a web based app. The backend will tie into
SVN as a repository.

The app is intended to be a php/mysql/linux app.

I'm trying to find a few people that I might get to take a look at the
current doc(s) I have and give me some comments/feedback...

The goal of the app is to allow a user to register, and then select the
given doc he wants to work on, as well as the given workflow phase. This
allows the app to kind of restrict the access rights a user has to the doc,
based on where in the workflow the doc is..

Get to me offline if you're interested in taking a look.

thanks

-bruce


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



RE: [PHP] speaking of control structures...

2009-05-07 Thread bruce
you know...

interesting that goto can be found in code!!



-Original Message-
From: Robert Cummings [mailto:rob...@interjinn.com]
Sent: Thursday, May 07, 2009 7:36 AM
To: Tom Worster
Cc: Clancy; php-general@lists.php.net
Subject: Re: [PHP] speaking of control structures...


On Thu, 2009-05-07 at 09:33 -0400, Tom Worster wrote:
> On 5/6/09 9:31 PM, "Clancy"  wrote:
>
> > I can understand your reluctance to disregard your mother's advice, but
> > unfortunately she
> > had been brainwashed to accept the dogma of the day.
>
> actually, i don't believe so. she did numerical work so she continued
using
> fortran and therefore gotos for the rest of her life. i think she just
> didn't like goto. moreover, she was never dogmatic on any topic, it wasn't
> in her nature.
>
> anyway, how do you know how she came by her opinions?

Because that's how most people came by their opinion of goto? How did
you come by your opinion of goto? Oh yeah, your momma! Here let me open
your eyes a bit... I've done a grep on the PHP 5.2.9 source code, Apache
2.2.11 source code, and MySQL 5.1.33 source code for use of goto:

PHP 5.2.9: http://pastebin.com/f6b88957

   Apache 2.2.11: http://pastebin.com/f2c7f5d93

   MySQL 5.1.33:  http://pastebin.com/f4441a891

It would seem that goto has a lot of use in modern code. Just because
someone tells you something, doesn't mean you should believe it at face
value. Goto has many important uses in programming. The goto that was
spurned is not really the goto in use today. The goto in use today
generally has scope within a well defined context such as a function.

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP


--
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: Fwd: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA INDATABASE

2009-05-21 Thread bruce
if you really want to get to the real low level details of an app...

unless you're dealing with an app that's seriously crunching, and extremely
sensitive to returning data to the user's browser in a timely manner, you
should write all replies back to a db/tbl... this would allow you as the
developer to have a complete trek of the actions/paths (to an extent) for
any potential debugging issue.



-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Thursday, May 21, 2009 7:00 AM
To: Sumit Sharma
Cc: php-general@lists.php.net
Subject: Re: Fwd: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA
INDATABASE


On Thu, 2009-05-21 at 19:17 +0530, Sumit Sharma wrote:
> One more thing, should I use @ for security purpose or not so that the use
> can reply me with the errors so that I can troubleshoot the problem more
> effectively.
>
>
> Sumit
>
> -- Forwarded message --
> From: Ashley Sheridan 
> Date: Thu, May 21, 2009 at 6:36 PM
> Subject: Re: [PHP] SECURITY PRECAUTION BEFORE SUBMITTING DATA IN DATABASE
> To: Sumit Sharma 
> Cc: php-general@lists.php.net
>
>
> On Thu, 2009-05-21 at 18:22 +0530, Sumit Sharma wrote:
> > Hi,
> >
> > I am designing a php website for my client which interact with database.
> > This is my first project for any client (I hope he is not reading this
> mail
> > ;-)  ). I am a bit more concerned with database security. Can somebody
> shed
> > some light on the security measurements, precautions, and functions
> related
> > to database security in general to make sure that the data is safely
> stored
> > updated and retried from database. I have already used htmlentities(),
> > strip_tags(), addhashes(), and some regular expressions to check
security.
> > Looking for help beyond this.
> >
> >
> > Thanks in advance...
> > Sumit
>
> I'd advise using something like mysql_real_escape_string() (assuming you
> are using a MySQL database that is) on each variable of data before you
> insert it into the database. You could go further and validate specific
> data, so check that a field which you expect a number only contains a
> number, etc.
>
>
> Ash
> www.ashleysheridan.co.uk


I'd avoid using @ in favour of turning the errors off in your php.ini
or .htaccess, as there's no chance of you missing a statement here or
there.  It's generally accepted practice to have errors and warnings
turned off on a live server, and to only use them on development
servers.


Ash
www.ashleysheridan.co.uk


--
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] Startup Stuff in the san Francisco/Bay Area

2009-05-24 Thread bruce
Hi guys...

Before you start flaming/shouting.. thought I'd post this here, as I'm at my
wit's end, and this might help others as well. And yeah, this has nothing to
do with solving a php coding issue!!

I'm trying to figur eout if there are guys/gals/groups/etc.. of developers
here in the San Fran/San Jose/East Bay area that are into the pure sweat
equity startup thing. I'm simply looking to find if there are people/groups
that you might know of, how are into creating/starting projects. I've done
the Craigslist Posting thing, with no real luck, so I thought I'd post this
here...

Feel free to get to me off line to reduce the amount of time on the list for
this thread, unless you think it might be useful for others as well...

Thanks!



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



RE: [PHP] continue working after finishing up with the http client

2009-05-27 Thread bruce
hi tom...

exacly what are you trying to accomplish? is this in a web app? has the user
hit the site, logged in, etc?

can you provide an example of what the sequence of events are that you're
trying to deal with..

thanks


-Original Message-
From: Tom Worster [mailto:f...@thefsb.org]
Sent: Wednesday, May 27, 2009 6:27 AM
To: php-general@lists.php.net
Subject: [PHP] continue working after finishing up with the http client


what options are there to do the following:

1. receive request from client (including post data)

2. do some work, update the db, prepare output for client

3. send output and finish up with the client

4. do some more work that might take considerable time, updating the db some
more

it would be convenient and efficient if step 4 took place within the same
process as steps 1-3. but output control seems not to be sufficient:
ob_flush(); flush(); sends the output but leave the client waiting for more.
is there a way to close the connection as though exit; were called but
without quitting the script?

alternatively the script could start another process, copy over whatever
data is needed and disconnect from it. but that has its overheads on the
server.

are the other possibilities?

tia
tom



--
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] continue working after finishing up with the http client

2009-05-27 Thread bruce
hi tom...

if i understand your state diagram/workflow process. your server repsonds to
the client request, with two actions...

 action 1) return data to client relatively fast
 action 2) insert the data into your cache (or whereever) which takes
time...

is this correct?

do you have to somehow use the 'new'/updated cache data in the future
actions with the client...

it might be possible for you to have a setup, where you have an external
cron process, or other continually running process that does the cache
insertions



-Original Message-
From: Tom Worster [mailto:f...@thefsb.org]
Sent: Wednesday, May 27, 2009 7:14 AM
To: bruce; php-general@lists.php.net
Subject: Re: [PHP] continue working after finishing up with the http
client


On 5/27/09 9:50 AM, "bruce"  wrote:

> exacly what are you trying to accomplish? is this in a web app? has the
user
> hit the site, logged in, etc?
>
> can you provide an example of what the sequence of events are that you're
> trying to deal with..

it is a web app.

let's say for example that we're processing an ajax query. say we can
normally generate and deliver the response to the client quickly but the
speed depends on a cache with a relatively low miss rate.

now, when we get a cache miss, imagine that generating the client response
from scratch takes significantly less time than generating and inserting the
new cache entry corresponding to the query. so we want to send the response
to the client and then process the cache entry.

without getting into whether or not this cache design makes sense, my
question in this example is: what options are there for ending the http
transition and then continuing on to do the cache update work?


> -Original Message-
> From: Tom Worster [mailto:f...@thefsb.org]
> Sent: Wednesday, May 27, 2009 6:27 AM
> To: php-general@lists.php.net
> Subject: [PHP] continue working after finishing up with the http client
>
>
> what options are there to do the following:
>
> 1. receive request from client (including post data)
>
> 2. do some work, update the db, prepare output for client
>
> 3. send output and finish up with the client
>
> 4. do some more work that might take considerable time, updating the db
some
> more
>
> it would be convenient and efficient if step 4 took place within the same
> process as steps 1-3. but output control seems not to be sufficient:
> ob_flush(); flush(); sends the output but leave the client waiting for
more.
> is there a way to close the connection as though exit; were called but
> without quitting the script?
>
> alternatively the script could start another process, copy over whatever
> data is needed and disconnect from it. but that has its overheads on the
> server.
>
> are the other possibilities?



--
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] spawning a process that uses pipes - doesn't terminate when webpage download is canceled

2009-05-28 Thread bruce
Hi Flint.

Not sure if you have a solution to this yet, or if I fully understand! But
if your issue is basically that you have a situation where you might have
orphaned processes that never finish and that are consuming real resources
you could have the app get/monitor the process ID for each process you
create, and then simply periodically check to see if that process is in a
run state.

Bow, if the situation is one where the user aborts the transfer process, and
the underlying processes are still 'running' then I would still think the
above appproach would work, but you'd have to have your app keep track of
when the user 'kills' the download process..

But are you sure the orphaned processes are consuming resources, or are they
zombie processes, which are resident in the process tbl, but aren't really
consuming resources... sombie processes will (should) eventually be dealt
with by the operating system...

regards



-Original Message-
From: Flint Million [mailto:fmill...@gmail.com]
Sent: Wednesday, May 27, 2009 11:39 PM
To: php-general@lists.php.net
Subject: [PHP] spawning a process that uses pipes - doesn't terminate
when webpage download is canceled


so here's the scenario..

I have a site that uses php with a database to offer sound files to
users using streaming methods.

the request page has options, allowing the user to modify the sound
file in various ways, before having it sent to them

Here's the problem:

The method i'm using to feed the data to the user is to run the source
file through various piped commands, with the resulting audio being
dumped to stdout, and then using passthru in php to get that data to
the enduser.

here's an example, for serving an MP3 with its pitch/speed changed by sox:

passthru("lame --quiet --decode \"" . $in_file . "\" - | " .
 "sox -V -S -t wav - -t wav - speed " . $speed_factor . " | " .
 "lame --quiet " . $lame_params . " - -");

This works just fine, except the problem is if the end user aborts the
transfer (e.g. stops playback in the media player, cancels download of
the mp3, whatever) then it leaves behind both the sox process and the
decoder LAMe process along with the sh that's running them. the only
process that exits is the final encoding lame process. If the sound
file runs to completion, everythign exits properly.

But this obviously means enough "cancelling" of downloads means the
server ends up with a huge batch of stuck processes! And I even tried
simply killing the 'host' sh process, and the lame and sox processes
remain anyway. The only way I've been able to deal with this is
manually killing the lame and sox processes directly.

is there any way I can make this work, such so that if the user
cancels the transfer, all relavent processes are killed rather than
just the single process that's feeding output into php?

-FM

--
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] Numerical Recipe - Scheduling Question

2009-05-29 Thread bruce
Hi..

Got a need to be able to allow a user to specify the frequency to run
certain apps/processes.. I need to be able to have the user specify a start
Time, as well as a periodic frequency (once, hourly, daily, weekly...) as
well as allow the user to specify every XX minutes...

So i basically need to be able to determine when the future
events/occurances are, based on the user input.

I've searched the net for alogorithms dealing with scheduling and haven't
come up with any php based solutions.. I've also looked at numerical recipes
and some other sources (freshmeat/sourceforge/etc..) with no luck..

I have found an approach in another language that I could port to php.. But
before I code/recreate this, I figured I'd see if anyone here has pointers
or suggestions...

Cron doesn't work for me, as it can run a process at a given time.. but it
doesn't tell me when the next 'X' occurance would be...

Thoughts/Comments..

Thanks


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



RE: [PHP] Re: Numerical Recipe - Scheduling Question

2009-05-29 Thread bruce
hey shawn...

strtotime (or something similar) might just work

i'll always know the interval... which can be used to compute the nexttime,
which then becomes the next starttime...

i'm assuming there's an equally simple way to find the last day of a given
month if i choose that as an interval as well..

for my initial needs.. this might work.. until i free up time to actually
craft a more generic solution, independent of the underlying language/os..

thanks



for next month.. and the start

-Original Message-
From: Shawn McKenzie [mailto:nos...@mckenzies.net]
Sent: Friday, May 29, 2009 2:48 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Numerical Recipe - Scheduling Question


bruce wrote:
> Hi..
>
> Got a need to be able to allow a user to specify the frequency to run
> certain apps/processes.. I need to be able to have the user specify a
start
> Time, as well as a periodic frequency (once, hourly, daily, weekly...) as
> well as allow the user to specify every XX minutes...
>
> So i basically need to be able to determine when the future
> events/occurances are, based on the user input.
>
> I've searched the net for alogorithms dealing with scheduling and haven't
> come up with any php based solutions.. I've also looked at numerical
recipes
> and some other sources (freshmeat/sourceforge/etc..) with no luck..
>
> I have found an approach in another language that I could port to php..
But
> before I code/recreate this, I figured I'd see if anyone here has pointers
> or suggestions...
>
> Cron doesn't work for me, as it can run a process at a given time.. but it
> doesn't tell me when the next 'X' occurance would be...
>
> Thoughts/Comments..
>
> Thanks
>

This is confusing.  When and where do you need to "be able to determine
when the future events/occurances are"?  You need to display this after
the user schedules the app/process or an admin needs to login and see
this at any given time?

Regardless it is easy with the PHP time/date functions.  Once you've
collected and stored the start/stop times and interval, something
similar to:

$interval = "1 week";

$next = $start_time;
while ($next <= $end_time) {
$next = strtotime("+$interval", $next);
echo date(DATE_RFC822, $next) ."\n";
}


--
Thanks!
-Shawn
http://www.spidean.com

--
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



  1   2   3   4   5   6   7   >