php-general Digest 10 Dec 2013 18:03:00 -0000 Issue 8444

Topics (messages 322555 through 322560):

Re: Notification of listbox selection change
        322555 by: Ashley Sheridan
        322556 by: Richard S. Crawford
        322557 by: Larry Martell
        322558 by: Larry Martell
        322559 by: Tim Streater

Question about best practices with regard to site structure and 
include/include_path
        322560 by: George Wilson

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Mon, 2013-12-09 at 15:40 -0500, Larry Martell wrote:
> Is there any way in php to have a function be called when the value of
> a listbox selection changes?
> 

PHP is executed on the server, that select list is on the client side.
To detect a change of the select list, you would have to use Javascript.

If there's something that absolutely has to be executed on the
server-side from this change (like an email, or database update) then
you could make an Ajax request to a PHP script. However, you've not said
what it is you want to do, only how to do what you think you should,
which are not the same things. If you explain in more detail what you're
trying to achieve, then we could offer better help.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---
Not directly. JavaScript and AJAX would have to be involved, if I'm
understanding your question properly.


On Mon, Dec 9, 2013 at 12:40 PM, Larry Martell <larry.mart...@gmail.com>wrote:

> Is there any way in php to have a function be called when the value of
> a listbox selection changes?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Sláinte,
Richard S. Crawford (rich...@underpope.com) http://www.underpope.com
Twitter: http://twitter.com/underpope
Facebook: http://www.facebook.com/underpope
Google+: http://gplus.to/underpope
Stop the cat! Donate today! http://stayclassy.org/stonegoose

--- End Message ---
--- Begin Message ---
On Mon, Dec 9, 2013 at 3:43 PM, Andrew Ballard <aball...@gmail.com> wrote:
> That requires a separate request triggered by client-side scripting
> (JavaScript).

That's what thought, just wanted to make sure. Thanks.

>
>
> On Mon, Dec 9, 2013 at 3:40 PM, Larry Martell <larry.mart...@gmail.com>
> wrote:
>>
>> Is there any way in php to have a function be called when the value of
>> a listbox selection changes?
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>

--- End Message ---
--- Begin Message ---
On Mon, Dec 9, 2013 at 3:48 PM, Ashley Sheridan
<a...@ashleysheridan.co.uk> wrote:
> On Mon, 2013-12-09 at 15:40 -0500, Larry Martell wrote:
>> Is there any way in php to have a function be called when the value of
>> a listbox selection changes?
>>
>
> PHP is executed on the server, that select list is on the client side.

I know that. I thought perhaps there was some php construct that set
up some sort of Ajax request. I didn't think so,

> To detect a change of the select list, you would have to use Javascript.
>
> If there's something that absolutely has to be executed on the
> server-side from this change (like an email, or database update) then
> you could make an Ajax request to a PHP script. However, you've not said
> what it is you want to do, only how to do what you think you should,
> which are not the same things. If you explain in more detail what you're
> trying to achieve, then we could offer better help.

This is a mod to an existing app (that I didn't write)

Currently the user selects one item from a dropdown and clicks on a
submit button and they get a table of data based on their selection.
Via some javascript every 60 seconds the window is reloaded and the
table is updated (from the db which is changing).

What they want is a frame to the right of the table with a listbox
with all the choices (I have that coded.) When they select item(s)
from the listbox row(s) would get added to the table and when they
deselect items rows would be removed. They don't want to wait for the
next refresh nor have to click on a submit button.

Thanks.
-larry

--- End Message ---
--- Begin Message ---
On 09 Dec 2013 at 21:07, Larry Martell <larry.mart...@gmail.com> wrote: 

> What they want is a frame to the right of the table with a listbox
> with all the choices (I have that coded.) When they select item(s)
> from the listbox row(s) would get added to the table and when they
> deselect items rows would be removed. They don't want to wait for the
> next refresh nor have to click on a submit button.

You have to detect their actions on the javascript side, make an ajax request 
to the server, and have a PHP script respond with some data which you use to 
update the table.

--
Cheers  --  Tim

--- End Message ---
--- Begin Message ---
Greetings all,
I apologize if this email is really long. I manage a code base which
has been maintained by at least 5 lead developers over the last 3
years- all coming from different backgrounds and approaches. Moral of
the story- it is a scary ugly mess of a code base. I am in the process
of refactoring the site to make things cleaner and more organized with
the eventual goal of assuming an MVC or similar flavored OO
architecture but that is a long term goal. I have about 485 source
files to work with total.

Here is the question. Step one in my plan is to reorganize everything
and to centralize all of the site configuration. Eventually I will
move to using namespaces and autoloaders but for now I am required to
stick with include/requires. I am weighing out the costs and benefits
of using include/require with absolute paths defined vs. using
set_include_path.

My very strong inclination is to use set_include_path and specifify a
configuration folder (which I have already started using) and have
every script include a script which points to that. I was wondering if
there are any potential issues I should remain mindful of. I ask
because as I have been looking into this feature, I see a lot of
conflicting information regarding best practices. Here are the
parameters I have to work with (for better or worse):

1) I am not permitted to use a .htaccess file per department policy- I
may be able to set a path variable in httpd.conf but kinda want to
avoid it since server configurations make management very nervous.
2) Namespaces, while a long term goal, are not feasible right now
3) The directory structure will change in time, I need a solution
which refactors cleanly and safely (dynamically is nice too)

Thank you in advance.

--- End Message ---

Reply via email to