Re: [PHP] Manipulating variables

2011-02-23 Thread Jim Lucas
On 2/23/2011 8:48 PM, Ron Piggott wrote: Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web ap

Re: [PHP] Manipulating variables

2011-02-23 Thread Robert Cummings
On 11-02-23 11:48 PM, Ron Piggott wrote: Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web ap

Re: [PHP] Manipulating variables

2011-02-23 Thread Joshua Kehn
I must be missing something, why do you need to use variable variables when checking user answers? The logic should be something like: $answer_key = array('question1' => 'answer', 'question2' => 'answer', ); foreach($answer_key as $q => $a) { check_answer($_POST[$q], $a); } Regards, -

[PHP] Manipulating variables

2011-02-23 Thread Ron Piggott
Is there a way to make this syntax: $checking_answer = $answer_reference_2; Equal to: $checking_answer = $answer_reference_ . ($i + 1); (where $i = 1) making $checking_answer take on the value of $answer_reference_2 ? I am trying to develop a web app quiz and I need to test the users answers

[PHP] Re: Large binary objects in MySQL

2011-02-23 Thread Florin Jurcovici
Hi. > Wrong catch? [1] > > Regards, > Tommy No, it wasn't. If you look at where I pass in parameters, I have a $parameter-> value bound as value of the parameter, which is wrong. It should be just $parameter. I corrected my code (after digging for the larger part of a week), and now it's working.

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Steve Staples
es > >> >> either, but on my testing server on IE, it worked as I wanted but not > >> >> on > >> >> anything else. I chopped out most of the code and ended up with this: > >> >> > >> >> if ( isset($_POST['submit']) ) {} e

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
> so when > you're using $_SERVER variables there's no call back to the server, as the > code is still being run on the server at that point. This is something I actually do understand. I was wondering if the code running on the server had to query the server for the information every time a $_S

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Gary
ither, but on my testing server on IE, it worked as I wanted but not >> >> on >> >> anything else. I chopped out most of the code and ended up with this: >> >> >> >> if ( isset($_POST['submit']) ) {} else { >> >> pri

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Steve Staples
ything else. I chopped out most of the code and ended up with this: > >> > >> if ( isset($_POST['submit']) ) {} else { > >> print "\n"; > >> if ($Recordset1) { > >> print "\n"; > >> print "  \n"; > >> pri

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
>    $_SERVER is just a prepopulated superglobal array that is created at > runtime. Thanks for the clear answer. Marc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Daniel P. Brown
On Wed, Feb 23, 2011 at 14:00, Marc Guay wrote: > This question will probably reveal my lacking knowledge of the > fundamentals, but I'm a go for it anyway: > > When you use a $_SERVER variable, is a query made to the server to get > the information or is it just sitting in a variable all ready to

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Gary
e \n"; //2 fields in Counties table, State and >> County >> print " County \n"; >> print "\n"; >> //create table >> $i = 0; >> while ( $row = mysql_fetch_array($Recordset1) ) { >> $i++; >> print "\n"; >> print &q

Re: [PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Shreyas Agasthya
Marc, $_SERVER is an array and it should have all the information. I do not know the answer for the latter part of your query. Regards, Shreyas On Thu, Feb 24, 2011 at 12:30 AM, Marc Guay wrote: > This question will probably reveal my lacking knowledge of the > fundamentals, but I'm a go for i

[PHP] Does requesting $_SERVER variables need to query the server

2011-02-23 Thread Marc Guay
This question will probably reveal my lacking knowledge of the fundamentals, but I'm a go for it anyway: When you use a $_SERVER variable, is a query made to the server to get the information or is it just sitting in a variable all ready to go? Reworded, is there any efficiency gained by storing t

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Gary
e \n"; //2 fields in Counties table, State and >> County >> print " County \n"; >> print "\n"; >> //create table >> $i = 0; >> while ( $row = mysql_fetch_array($Recordset1) ) { >> $i++; >> print "\n"; >> print &q

Re: [PHP] How to write code: how wrong am I?

2011-02-23 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 19:03, Paul M Foster wrote: > Not a bad idea for HTML, not so great for PHP. Some of what you're > trying to solve/avoid can be handled by a decent editor, one that does > syntax highlighting and/or does brace and parenthesis checking. It > doesn't require an expensive IDE.

Re: [PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Jim Lucas
;; //2 fields in Counties table, State and County > print " County \n"; > print "\n"; > //create table > $i = 0; > while ( $row = mysql_fetch_array($Recordset1) ) { > $i++; > print "\n"; > print " value=\"$row[name]\">\n

Re: [PHP] How to write code: how wrong am I?

2011-02-23 Thread Tamara Temple
On Feb 22, 2011, at 5:29 AM, Dotan Cohen wrote: I wrote a short page on how to actually type of code that one writes, it can be found here: http://dotancohen.com/howto/write_code.html The point that I stress on the page is that first you close an element, then you fill it's contents. The page

[PHP] Re: Dynamically Created Checkboxes

2011-02-23 Thread Gary
x27;state_id']}\n"; echo "{$row['name']}\n"; echo "\n"; }//end while print "\n"; } else { echo("Error performing query: " . mysql_error() . ""); } print "\n"; print "\n"; } ?> Again, thank you. Gary __ Information from ESET Smart Security, version of virus signature database 5899 (20110223) __ 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: Dynamically Created Checkboxes

2011-02-23 Thread Pete Ford
This bit? On 22/02/11 22:06, Gary wrote: for($i=1; $i<=$_POST['counties']; $i++) { if ( isset($_POST["county{$i}"] ) ) { You loop over $_POST['counties'] and look for $_POST["county$i"] I suspect that there is no field 'counties' in your form, so the server is complaining about the missing i