lshane
asked on
PHP: Syntax for IF THEN statement to display a form field
Hello. I know very little about PHP. I primarily use ASP. I am, however, having to alter a portion of code on a PHP page.
I need to have an IF THEN statement to display a form field ("Lyme").
The conditional statement is on an "Order Confirmation" page. There is a form on the "Order" page named "Lyme". On the "Order Confirmation" page, I would like to basically say:
IF {formfieldfrom ORDER page} is equal to "Y" THEN
Display a paragraph of text
ELSE
Do not display anything
How can I do this?
Thanks so much,
Shane
I need to have an IF THEN statement to display a form field ("Lyme").
The conditional statement is on an "Order Confirmation" page. There is a form on the "Order" page named "Lyme". On the "Order Confirmation" page, I would like to basically say:
IF {formfieldfrom ORDER page} is equal to "Y" THEN
Display a paragraph of text
ELSE
Do not display anything
How can I do this?
Thanks so much,
Shane
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
One other quick question, please:
Do I need to place delimiters around that code? (i.e. <?......?> OR <? PHP..... ?> etc.)
Do I need to place delimiters around that code? (i.e. <?......?> OR <? PHP..... ?> etc.)
yes, as that is PHP code.
you should prefer the <?PHP ?> version, as the <? shorttags version is not supported (configured) on all web hostings...
you should prefer the <?PHP ?> version, as the <? shorttags version is not supported (configured) on all web hostings...
ASKER
Thanks SO much!
ASKER
I'll give it a try shortly, but it seems very straightforward.
Thanks again,
Shane