Re: [PHP] Does something like this exist?

2009-06-29 Thread Nathan Nobbe
On Mon, Jun 29, 2009 at 2:12 PM, Christoph Boget
wrote

> I'm wondering if there isn't something out there that crawls through
> your codebase and generates a map of (any of) the following:
>
> * What files are include in which scripts


the inclued extension

http://pecl.php.net/package/inclued

* The relationships between defined classes (eg A extends B)
> * What other classes are utilized by which classes (eg, instantiation)
>

doxygen - i like it way more than php documentor or w/e its called..

-nathan


Re: [PHP] guide me please

2009-06-29 Thread Michael A. Peters

Suresh Gupta VG wrote:

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
 



What web server does Oracle use as part of their application server?
It may simply be a matter of the php module not being loaded when the 
web server starts.


But, as others have stated, you probably want to install a much fresher 
version of php, for a large number reasons.


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



Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-29 Thread Michael A. Peters

Rob Gould 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.





Generate your radio list via php.
When the value grabbed from database matches the button value, add a 
selected="selected" to the radio input.


Works for me.

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



[PHP] Re: Named pair array from variable

2009-06-29 Thread Shawn McKenzie
Shawn McKenzie wrote:
> Mikey Knutson wrote:
>> Is this even possible?  I'm building a string, properly formatted, to create 
>> a named pair or associative array.   The string is fine, and when I use it 
>> directly to create the array, all is well.  When I try to use the var to 
>> create the array, I get an empty array (I think).  Huh?
>>
>> Here is what I have:
>>
>> $myString = "'username' => 'password' , 'mickey' => 'mouse' , 'donald' => 
>> 'duck'";
>> $myArray = array($myString);
>> print ("array val: $myArray[username]");   // get an empty string here
>>
>>
>>
> 
> AFAIK you can't do what you're showing.  This will work, but is not advised:
> 
> eval('$myArray = array(' . $myString . ');');
> print ("array val: $myArray[username]");   // array val: password
> 
> Why are you needing to store the array indexes and values in a string
> like this?  Maybe we can give you an alternative approach.
> 

Unless I'm way off you might like serialize()


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

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



[PHP] Re: Named pair array from variable

2009-06-29 Thread Shawn McKenzie
Mikey Knutson wrote:
> Is this even possible?  I'm building a string, properly formatted, to create 
> a named pair or associative array.   The string is fine, and when I use it 
> directly to create the array, all is well.  When I try to use the var to 
> create the array, I get an empty array (I think).  Huh?
> 
> Here is what I have:
> 
> $myString = "'username' => 'password' , 'mickey' => 'mouse' , 'donald' => 
> 'duck'";
> $myArray = array($myString);
> print ("array val: $myArray[username]");   // get an empty string here
> 
> 
> 

AFAIK you can't do what you're showing.  This will work, but is not advised:

eval('$myArray = array(' . $myString . ');');
print ("array val: $myArray[username]");   // array val: password

Why are you needing to store the array indexes and values in a string
like this?  Maybe we can give you an alternative approach.

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

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



Re: [PHP] Named pair array from variable

2009-06-29 Thread Ashley Sheridan
On Mon, 2009-06-29 at 12:06 -0700, Mikey Knutson wrote:
> Is this even possible?  I'm building a string, properly formatted, to create 
> a named pair or associative array.   The string is fine, and when I use it 
> directly to create the array, all is well.  When I try to use the var to 
> create the array, I get an empty array (I think).  Huh?
> 
> Here is what I have:
> 
> $myString = "'username' => 'password' , 'mickey' => 'mouse' , 'donald' => 
> 'duck'";
> $myArray = array($myString);
> print ("array val: $myArray[username]");   // get an empty string here
> 
> 
> 
> 
What you're doing is assigning the string "'username' => 'password' ,
'mickey' => 'mouse' , 'donald' => 'duck'" to the first index of the
array. What you should be doing is assigning the elements one by one to
the array so that they have proper indexes.

Thanks
Ash
www.ashleysheridan.co.uk


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



[PHP] Named pair array from variable

2009-06-29 Thread Mikey Knutson
Is this even possible?  I'm building a string, properly formatted, to create 
a named pair or associative array.   The string is fine, and when I use it 
directly to create the array, all is well.  When I try to use the var to 
create the array, I get an empty array (I think).  Huh?

Here is what I have:

$myString = "'username' => 'password' , 'mickey' => 'mouse' , 'donald' => 
'duck'";
$myArray = array($myString);
print ("array val: $myArray[username]");   // get an empty string here




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



Re: [PHP] Does something like this exist?

2009-06-29 Thread Eddie Drapkin
Have you looked at class_parents()?
http://www.php.net/manual/en/function.class-parents.php

On Mon, Jun 29, 2009 at 4:42 PM, Christoph Boget wrote:
>>> * What files are include in which scripts
>> pecl.php.net/package/inclued  - an awesome tool, will show you
>> includes/require calls to other ones, show you any redundancy (dotted
>> lines) etc. helps you clean up any nested and unnecessary includes or
>> requires. Rasmus approved(tm)
>> use it with graphviz and you've got visual maps of your entire
>> include/require structure.
>
> Ok, I'll look in to it.  Thanks!
>
>>> * The relationships between defined classes (eg A extends B)
>>> * What other classes are utilized by which classes (eg, instantiation)
>> doesn't phpdoc or something do this stuff? might need comments before
>> each function/method to make it really work well. not sure. i think
>> there's also something called "phpxref" as well that might work...
>
> It does.  But I'm looking to use this on an inherited framework that,
> unfortunately, includes very little PHPDoc comments.  Considering how
> large the codebase is, it'd be quicker for me to write this
> functionality (to at least give us something to reference) than it
> would be to add the necessary comments.  Granted, that's something
> we'd want to eventually add anyway but it's something we could do over
> time as we became much more familiar with the framework.
>
> thnx,
> Christoph
>
> --
> 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] Does something like this exist?

2009-06-29 Thread Christoph Boget
>> * What files are include in which scripts
> pecl.php.net/package/inclued  - an awesome tool, will show you
> includes/require calls to other ones, show you any redundancy (dotted
> lines) etc. helps you clean up any nested and unnecessary includes or
> requires. Rasmus approved(tm)
> use it with graphviz and you've got visual maps of your entire
> include/require structure.

Ok, I'll look in to it.  Thanks!

>> * The relationships between defined classes (eg A extends B)
>> * What other classes are utilized by which classes (eg, instantiation)
> doesn't phpdoc or something do this stuff? might need comments before
> each function/method to make it really work well. not sure. i think
> there's also something called "phpxref" as well that might work...

It does.  But I'm looking to use this on an inherited framework that,
unfortunately, includes very little PHPDoc comments.  Considering how
large the codebase is, it'd be quicker for me to write this
functionality (to at least give us something to reference) than it
would be to add the necessary comments.  Granted, that's something
we'd want to eventually add anyway but it's something we could do over
time as we became much more familiar with the framework.

thnx,
Christoph

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



Re: [PHP] Does something like this exist?

2009-06-29 Thread Michael Shadle
On Mon, Jun 29, 2009 at 1:16 PM, Dotan Cohen wrote:

> * What files are include in which scripts

pecl.php.net/package/inclued  - an awesome tool, will show you
includes/require calls to other ones, show you any redundancy (dotted
lines) etc. helps you clean up any nested and unnecessary includes or
requires. Rasmus approved(tm)

use it with graphviz and you've got visual maps of your entire
include/require structure.

> * The relationships between defined classes (eg A extends B)
> * What other classes are utilized by which classes (eg, instantiation)

doesn't phpdoc or something do this stuff? might need comments before
each function/method to make it really work well. not sure. i think
there's also something called "phpxref" as well that might work...

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



Re: [PHP] Does something like this exist?

2009-06-29 Thread Ashley Sheridan
On Mon, 2009-06-29 at 23:16 +0300, Dotan Cohen wrote:
> > I'm wondering if there isn't something out there that crawls through
> > your codebase and generates a map of (any of) the following:
> >
> > * What files are include in which scripts
> > * The relationships between defined classes (eg A extends B)
> > * What other classes are utilized by which classes (eg, instantiation)
> >
> > I've done some looking around but haven't really been able to find
> > anything that does even some of this.  I could write functionality
> > that does this but didn't want to reinvent the wheel.
> >
> 
> I think that you're looking for Perl!
> 
> -- 
> Dotan Cohen
> 
> http://what-is-what.com
> http://gibberish.co.il
> 
Have you looked at PHPDoc? You'll have to comment your code fairly well
and in a specific style (which is a boon in itself) but it will produce
some fairly good documentation.

Thanks
Ash
www.ashleysheridan.co.uk


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



