Re: [PHP] Dotnet Remoting

2011-02-24 Thread Bastien Koert
On Thu, Feb 24, 2011 at 3:33 PM, Daevid Vincent wrote: > > >> -Original Message- >> From: Bastien [mailto:phps...@gmail.com] >> Sent: Thursday, February 24, 2011 4:18 AM >> To: Gary >> Cc: php-general@lists.php.net >> Subject: Re: [PHP] Dotnet Remoting >> >> >> >> On 2011-02-24, at 5:17 AM

RE: [PHP] Dotnet Remoting

2011-02-24 Thread Daevid Vincent
> -Original Message- > From: Bastien [mailto:phps...@gmail.com] > Sent: Thursday, February 24, 2011 4:18 AM > To: Gary > Cc: php-general@lists.php.net > Subject: Re: [PHP] Dotnet Remoting > > > > On 2011-02-24, at 5:17 AM, Gary wrote: > > > This is purely of academic interest to me

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Jim Lucas
On 2/24/2011 3:01 AM, Dave M G wrote: > PHP users, > > I obviously don't understand what array_walk_recursive does. > > Can someone break down in simple terms why the following doesn't work? > > - - - > > $karamohOutput['test'] = ""; > > function test_print($item, $key) > { > return "$key

Re: [PHP] Re: Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-24 Thread David Harkness
If each array will contain a single type of object, but you need many of these arrays, each containing a different type of object, I recommend creating a generic "instances-of-class" array using ArrayObject. You can enforce the type in append(), offsetSet(), and exchangeArray() and then check the c

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-24 Thread Gary
t;> >> >> >> >> >> >> >> This is the code for the second processing page. >> >> >> >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >>

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-24 Thread Steve Staples
On Thu, 2011-02-24 at 12:52 -0500, Gary wrote: > "Steve Staples" wrote in message > news:1298568238.14826.2431.camel@webdev01... > > On Thu, 2011-02-24 at 11:42 -0500, Gary wrote: > >> "Steve Staples" wrote in message > >> news:1298492194.14826.2425.camel@webdev01... > >> > On Wed, 2011-02-23 at

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-24 Thread Gary
>> >> >> ?> >> >> >> >> >> >> This is the code for the second processing page. >> >> >> >> >> >> >> >> >> > >> >> >> >> >> >> >> >> if ( !empty($_POST['county'])) >> >> >> foreach ( $_POST['county'] AS $id => $name ) >> >> >> echo 'You have selected '. " {$name}".''; >> >> >> >> >> >> >> >> >> >> >> >> $totalRows_county_result_net= "($totalRows_county_result) + (1)"; >> >> >> echo "[$totalRows_county_result_net]"; >> >> >> echo "$totalRows_county_result"; >> >> >> ?> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > >> >> $name=$_POST['name']; >> >> >> echo 'You have selected'."$name"; >> >> >> >> >> >> ?> >> >> >> > >> >> mysql_free_result($county_result); >> >> >> ?> >> >> >> >> >> >> Again, thank you for any input. >> >> >> >> >> >> Gary >> >> > >> >> > I think it may have to do with HTML, or the fact that IE is >> >> > "helping" >> >> > you with your coding... where FF and Chrome are usually more >> >> > "literal" (yet better IMO). Also, the fact that "submit" has not >> >> > been >> >> > defined. >> >> > >> >> > try adding: >> >> > >> >> > >> >> > This *SHOULD* give you the submit button, but the style is "hidden" >> >> > now, >> >> > so it shouldn't show, but it will fire off the "submit" action... >> >> > make >> >> > sure it is in between the tags though. >> >> > >> >> > Steve >> >> > >> >> Steve >> >> >> >> Thank you for your reply, I had inserted a submit button prior, but it >> >> did >> >> not work. I tried your suggestions and got the same result. I am not >> >> seeing anything in the html that should be causing the hick-up, but >> >> given >> >> the php is run on the server as Peter pointed out, browser issues with >> >> php I >> >> have not really encountered before. >> >> >> >> I can live with a submit button, but living with one that does not >> >> work... >> >> >> >> Thank you for your input, if you see anything else that seems amiss, >> >> please >> >> let me know. >> >> >> >> Gary >> >> >> > >> > the as far as I know, isn't a standard/valid >> > html attribute... so I would remove it altogether. >> > http://www.w3schools.com/tags/tag_form.asp >> > >> > >> > and try on the to be >> > >> > where Form1 is the id of the form (so add that to the >> > >> > >> > try that... (i haven't been testing... my fault... but I am in the >> > midst >> > of work right now to really test it out) >> > >> > good luck! >> > >> > Steve >> >> Thank you to everybody that has helped. As it is now, I have the >> checkboxes >> appearing in all browers, but I am unable to pass the "checked" values to >> the next page which echo's the choices. >> >> The page that produces the checkboxes is here: (and this works fine) >> >> >> >> if ( isset($_POST['submit']) ) { // if form is submitted, process it >> >> >> print "\n"; >> >> >> >> if ($Recordset1) { >> print "\n"; >> >> print "  \n"; >> >> >> print "\n"; >> //create table >> $i = 0; >> while ( $row = mysql_fetch_array($Recordset1) ) { >> $i++; >> print "\n"; >> >> print "> value=\"$row[name]\">\n"; >> >> /*echo "{$row['state_id']}\n";*/ >> >> echo "{$row['name']}\n"; >> >> echo "\n"; >> >> }//end while >> print "\n"; >> } else { >> echo("Error performing query: " . >> mysql_error() . ""); >> >> } >> print "\n"; >> print "\n"; >> }?> >> >> *** >> >> My query on phpForm3.php is >> >> $query_county_result = "SELECT * FROM counties WHERE name = 'checked' "; >> >> Which is to be displayed by >> >> if ( !empty($_POST['county'])) >> foreach ( $_POST['county'] AS $id => $name ) >> echo 'You have selected '. " {$name}".''; >> >> I get a blank page and mysql_num_row returns 0 >> >> Again, sorry I am not getting this and thank you for all your help. >> >> Gary >> >> > > to get back to your other issue you were having, i've created a test > page from your code: > http://pastebin.com/WCH6HQ4Q > > basically, remove the submit, change the onchange event for the select, > and then add the javascript function. this should work in all browsers > (unless of course you have javascript disabled (which was talked about a > few weeks/months ago) > > NOW, for this issue you have today... checkboxes are an array... so you > will need to use it as: > some text > > notice the [] in the name attribute of the checkbox? > > Hope that all works... (this is also not a PHP related question... > hasn't really been all along, more like HTML and Javascript, but I am > glad to help if i can) > > Steve Steve As always thank you. I'm not sure we are on the same page (unless I don't understand your answer which of course is entirly possible). I have the checkboxes displayed using this print "\n"; I ended up using a submit button which seems to work fine. I had the results of those checkboxes being displayed on the next page, but now it does not. The query is mysql_select_db($database_assess, $assess_remote); $query_county_result = "SELECT * FROM counties WHERE name ='checked'"; $county_result = mysql_query($query_county_result, $assess_remote) or die(mysql_error()); $row_county_result = mysql_fetch_assoc($county_result); $totalRows_county_result = mysql_num_rows($county_result); The script to display it is if ( !empty($_POST['county'])) foreach ( $_POST['county'] AS $id => $name ) echo 'You have selected '. " {$name}".''; Frustrating how it was working, now it is not. Thanks again. Gary __ Information from ESET Smart Security, version of virus signature database 5904 (20110224) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-24 Thread Steve Staples
On Thu, 2011-02-24 at 11:42 -0500, Gary wrote: > "Steve Staples" wrote in message > news:1298492194.14826.2425.camel@webdev01... > > On Wed, 2011-02-23 at 14:56 -0500, Gary wrote: > >> "Steve Staples" wrote in message > >> news:1298490417.14826.2418.camel@webdev01... > >> > On Wed, 2011-02-23 at

[PHP] Re: Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-24 Thread Richard Quadling
On 24 February 2011 12:43, Richard Quadling wrote: > Hi. > > Brain being a little slow today. > > My objective is to enforce a parameter to a method to be an array of a > specific class (or null). > > The specific class is LatLng. > > I want to be able to pass an array of LatLngs to a method. > >

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-24 Thread Gary
gt; > >> value="{$row['name']}"> >> >> {$row['state_id']} >> >> {$row['name']} >> >> >> >> ROW; >> >> }//end while >> >> echo ''; >> >> } else { >> >> echo 'Error performing query: '.mysql_error().''; >> >> } >> >> echo ''; >> >> } >> >> >> >> ?> >> >> >> >> This is the code for the second processing page. >> >> >> >> >> >> > >> >> >> >> >> if ( !empty($_POST['county'])) >> >> foreach ( $_POST['county'] AS $id => $name ) >> >> echo 'You have selected '. " {$name}".''; >> >> >> >> >> >> >> >> $totalRows_county_result_net= "($totalRows_county_result) + (1)"; >> >> echo "[$totalRows_county_result_net]"; >> >> echo "$totalRows_county_result"; >> >> ?> >> >> >> >> >> >> >> >> >> >> > >> $name=$_POST['name']; >> >> echo 'You have selected'."$name"; >> >> >> >> ?> >> >> > >> mysql_free_result($county_result); >> >> ?> >> >> >> >> Again, thank you for any input. >> >> >> >> Gary >> > >> > I think it may have to do with HTML, or the fact that IE is "helping" >> > you with your coding... where FF and Chrome are usually more >> > "literal" (yet better IMO). Also, the fact that "submit" has not been >> > defined. >> > >> > try adding: >> > >> > >> > This *SHOULD* give you the submit button, but the style is "hidden" >> > now, >> > so it shouldn't show, but it will fire off the "submit" action... make >> > sure it is in between the tags though. >> > >> > Steve >> > >> Steve >> >> Thank you for your reply, I had inserted a submit button prior, but it >> did >> not work. I tried your suggestions and got the same result. I am not >> seeing anything in the html that should be causing the hick-up, but given >> the php is run on the server as Peter pointed out, browser issues with >> php I >> have not really encountered before. >> >> I can live with a submit button, but living with one that does not >> work... >> >> Thank you for your input, if you see anything else that seems amiss, >> please >> let me know. >> >> Gary >> > > the as far as I know, isn't a standard/valid > html attribute... so I would remove it altogether. > http://www.w3schools.com/tags/tag_form.asp > > > and try on the to be > > where Form1 is the id of the form (so add that to the > > > try that... (i haven't been testing... my fault... but I am in the midst > of work right now to really test it out) > > good luck! > > Steve Thank you to everybody that has helped. As it is now, I have the checkboxes appearing in all browers, but I am unable to pass the "checked" values to the next page which echo's the choices. The page that produces the checkboxes is here: (and this works fine) if ( isset($_POST['submit']) ) { // if form is submitted, process it print "\n"; if ($Recordset1) { print "\n"; print "  \n"; print "\n"; //create table $i = 0; while ( $row = mysql_fetch_array($Recordset1) ) { $i++; print "\n"; print "\n"; /*echo "{$row['state_id']}\n";*/ echo "{$row['name']}\n"; echo "\n"; }//end while print "\n"; } else { echo("Error performing query: " . mysql_error() . ""); } print "\n"; print "\n"; }?> *** My query on phpForm3.php is $query_county_result = "SELECT * FROM counties WHERE name = 'checked' "; Which is to be displayed by if ( !empty($_POST['county'])) foreach ( $_POST['county'] AS $id => $name ) echo 'You have selected '. " {$name}".''; I get a blank page and mysql_num_row returns 0 Again, sorry I am not getting this and thank you for all your help. Gary __ Information from ESET Smart Security, version of virus signature database 5904 (20110224) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: mysql_num_rows()

