[Solved] Add syntax into if statement in PHP [closed]


Is this what you are after? If not, please clarify your requirements and correct the syntax errors in your question.

<?php if($_COOKIE["size"]>800) {
    echo '<script>var iqmal = true;</script>';
    if ($wa[custom_132] == "1") {
        echo '
            <a href="#" class="previous hidden-xs" style="visibility: visible;"></a>
            <a href="#" class="next hidden-xs" style="visibility: visible;"></a>
        ';
    }
?>

<script>
$(function () {
    "use strict";
    if( iqmal ) {
        $('#first_container').vegas({
            color: '<?php echo $wa[custom_79];?>',
            delay: <?php echo $wa[custom_80];?>,
            transitionDuration: <?php echo $wa[custom_133];?>,
            timer: false,
            transition: null,
            slides: [
                <?php if ($wa[custom_82] != "" && $wa[custom_83] == "1") { $wa[custom_82] = str_replace(' ', '%20', $wa[custom_82]);?>
                    {src: '<?php echo $wa[custom_82];?>'},
                <?php }
                if ($wa[custom_84] != "" && $wa[custom_85] == "1") { $wa[custom_84] = str_replace(' ', '%20', $wa[custom_84]);?>
                    {src: '<?php echo $wa[custom_84];?>'},
                <?php }
                if ($wa[custom_86] != "" && $wa[custom_87] == "1") { $wa[custom_87] = str_replace(' ', '%20', $wa[custom_87]);?>
                    {src: '<?php echo $wa[custom_86];?>'},
                <?php }
                if ($wa[custom_88] != "" && $wa[custom_89] == "1") { $wa[custom_89] = str_replace(' ', '%20', $wa[custom_89]);?>
                    {src: '<?php echo $wa[custom_88];?>'},
                <?php }
                if ($wa[custom_90] != "" && $wa[custom_91] == "1") { $wa[custom_91] = str_replace(' ', '%20', $wa[custom_91]);?>
                    {src: '<?php echo $wa[custom_90]?>'},
                <?php } 
                if ($wa[custom_92] != "" && $wa[custom_93] == "1") { $wa[custom_93] = str_replace(' ', '%20', $wa[custom_93]);?>
                    {src: '<?php echo $wa[custom_92]?>'},
                <?php }
                if ($wa[custom_94] != "" && $wa[custom_95] == "1") { $wa[custom_95] = str_replace(' ', '%20', $wa[custom_95]);?>
                    {src: '<?php echo $wa[custom_94];?>'},
                <?php } 
                ?>
                <? if ($wa[custom_94] != "" && $wa[custom_95] == "1") { $wa[custom_95] = str_replace(' ', '%20', $wa[custom_95]);?>
                    {src:'images/1-Hov-Lean-1800px-X600px.jpg'},
                <? } ?>
                <? if ($wa[custom_96] != "" && $wa[custom_95] == "1") { $wa[custom_95] = str_replace(' ', '%20', $wa[custom_95]);?>
                    {src:'images/1-Angkor-1800px-X-600px.jpg'},
                <? } ?>
                <? if ($wa[custom_98] != "" && $wa[custom_95] == "1") { $wa[custom_97] = str_replace(' ', '%20', $wa[custom_97]);?>
                    {src:'images/Home-Pages-Angkor-PC.png'},
                <? } ?>
                {src:'images/Home-Pages-Peakbond.png'}
            ]
        });
    }
});
</script>

More info here: http://php.net/manual/en/control-structures.if.php (esp. see comment #1)

3

solved Add syntax into if statement in PHP [closed]