Re: [PHP] Does something like this exist?

2009-06-29 Thread Dotan Cohen
> I'm wondering if there isn't something out there that crawls through
> your codebase and generates a map of (any of) the following:
>
> * What files are include in which scripts
> * The relationships between defined classes (eg A extends B)
> * What other classes are utilized by which classes (eg, instantiation)
>
> I've done some looking around but haven't really been able to find
> anything that does even some of this.  I could write functionality
> that does this but didn't want to reinvent the wheel.
>

I think that you're looking for Perl!

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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



[PHP] Does something like this exist?

2009-06-29 Thread Christoph Boget
I'm wondering if there isn't something out there that crawls through
your codebase and generates a map of (any of) the following:

* What files are include in which scripts
* The relationships between defined classes (eg A extends B)
* What other classes are utilized by which classes (eg, instantiation)

I've done some looking around but haven't really been able to find
anything that does even some of this.  I could write functionality
that does this but didn't want to reinvent the wheel.

thnx,
Christoph

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



Re: [PHP] mail and mysql confirmation of that [double-opt in]

2009-06-29 Thread Shawn McKenzie
Grega Leskovsek wrote:
> how is the best way to check if email address is valid: is this preg_match() 
> OK?
> preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/',
> $email);

filter_var($email, FILTER_VALIDATE_EMAIL)

> 
> How can I make double opt-in mail system? My idea:
> 1.) I remember the email entered and user data and the sha1($email);
> in mysql db
> 2.) I send email with activation link of the sha1($email);
> 3.) I am not clear how to proceed when the link is activated. How to
> update the db and submit the necessary form to the marketing.

When the user clicks the activation link, mark the address active in the
subscribers table, or move the entry from a pending table to a
subscribers table.  Then execute the email/whatever to marketing just as
you would without using double opt-in.

> 
> Thanks in advance,
> 
> 

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

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



RE: [PHP] guide me please

2009-06-29 Thread Yuri Yarlei

Hi,

My suggestion is you install a better version of PHP or use other type of php 
server, you will use oracle db?  If is not necessary, you should use mysql or 
postgresql for learn php.
But this error maybe happen because you are using '' for php tags, 
if you use ''  maybe this error will go away

Yuri Yarlei.
Programmer PHP, CSS, Java, PostregreSQL;
Today PHP, tomorrow Java, after the world.
Kyou wa PHP, ashita wa Java, sono ato sekai desu.



> Date: Mon, 29 Jun 2009 15:10:22 +0530
> From: sures...@zensar.com
> To: php-general@lists.php.net
> Subject: [PHP] guide me please
> 
> 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
>  
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_
Descubra todas as novidades do novo Internet Explorer 8
http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmail&utm_medium=Tagline&utm_campaign=IE8

Re: [PHP] mail and mysql confirmation of that [double-opt in]

2009-06-29 Thread tedd

At 4:55 PM +0200 6/29/09, Grega Leskovsek wrote:
how is the best way to check if email address is valid: is this 
preg_match() OK?

preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/',
$email);

How can I make double opt-in mail system? My idea:
1.) I remember the email entered and user data and the sha1($email);
in mysql db
2.) I send email with activation link of the sha1($email);
3.) I am not clear how to proceed when the link is activated. How to
update the db and submit the necessary form to the marketing.

Thanks in advance,


Double opt-in.

1. Have the user enter their email address via a form that let's them 
know they are subscribing to a service. You might want to check for a 
valid email address (many versions) and/or a CAPTCHA. additionally, 
you need to check if they have already registered OR in the process 
of registering.


2. After they submit their email address, then have your script 
create a unique token and record it coupled with the email address in 
your database.


3. Then send a confirmation email to that email address with the 
token appended as a link in the email -- with instructions for the 
receiver to either ignore the email (with apologies) or click the 
link and be taken back to your site where your script takes the 
confirmation token and checks your database for a token/email match. 
If there is one, then that completes the process and you have a 
confirmed double opt-in email address to use. If not, have them try 
again.


Here's the script I wrote to do that:

http://www.webbytedd.com/b/sub-email/index.php

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Socket error

2009-06-29 Thread Luke
2009/6/29 Daniel Brown 

