[FX.php List] Which is faster?
Leo R. Lundgren
leo at finalresort.org
Sat Sep 11 15:19:31 MDT 2010
Which, to elaborate, is perfectly valid too (though not the right way to do it). You could've retrieved your values from $_GET instead of $_POST.
11 sep 2010 kl. 23.18 skrev Leo R. Lundgren:
> It's because it requrested the second page via GET rather than POST.
>
> 11 sep 2010 kl. 23.17 skrev Bob Patin:
>
>> The odd thing is that it would go to the 2nd page, but it just didn't submit anything.
>>
>> I guess it was going because I told it the ACTION, and then it didn't know what method to use. You even asked if I had it set to POST, and I'd just looked at it!
>>
>> Good way to waste an hour and your time too...
>>
>> Gotta go, have to go brush my tooth.
>>
>> BP
>>
>>
>> On Sep 11, 2010, at 4:04 PM, Jonathan Schwartz wrote:
>>
>>> Gee. I've NEVER made that mistake. ;-)
>>>
>>> Jonathan Schwartz
>>> Exit 445 Group
>>> 415-370-5011
>>>
>>> On Sep 11, 2010, at 1:59 PM, Bob Patin <bob at patin.com> wrote:
>>>
>>>> I finally found it... so stupid.
>>>>
>>>> Instead of
>>>>
>>>> method="post"
>>>>
>>>> I had
>>>>
>>>> metho="post"
>>>>
>>>> Missed it for the last hour... this is how my days go by with not enough done... sigh...
>>>>
>>>> thanks guys,
>>>>
>>>> Bob
>>>>
>>>>
>>>> On Sep 11, 2010, at 3:49 PM, Leo R. Lundgren wrote:
>>>>
>>>>> Do some systematic back-tracing. IE now that you've concluded that $_POST doesn't contain what you think it should, go one step back in the chain, which is the form submission.
>>>>>
>>>>> You can use FireBug in Firefox to see what is being transmitted, and also investigate the actual form HTML to analyze what might be wrong.
>>>>>
>>>>>
>>>>> 11 sep 2010 kl. 22.38 skrev Bob Patin:
>>>>>
>>>>>> Ok, now I'm really frustrated...
>>>>>>
>>>>>> I put this:
>>>>>>
>>>>>> <input name="recid" type="checkbox" class="bodyTxt" id="service" value="12345" />
>>>>>>
>>>>>> in my form, and then on my 2nd page, put this:
>>>>>>
>>>>>> print_r($_POST);
>>>>>> die;
>>>>>>
>>>>>> I checked 2 boxes...
>>>>>>
>>>>>> and I get
>>>>>>
>>>>>> Array ( )
>>>>>>
>>>>>> What am I missing here...
>>>>>>
>>>>>>
>>>>>> On Sep 11, 2010, at 3:28 PM, Jonathan Schwartz wrote:
>>>>>>
>>>>>>> Also, try adding a dummy checkbook input, entering hard coded Baku instead of variable. Then check the print_r
>>>>>>>
>>>>>>> Jonathan Schwartz
>>>>>>> Exit 445 Group
>>>>>>> 415-370-5011
>>>>>>>
>>>>>>> On Sep 11, 2010, at 1:24 PM, Jonathan Schwartz <jschwartz at exit445.com> wrote:
>>>>>>>
>>>>>>>> Looks ok. Take a look at the source code in your browser. Do to see values inserted for recid?
>>>>>>>>
>>>>>>>> Jonathan Schwartz
>>>>>>>> Exit 445 Group
>>>>>>>> 415-370-5011
>>>>>>>>
>>>>>>>> On Sep 11, 2010, at 1:23 PM, Bob Patin <bob at patin.com> wrote:
>>>>>>>>
>>>>>>>>> Uh... yeah...
>>>>>>>>>
>>>>>>>>> Here's my checkbox code; I suspect it's the issue:
>>>>>>>>>
>>>>>>>>> <input name="recid[<?php echo $recid; ?>]" type="checkbox" class="bodyTxt" id="service" value="<?php echo $recid; ?>" />
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Sep 11, 2010, at 3:21 PM, Jonathan Schwartz wrote:
>>>>>>>>>
>>>>>>>>>> Were there any boxes checked? Checkboxes don't produce a post unless a value is checked.
>>>>>>>>>>
>>>>>>>>>> Jonathan Schwartz
>>>>>>>>>> Exit 445 Group
>>>>>>>>>> 415-370-5011
>>>>>>>>>>
>>>>>>>>>> On Sep 11, 2010, at 1:19 PM, Bob Patin <bob at patin.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> I got this:
>>>>>>>>>>>
>>>>>>>>>>> Array ( )
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> That's it... :)
>>>>>>>>>>>
>>>>>>>>>>> BP
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sep 11, 2010, at 3:17 PM, Leo R. Lundgren wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Huh?
>>>>>>>>>>>>
>>>>>>>>>>>> Can you paste it?
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> 11 sep 2010 kl. 22.15 skrev Bob Patin:
>>>>>>>>>>>>
>>>>>>>>>>>>> Well, I get back an array(), but I can't tell how many elements are in it...
>>>>>>>>>>>>>
>>>>>>>>>>>>> BP
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Sep 11, 2010, at 2:59 PM, Leo R. Lundgren wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Not sure, I haven't used FX much at all.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Start by doing this on the recieving side: print_r($_POST);die();
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> It should output the structure of the submitted data, so you can check whether the data is coming in correctly.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> 11 sep 2010 kl. 21.57 skrev Bob Patin:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> For some reason, I'm getting all records instead of the 3 that I've checked:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> $_POST['recid'] is my checkbox...
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> $query =new FX($serverIP,$webCompanionPort);
>>>>>>>>>>>>>>> $query->SetDBData($dbname_inv,'web');
>>>>>>>>>>>>>>> $query->SetDBPassword($wpw,$un);
>>>>>>>>>>>>>>> $query->SetLogicalOR();
>>>>>>>>>>>>>>> // loop through the recid array and add the query
>>>>>>>>>>>>>>> if(isset($_POST['recid']) && is_array($_POST['recid'])) {
>>>>>>>>>>>>>>> foreach($_POST['recid'] as $recid) {
>>>>>>>>>>>>>>> $query->AddDBParam('recid', $recid);
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>> $queryResult = $query->FMFind();
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> echo $queryResult['foundCount'];
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Where's my error? :)
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> On Sep 11, 2010, at 2:27 PM, Leo R. Lundgren wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> 11 sep 2010 kl. 21.21 skrev Bob Patin:
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> Very cool. I was going to use this:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> <input type="checkbox" name="service<?php echo $counter; ?>">
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> If you do it this way, how are you going to know which posts to query the database for? All you have is a series of numbers not relating to the posts at all (assuming $counter is something that starts at 0 or something and is incremented for each record in page one).
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> but you're right, I could use the RECID instead, like this:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> <input type="checkbox" name="service[<?php echo $recid; ?>]">
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Yeah, and if for some reason you cannot use the recId in the query when doing a composite/multi one, then use your own primary key in the table (a unique integer ID field for example).
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> I'm not familiar with is_array; I assume that it looks at $_POST['service'], which is an array, and the array will only contain elements that are non-empty, is that right? So the unchecked boxes won't build the array?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> No. See php.net/in_array ;)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> -|
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> -|
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> -|
>>>>>>>>>>>>
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>> _______________________________________________
>>>>>>>>>> FX.php_List mailing list
>>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> FX.php_List mailing list
>>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>>> _______________________________________________
>>>>>>>> FX.php_List mailing list
>>>>>>>> FX.php_List at mail.iviking.org
>>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>> _______________________________________________
>>>>>>> FX.php_List mailing list
>>>>>>> FX.php_List at mail.iviking.org
>>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>>
>>>>>> _______________________________________________
>>>>>> FX.php_List mailing list
>>>>>> FX.php_List at mail.iviking.org
>>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>>
>>>>>
>>>>>
>>>>> -|
>>>>>
>>>>> _______________________________________________
>>>>> FX.php_List mailing list
>>>>> FX.php_List at mail.iviking.org
>>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>>>
>>>> _______________________________________________
>>>> FX.php_List mailing list
>>>> FX.php_List at mail.iviking.org
>>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>> _______________________________________________
>>> FX.php_List mailing list
>>> FX.php_List at mail.iviking.org
>>> http://www.iviking.org/mailman/listinfo/fx.php_list
>>
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>
> -|
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
-|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20100911/1b7f2553/attachment-0001.html
More information about the FX.php_List
mailing list