PHP newbie question

Hiya... good stuff I've gleaned here... thanks in advance. :)
I'm just getting started in web stuff.... PHP... etc.


Here's what I'm trying to do:

Trying to create an Entry Form


[drop down] for which event you are entering
(prolly use HTML "option" --- cause I know how LOL)

[radio] for one of two types.... TypeA ot TypeB

Depending on [radio] response above, offer 6 classes for each [A thru F]
They can choose MORE than one class (so checkboxes)



Then a bunch more data.... simple stuff...

Name
Address
City
State
ZIP
Phone


etc etc etc


Then I will take all this data and save it to a flat file (a CSV),
and send to a third-party credit card processing site... to a PHP.





The HARD part for me is the "conditional" processing for the [radio]
button. It's driving me crazy.


Thanks!
Mark :)
not [ Mo, 16 April 2007 03:26 ] [ ID #1689110 ]

Re: PHP newbie question

Me :) wrote:

You choice of subject is quite poor, it's better you write a subject that
describes what you are asking, not what you feel you are.


> The HARD part for me is the "conditional" processing for the [radio]
> button. It's driving me crazy.

<form action="apage.php">
<input type="radio" name="group1" value="Milk"> Milk<br>
<input type="radio" name="group1" value="Butter"> Butter<br>
<input type="Submit">
</form>

switch($_REQUEST['group1']) {
case 'Milk':
echo "You like milk!<br>\n";
break;
case 'Butter':
echo "You like butter!!!<br>\n";
break;
default:
echo "You don't like anything<br>\n";
break; //not needed, but a good habbit
}


--

//Aho
Shion [ Mo, 16 April 2007 06:17 ] [ ID #1689112 ]

Re: PHP newbie question

>You choice of subject is quite poor, it's better you write a subject that
>describes what you are asking, not what you feel you are.

Sorry.... point taken.


>> The HARD part for me is the "conditional" processing for the [radio]
>> button. It's driving me crazy.
>
><form action="apage.php">
><input type="radio" name="group1" value="Milk"> Milk<br>
><input type="radio" name="group1" value="Butter"> Butter<br>
><input type="Submit">
></form>
>
>switch($_REQUEST['group1']) {
> case 'Milk':
> echo "You like milk!<br>\n";
> break;
> case 'Butter':
> echo "You like butter!!!<br>\n";
> break;
> default:
> echo "You don't like anything<br>\n";
> break; //not needed, but a good habbit
>}

Thanks for the guidance... but is there anyway to do this WITHOUT
another "Submit" button? Such as when one of the 2 radio buttons
is clicked, THEN move on.

Excellent example above.... Thanks again.
not [ Mo, 16 April 2007 14:00 ] [ ID #1689113 ]

Re: PHP newbie question

"Me :)" <not [at] this.time> wrote in message
news:a6p623pccanbtpp5vgua09cs4fpgg7qqn6 [at] 4ax.com...
> >You choice of subject is quite poor, it's better you write a subject that
> >describes what you are asking, not what you feel you are.
>
> Sorry.... point taken.
>
>
> >> The HARD part for me is the "conditional" processing for the [radio]
> >> button. It's driving me crazy.
> >
> ><form action="apage.php">
> ><input type="radio" name="group1" value="Milk"> Milk<br>
> ><input type="radio" name="group1" value="Butter"> Butter<br>
> ><input type="Submit">
> ></form>
> >
> >switch($_REQUEST['group1']) {
> > case 'Milk':
> > echo "You like milk!<br>\n";
> > break;
> > case 'Butter':
> > echo "You like butter!!!<br>\n";
> > break;
> > default:
> > echo "You don't like anything<br>\n";
> > break; //not needed, but a good habbit
> >}
>
Another submit button? Don't you just hate it when you make a realy nice
submit button and then you just can't remember where you left it. ;)
Vince
Vince Morgan [ Mo, 16 April 2007 17:21 ] [ ID #1689115 ]

Re: PHP newbie question

Me :) wrote:
>> You choice of subject is quite poor, it's better you write a subject that
>> describes what you are asking, not what you feel you are.
>
> Sorry.... point taken.
>
>
>>> The HARD part for me is the "conditional" processing for the [radio]
>>> button. It's driving me crazy.
>> <form action="apage.php">
>> <input type="radio" name="group1" value="Milk"> Milk<br>
>> <input type="radio" name="group1" value="Butter"> Butter<br>
>> <input type="Submit">
>> </form>
>>
>> switch($_REQUEST['group1']) {
>> case 'Milk':
>> echo "You like milk!<br>\n";
>> break;
>> case 'Butter':
>> echo "You like butter!!!<br>\n";
>> break;
>> default:
>> echo "You don't like anything<br>\n";
>> break; //not needed, but a good habbit
>> }
>
> Thanks for the guidance... but is there anyway to do this WITHOUT
> another "Submit" button? Such as when one of the 2 radio buttons
> is clicked, THEN move on.
>
> Excellent example above.... Thanks again.

If you want to do it without submit button, then you need to use javascript,
but this ain't a javascript newsgroup, I think comp.lang.javascript would be
far better group to ask that kind of question.

I prefer to use as little as possible of javascript, as nowadays more and more
users turn that off, which would make the form of yours to fail.

--

//Aho
Shion [ Mo, 16 April 2007 19:15 ] [ ID #1689117 ]
PHP » alt.php » PHP newbie question

Vorheriges Thema: process versus thread
Nächstes Thema: openssl_pkcs7_verify and php