AnsweredAssumed Answered

How do you write the PHP code to create a conditional that results in a URL

Question asked by mcarey on Feb 1, 2015
Latest reply on Feb 2, 2015 by Mike_Mitchell

The conditional in my .php file partially reads:

 

<?php

           if($showall_row->getField('pathEmpty_c') == '1') {

                echo 'No Handouts';

           } elseif($showall_row->getField('pathNotEmpty_c') == '1') {

                echo '<a href="<?php echo $showall_row->getField('wrk_handoutPath'); ?>"><strong>HANDOUTS</strong></a>';

           }

?>

 

I can see I'm putting PHP command inside another PHP command and that might be the problem. I thought I should define a variable with a php command but then I have the same problem as the URL is pulling a field to build the url and then I would be placing another PHP command inside a PHP command. Does anyone know how I can do this?  If this is not the proper place to post this question, please let me know.

 

Thanks!

Outcomes