> On Mon, Jun 29, 2009 at 02:42, Luke wrote:
> > Hey guys, getting an odd error here... The code involved:
> [snip!]
>
>Luke,
>
>Just a friendly reminder: for future reference, please don't start
> a second thread on the list until the first is closed out ---
> particularly if it's the same subject.  Sometimes responses to
> questions - particularly in the middle of a Sunday night - will take
> some time, but someone will eventually reply.
>
> --
> 
> daniel.br...@parasane.net || danbr...@php.net
> http://www.parasane.net/ || http://www.pilotpig.net/
> Ask me about our fully-managed servers and proactive management
> clusters starting at just $200/mo.!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Ah, that wasn't impatience, I have two email addresses and was unsure which
were allowed to post to the list but apparently it's both! Sorry about that.

In relation to the question, the answer was indeed to change to
socket_create, the following code works fine:

$master_socket = socket_create(AF_INET, SOCK_STREAM,
0);
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);

Thanks for the help =)

-- 
Luke Slater
:O)


[PHP] mail and mysql confirmation of that [double-opt in]

2009-06-29 Thread Grega Leskovsek
how is the best way to check if email address is valid: is this preg_match() OK?
preg_match('/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/',
$email);

How can I make double opt-in mail system? My idea:
1.) I remember the email entered and user data and the sha1($email);
in mysql db
2.) I send email with activation link of the sha1($email);
3.) I am not clear how to proceed when the link is activated. How to
update the db and submit the necessary form to the marketing.

Thanks in advance,


-- 
When the sun rises I receive and when it sets I forgive ->
http://users.skavt.net/~gleskovs/
All the Love, Grega Leskov'sek

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



Re: [PHP] Socket error

2009-06-29 Thread Daniel Brown
On Mon, Jun 29, 2009 at 02:42, Luke wrote:
> Hey guys, getting an odd error here... The code involved:
[snip!]

Luke,

Just a friendly reminder: for future reference, please don't start
a second thread on the list until the first is closed out ---
particularly if it's the same subject.  Sometimes responses to
questions - particularly in the middle of a Sunday night - will take
some time, but someone will eventually reply.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Ask me about our fully-managed servers and proactive management
clusters starting at just $200/mo.!

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



Re: [PHP] guide me please

2009-06-29 Thread Daniel Brown
On Mon, Jun 29, 2009 at 05:40, Suresh Gupta VG wrote:
> 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.

This question is absolutely and completely out of the scope of
this list.  You're using a version of PHP for which support was ended
a long time ago, and the question isn't a PHP question, but instead a
web server question.

Check with the Oracle folks to see why the setup is not working
for you.  In lieu of that, check community-run forums and user-to-user
support sites specifically designed for Oracle's products.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Ask me about our fully-managed servers and proactive management
clusters starting at just $200/mo.!

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



Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-29 Thread tedd

At 7:12 PM -0400 6/28/09, Rob Gould 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.


Rob:

I don't know the best way, but this is the way I do it.

My database is relational. Each user has an unique ID as well as each 
question has a unique ID and the answer to each question is the one 
of several different choices (1 to whatever).


Each answer is recorded in the database as a *separate* record that 
contains the user ID, question ID and their choice. A record might 
look like this:


Table: answers
Fields: user_id, question_id, answer
Values: 34,115,5

That's where 34 is the user's ID, 115 is the question's ID, and 5 is 
the user's choice.


Then whenever you wanted to pull out and show the user (user 34 for 
example) what they picked, just select all the records that have a 
user ID of 34 and sort them by question ID and show the selections 
the user made.


If you have different test, then add a unique test_id field and make 
the question_id non-unique. An example might be:


Table: answers
Fields: user_id, test_id, question_id, answer
Values: 34,20,11,5

That's where 34 is the user's ID, 20 is the test's ID, 11 is the 
question's ID, and 5 is the user's choice.


Then you could pull out all records that have the same user ID and 
test ID and show the questions and answers associated with that test 
and that user.


That works for me.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] guide me please

2009-06-29 Thread András Csányi
2009/6/29 Suresh Gupta VG :
> 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

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



[PHP] guide me please

2009-06-29 Thread Suresh Gupta VG
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
 

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



Re: [PHP] Socket error

2009-06-29 Thread Per Jessen
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)


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



Re: [PHP] Best way to reinstate radio-button states from database?

2009-06-29 Thread Ashley Sheridan
On Sun, 2009-06-28 at 21:07 -0400, Bastien Koert wrote:
> On Sun, Jun 28, 2009 at 7:12 PM, Rob Gould 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 010111010101010111000 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


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