<td><input type="text" name="c1" value=" <?php if($p_id!="")echo $a? else echo $p_name>" ></td>

Recommended Answers

All 2 Replies

Change the above code to this

<td><input type="text" name="c1" value=" <?php if($p_id!="")echo $a; else echo $p_name; ?>" ></td>
commented: Great answer +12

Alternatively I think what the op was trying to accomplish but does the exact same thing is as follows:

<td><input type="text" name="c1" value="<?php echo ($p_id!="")?$a:$p_name; ?>"></td>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.