2011-02-24 Thread Gary
gt;>> >>> But, because you only show the number of records AFTER the loop, you >>> could >>> do: >>> >>> $result = mysql_query("SELECT * FROM `counties` WHERE name = 'checked'") >>> $county_total = 0; >>> while($row = mysql_fetch_array($result)) >>> { >>> echo $row['name']; >>> $county_total++; >>> } >>> echo "$county_total"; >>> >> >> Peter >> >> Thank you for your suggestion...btw "cut out the decoration" LOL >> >> I'm sorry to report it did not work. I tried various configurations of it >> but to no avail. >> >> Any other suggestions? >> >> Again, thank you for your help. >> >> Gary >> >> >> >> __ Information from ESET Smart Security, version of virus >> signature database 5895 (20110222) __ >> >> The message was checked by ESET Smart Security. >> >> http://www.eset.com >> >> >> >> > > Gary, > > I'd probably need a bit more detail on the "it did not work" to go much > further! > Actually, it looks like I missed a semicolon on the "mysql_query" line in > *both* versions - maybe that was the problem... > Do you have access to your server logs, to see if any errors are reported > when you run this? > > Cheers > Peter > > -- > Peter Ford, Developer phone: 01580 89 fax: 01580 > 893399 > Justcroft International Ltd. > www.justcroft.com > Justcroft House, High Street, Staplehurst, Kent TN12 0AH United > Kingdom > Registered in England and Wales: 2297906 > Registered office: Stag Gates House, 63/64 The Avenue, Southampton SO17 > 1XS Peter I'm sorry, I sort of abandoned this post since I found I had other problems with the scripts and posted another question above. I have at this point the checkboxes appearing, the mysql_num_row is not working yet, but that can got kicked down the road a bit. Thank you for all your help, I'm trying to formulate me next question for the aforementioned 2nd post. Gary __ Information from ESET Smart Security, version of virus signature database 5904 (20110224) __ The message was checked by ESET Smart Security. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Richard Quadling
On 24 February 2011 15:15, Dave M G wrote: > FeIn, > > Thank you for responding. > > >> what did you expect to happen when you call array_walk_recursive? > > > What I don't understand is why it did not append to the string as it > walked through each key/value pair. > > It seems like even though t

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread FeIn
Hi, Well, first array_walk_recursive returns a boolean so what you are doing in you script is append a boolean (true or false) that will be converted to string. So if array_walk_recursive will return true you will have the string "1" in $karamohOutput['test'], and if array_walk_recursive will retu

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Dave M G
FeIn, Thank you for responding. > what did you expect to happen when you call array_walk_recursive? What I don't understand is why it did not append to the string as it walked through each key/value pair. It seems like even though the variable inside the function called by array_walk_recursiv

