1,940 pts.
 How can I add an IF statement to a .php file
Hi everyone, I have a form that has 6 fields to be filled in by the user. I’m not too good at editing .php files, so I come to you here. Here’s my problem. Fields 1, 2,3,4 and 6 always gets filled in. but sometimes, field 5 will get filled in and if this is the case I need an IF /else statement saying that if field 5 gets filled in then Show fields 5,2,3,4 and 6 as well as Fields 1, 2,3,4 and 6 on the email back to user. I hope this makes sense. Please help. Thank you.

Software/Hardware used:
XP
ASKED: November 12, 2009  8:28 PM
UPDATED: November 14, 2009  2:09 AM

Answer Wiki:
<pre>if (<condition>) { <code>; } else { <code>; }</pre>
Last Wiki Answer Submitted:  November 14, 2009  12:16 am  by  mshen   27,310 pts.
All Answer Wiki Contributors:  mshen   27,310 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I’m trying to do as you say but keep getting
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/kurt/public_html/forms/bdf/ins_4_pickingupgift.php on line 237
I’m a noob when it comes to .php I’m wanting the letter going to the user to always show
fields 1,2,3,,4,6 but is field 5 is filled in then it needs to show also that fields 5,2,3,4,6
so fields 1,2,3,4,6 are always sent back to the user, and if on if 5 gets filled in the user’s email would show both 1,2,3,4,6, and 5,2,3,4,6 can you explain a bit more. thank you for your trying.

 1,940 pts.

 

I guess the condition would be if field5 was <> “” then email to user = fields 5,2,3.4,6 as well as fields 1,2,3,4,6 I guess, but how do I write that in .php

 1,940 pts.