[Nfb-web] is something wrong with this code?

Ryan Mann rmann at blazer.kire.net
Fri Dec 22 09:51:36 CST 2006


Eventually, I was planning to make the .php program generate HTML from a 
text file with a list of questions.  An example text file and my PHP 
program are attached.
Thanks.
Ryan
t

On Thu, 21 Dec 2006, J.J. Meddaugh wrote:

> Hey Ryan. Can you send the data file with what you're trying to do? I'm a
> bit confused by what you're trying to accomplish, and there may be a quicker
> way.
> Thanks.
> J.j.
>
> ----- Original Message -----
> From: "Chris Westbrook" <westbc at clw19.com>
> To: "NFB Webmaster's List" <nfb-web at nfbnet.org>
> Sent: Thursday, December 21, 2006 6:24 PM
> Subject: Re: [Nfb-web] is something wrong with this code?
>
>
>> yOU MIGHT WATN TO DO A PRINT_R($CHOICES) BEFORE THE FOREACH LOOP.  i THINK
>> THAT'S THE RIGHT FUNCTION.  iT PRINTS OUT ALL THE INDEXES AND VALUES OF AN
>> ARRAY SO YOU CAN SEE WHAT THAT VARIABLE CONTAINS.
>> ----- Original Message -----
>> From: "Ryan Mann" <rmann at blazer.kire.net>
>> To: "NFB Webmaster's List" <nfb-web at nfbnet.org>
>> Sent: Thursday, December 21, 2006 6:00 PM
>> Subject: Re: [Nfb-web] is something wrong with this code?
>>
>>
>>>
>>> $Yes.  I'm reading from a text file and $parsestring is the variable that
>>> holds each line of the file.
>>> Ryan
>>>
>>>
>>> On Thu, 21 Dec 2006, Wunder, Gary wrote:
>>>
>>>> Does the following string need a $ before choice?
>>>>
>>>> if(strchr($parsestring,"choice"))
>>>>
>>>> -----Original Message-----
>>>> From: nfb-web-bounces at nfbnet.org [mailto:nfb-web-bounces at nfbnet.org] On
>>>> Behalf Of Ryan Mann
>>>> Sent: Thursday, December 21, 2006 3:18 PM
>>>> To: nfb-web at nfbnet.org
>>>> Subject: [Nfb-web] is something wrong with this code?
>>>>
>>>> Hello.  Can anybody tell me if something is wrong with this code?
>>>> PHP says that there is an invbalid value for foreach.
>>>> Here is the code.
>>>> if(strchr($parsestring,"choice"))
>>>> {
>>>> $choices=array(substr($parsestring,7));
>>>> while(strchr($parsestring,"end of choices")!=0)
>>>> {
>>>> $choicenum=$choicenum+1;
>>>> print $choicenum;
>>>> $choices[$choicenum]=substr($parsestring,7);
>>>> }
>>>> }
>>>> print "Now printing the choices."."<br>";
>>>> foreach($choices as $choicepos)
>>>> {
>>>> print $choicepos."<br>";
>>>> }
>>>>
>>>> The extra print statements are for debuging purposes.
>>>> Thanks for your help.
>>>> Ryan
>>>>
>>>> _______________________________________________
>>>> Nfb-web mailing list
>>>> Nfb-web at nfbnet.org
>>>> http://www.nfbnet.org/mailman/listinfo/nfb-web
>>>> _______________________________________________
>>>> Nfb-web mailing list
>>>> Nfb-web at nfbnet.org
>>>> http://www.nfbnet.org/mailman/listinfo/nfb-web
>>>>
>>> _______________________________________________
>>> Nfb-web mailing list
>>> Nfb-web at nfbnet.org
>>> http://www.nfbnet.org/mailman/listinfo/nfb-web
>>>
>>> __________ NOD32 1934 (20061221) Information __________
>>>
>>> This message was checked by NOD32 antivirus system.
>>> http://www.eset.com
>>>
>>>
>>
>> _______________________________________________
>> Nfb-web mailing list
>> Nfb-web at nfbnet.org
>> http://www.nfbnet.org/mailman/listinfo/nfb-web
>>
>>
>
> _______________________________________________
> Nfb-web mailing list
> Nfb-web at nfbnet.org
> http://www.nfbnet.org/mailman/listinfo/nfb-web
>
-------------- next part --------------
question For years, Psychologists have known about Clasical Conditioning.  However, there is another type of conditioning.  What is this called?

choice pretend conditioning

choice Operant Conditioning

choice no conditioning

end of choices

answer Operant Conditioning

question John has little verbal skills and throws fits when his routine changes.  What disorder would he probably be diagnosed with?

answer Autism

question Mary has average berbal skills.  She is obsessed with an electrical meter near her elementary school playground and doesn't seem to be interested in the other children.  What disorder would she be diagnosed with?

choice Autism with verbal features

choice Aspurgers

end of choices

answer Aspurgers

score

-------------- next part --------------
A non-text attachment was scrubbed...
Name: generate.php
Type: application/x-httpd-php
Size: 769 bytes
Desc: 
Url : http://www.nfbnet.org/pipermail/nfb-web/attachments/20061222/a9acc165/attachment.bin 


More information about the Nfb-web mailing list