Help new to PHP with HTML and Frontpage - action from Radio button

F

Frank H. Shaw

I need some help I am some what new too this - if someone would give me
little example of code to follow it would help me greatly - I want to use PHP
and enbeded it into my existing HTML code - where I dispay to the user a set
of two radio buttons - I want to determine from the selected radio button
some action being taken this action logic needs to be done further down on
the page. It will be done inside a form that contains hidden input fields.
What I need to understand how do I do some logic statement in PHP to
determine the action and what would this logic might look like. The following
is my radiobuttons HTML code:

<input TYPE="radio" CHECKED NAME="amount" VALUE="20.95"></span><span
style="font-size: 10.0pt; font-family: Trebuchet MS">By each</span></p>

<input TYPE="radio" NAME="amount" VALUE="225.00"></span><span
style="font-size: 10.0pt; font-family: Trebuchet MS">By Dozen</span></p>

Acording to my reading and understanding I change the name of my HTML coded
page in front page to somename.PHP from somename.HTML this tells the server
that enbeded in the HTML page is PHP code. Then in the body inside my HTML
code I would put the following:

<?PHP
LOGIC GOES IN HERE - What would logic look like give me example
please?

?>

Now in the above PHP can I put HTML code below inside it or does it have to
remain outside the PHP code the following HTML code:

The above code needs to have some logic around it depending on which
radiobutton was selected also if it has to be done outside the PHP code then
how is it best to do it and code you give me a little example of how to do it.

Then continue with the rest of the HTML code on web page
 
C

Chris Leeds, MVP-FrontPage

you haven't given enough info as to what you're actually trying to
accomplish.

you are right in that if you change the .htm/.html extension to .php the
server will run it through the php engine which will look for your code.

--
Chris Leeds,
Microsoft MVP-FrontPage

ContentSeed: great tool for web masters,
a fantastic convenience for site owners.
http://contentseed.com/
--
 
F

Frank H. Shaw

I will try to explain in more detail what I am trying to do:

The PHP structure below can it contain only PHP code or can you put both PHP
and HTML - The PHP code that needs to go in the structure needs to be some
type of logic statement like a IF ELSE statement depneding on the radiobutton
selected what would the IF ELSE statement look like captureing the results
from the radio button.

?PHP



?>

Depending on the above answer I will ask one more question around the same
subject and that question is based on if the HTML code can be intermixed with
the PHP code: If it can not then I must ask the question how do I get around
the problem of HTML code outside the PHP structure I must set a flag or label
or something so only out of the 4 lines of HTML code only first two happen or
the last two happen.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top