php-general Digest 29 Jun 2009 09:48:47 -0000 Issue 6201
Topics (messages 294699 through 294707):
Best way to reinstate radio-button states from database?
294699 by: Rob Gould
294700 by: Bastien Koert
294704 by: Ashley Sheridan
Socket error
294701 by: Luke
294702 by: Stuart
294703 by: Luke
294705 by: Per Jessen
guide me please
294706 by: Suresh Gupta VG
294707 by: András Csányi
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I have a webpage which allows people to log in and make selections
with radio buttons and hit SUBMIT and saves the data from those radio
buttons to a mySQL database.
However, I'm finding that I also need the ability to allow a user to
log back in at a later date (or even on a different computer), and
pull up that survey again,
with each of the 50-something radio-buttons back in the positions in
which they were last saved.
Surely there's a best-case-method for doing this type of thing (saving
large numbers of radio-button-group settings to mySQL and pulling them
back
again later). Any advice is greatly appreciated. Perhaps there's a
jQuery-way to retrieve all the radio-button group settings as an array
and save it and pull it back again?
Or perhaps a PHP-specific method - - - I'm fine with either.
--- End Message ---
--- Begin Message ---
On Sun, Jun 28, 2009 at 7:12 PM, Rob Gould<[email protected]> wrote:
> I have a webpage which allows people to log in and make selections with
> radio buttons and hit SUBMIT and saves the data from those radio buttons to
> a mySQL database.
>
> However, I'm finding that I also need the ability to allow a user to log
> back in at a later date (or even on a different computer), and pull up that
> survey again,
> with each of the 50-something radio-buttons back in the positions in which
> they were last saved.
>
> Surely there's a best-case-method for doing this type of thing (saving large
> numbers of radio-button-group settings to mySQL and pulling them back
> again later). Any advice is greatly appreciated. Perhaps there's a
> jQuery-way to retrieve all the radio-button group settings as an array and
> save it and pull it back again?
> Or perhaps a PHP-specific method - - - I'm fine with either.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I've tended to use a binary string for the values, as my radio/
checkboxs tend to be yes / no, so I store the data in a single field
as 010111010111100000000101010111000 using 0=no and 1=yes.
Then a quick loop through the string sets my values.
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
On Sun, 2009-06-28 at 21:07 -0400, Bastien Koert wrote:
> On Sun, Jun 28, 2009 at 7:12 PM, Rob Gould<[email protected]> wrote:
> > I have a webpage which allows people to log in and make selections with
> > radio buttons and hit SUBMIT and saves the data from those radio buttons to
> > a mySQL database.
> >
> > However, I'm finding that I also need the ability to allow a user to log
> > back in at a later date (or even on a different computer), and pull up that
> > survey again,
> > with each of the 50-something radio-buttons back in the positions in which
> > they were last saved.
> >
> > Surely there's a best-case-method for doing this type of thing (saving large
> > numbers of radio-button-group settings to mySQL and pulling them back
> > again later). Any advice is greatly appreciated. Perhaps there's a
> > jQuery-way to retrieve all the radio-button group settings as an array and
> > save it and pull it back again?
> > Or perhaps a PHP-specific method - - - I'm fine with either.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> I've tended to use a binary string for the values, as my radio/
> checkboxs tend to be yes / no, so I store the data in a single field
> as 010111010111100000000101010111000 using 0=no and 1=yes.
>
> Then a quick loop through the string sets my values.
>
>
> --
>
> Bastien
>
> Cat, the other other white meat
>
Or use a separate survey table to store each answer, and associate it
with the user by the index on the users table.
Thanks
Ash
www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
Hey guys, getting an odd error here... The code involved:
$master_socket = socket_create_listen($this->port);
socket_bind($master_socket, '127.0.0.1', $this->port);
socket_listen($master_socket);
socket_set_option($master_socket, SOL_SOCKET, SO_REUSEADDR, 1);
socket_set_nonblock($master_socket);
And I'm getting:
'PHP Warning: socket_bind(): unable to bind address [22]: Invalid argument
in /home/luke/talkserver/new/classes/server.php online 30'
$this->port is valid, I've checked both this and that socket_create_listen
seems to be executing correctly.
I'm a bit lost on the error too it seems to be what the php.net manual says
are the parameters?
I'm trying to create a listening socket server that binds to a port on the
local machine.
Thanks in advance for any help!
--
Luke Slater
:O)
--- End Message ---
--- Begin Message ---
2009/6/29 Luke <[email protected]>:
> Hey guys, getting an odd error here... The code involved:
>
> $master_socket = socket_create_listen($this->port);
>
> socket_bind($master_socket, '127.0.0.1', $this->port);
> socket_listen($master_socket);
> socket_set_option($master_socket, SOL_SOCKET, SO_REUSEADDR, 1);
> socket_set_nonblock($master_socket);
>
> And I'm getting:
>
> 'PHP Warning: socket_bind(): unable to bind address [22]: Invalid argument
> in /home/luke/talkserver/new/classes/server.php online 30'
>
> $this->port is valid, I've checked both this and that socket_create_listen
> seems to be executing correctly.
>
> I'm a bit lost on the error too it seems to be what the php.net manual says
> are the parameters?
>
> I'm trying to create a listening socket server that binds to a port on the
> local machine.
>
> Thanks in advance for any help!
What port are you trying to bind to? If it's <= 1024 then you need to
run it as a privileged user.
-Stuart
--
http://stut.net/
--- End Message ---
--- Begin Message ---
2009/6/29 Stuart <[email protected]>
> 2009/6/29 Luke <[email protected]>:
> > Hey guys, getting an odd error here... The code involved:
> >
> > $master_socket = socket_create_listen($this->port);
> >
> > socket_bind($master_socket, '127.0.0.1', $this->port);
> > socket_listen($master_socket);
> > socket_set_option($master_socket, SOL_SOCKET, SO_REUSEADDR,
> 1);
> > socket_set_nonblock($master_socket);
> >
> > And I'm getting:
> >
> > 'PHP Warning: socket_bind(): unable to bind address [22]: Invalid
> argument
> > in /home/luke/talkserver/new/classes/server.php online 30'
> >
> > $this->port is valid, I've checked both this and that
> socket_create_listen
> > seems to be executing correctly.
> >
> > I'm a bit lost on the error too it seems to be what the php.net manual
> says
> > are the parameters?
> >
> > I'm trying to create a listening socket server that binds to a port on
> the
> > local machine.
> >
> > Thanks in advance for any help!
>
> What port are you trying to bind to? If it's <= 1024 then you need to
> run it as a privileged user.
>
> -Stuart
>
> --
> http://stut.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Unfortunately that doesn't make a difference :(
--
Luke Slater
:O)
--- End Message ---
--- Begin Message ---
Luke wrote:
> Hey guys, getting an odd error here... The code involved:
>
> $master_socket = socket_create_listen($this->port);
>
> socket_bind($master_socket, '127.0.0.1', $this->port);
> socket_listen($master_socket);
> socket_set_option($master_socket, SOL_SOCKET,
> SO_REUSEADDR, 1); socket_set_nonblock($master_socket);
>
I think you need to use socket_create() instead of
socket_create_listen().
/Per
--
Per Jessen, Zürich (21.9°C)
--- End Message ---
--- Begin Message ---
Hi List,
I am newb to this PHP. I am using "AIX Version 5.3" OS and "PHP version 4.3.9"
by default version and "Oracle Application Server 10g Release 2". Configured
properly and I am getting the phpinfo.php on browser properly. But when I write
my own code for php, it is just displaying the code but it is not running the
php code.
Is there any mistake in configuring the apache or else where? pls guide me.
With thanks and Regards,
Suresh.G
--- End Message ---
--- Begin Message ---
2009/6/29 Suresh Gupta VG <[email protected]>:
> Hi List,
>
> I am newb to this PHP. I am using "AIX Version 5.3" OS and "PHP version
> 4.3.9" by default version and "Oracle Application Server 10g Release 2".
> Configured properly and I am getting the phpinfo.php on browser properly. But
> when I write my own code for php, it is just displaying the code but it is
> not running the php code.
>
> Is there any mistake in configuring the apache or else where? pls guide me.
If Oracle Application Server 10g Release 2 able to run php scripts
this is a configuration error. I suggest search in the server
documentation or in google how can handle Oracle AppServer php.
If doesn't able to handle php choose another server for example apache.
--
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell
--- End Message ---