Re: [PHP] Dotnet Remoting

2011-02-24 Thread Bastien
On 2011-02-24, at 5:17 AM, Gary wrote: > This is purely of academic interest to me, nothing urgent. > > I'm just wondering if it's possible to do remoting with PHP's DOTNET > class (http://php.net/manual/en/class.dotnet.php) which I didn't even > know existed until yesterday. If it is, is ther

[PHP] Simplest way of enforcing an array of instances of a specific class but treating the whole thing as an array.

2011-02-24 Thread Richard Quadling
Hi. Brain being a little slow today. My objective is to enforce a parameter to a method to be an array of a specific class (or null). The specific class is LatLng. I want to be able to pass an array of LatLngs to a method. I know I can hint this as ... function(array $LatLngs) {...} and then

Re: [PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread FeIn
Hi, How does the input array look like (the contents of the $karamohArray variable) ? Is your script generating any errors? What do you expect to happen when you call array_walk_recursive? On Thu, Feb 24, 2011 at 1:01 PM, Dave M G wrote: > PHP users, > > I obviously don't understand what array_

[PHP] Why is this array_walk_recursive action not working?

2011-02-24 Thread Dave M G
PHP users, I obviously don't understand what array_walk_recursive does. Can someone break down in simple terms why the following doesn't work? - - - $karamohOutput['test'] = ""; function test_print($item, $key) { return "$key holds $item\n"; } $karamohOutput['test'] .= array_walk_recursive

[PHP] Re: mysql_num_rows()

2011-02-24 Thread Pete Ford
On 22/02/11 14:40, Gary wrote: "Pete Ford" wrote in message news:76.48.39221.054c3...@pb1.pair.com... On 22/02/11 13:59, Gary wrote: "Pete Ford" wrote in message news:a4.c0.39221.b3ca3...@pb1.pair.com... On 22/02/11 05:40, Gary wrote: Can someone tell me why this is not working? I do not