Welcome Guest, Not a member yet? Register   Sign In
running a script in a php module
#11

In that case I don't know why it's not loading.

Do other assets like CSS and JS load properly? Where are those located?
Reply
#12

I managed to solve this. Turns out that one of my paths was missing a space, and that was the one that I was hod coding for testing. I got this working. Now I need to use this same logic to modify the menus for the different versions (or perhaps grey out some choices?)
proof that an old dog can learn new tricks
Reply
#13

(This post was last modified: 02-03-2021, 01:19 PM by richb201.)

I am trying to do something similar here but am having trouble with the <script></script> section.
 

PHP Code:
               <?php
                 $type
=$this->session->userdata('type');   //type of campaign (ir software, pharma, etc)
                 if ($type==2)  //this is for software
                        {
                       <script>
                       li ><a href '<?php echo site_url('Configure IUS_management')?>' IUS</></li >
                       </script>
                        }
                ?>
proof that an old dog can learn new tricks
Reply
#14

Why are you inserting <script> tags? They're only for Javascript.
Reply
#15

(This post was last modified: 02-03-2021, 01:24 PM by richb201.)

How do I tell it that this next line is not php (ie li)? I switched over to:

$type=$this->session->userdata('type');  //type of campaign (ir software, pharma, etc)
if ($type==2//this is for software
      {
      echo "li ><a href = '<?php echo site_url('Configure / IUS_management')?>' > IUS</a ></li >";
      }


But that is not working. 
proof that an old dog can learn new tricks
Reply
#16

Either end the PHP parsing with '?>', or you can use echo to output the HTML tags and stay in PHP:

PHP Code:
$url site_url('Configure / IUS_management');
echo 
"<li><a href='{$url}'>IUS</a></li>"
Reply
#17

Works. Thanks.
proof that an old dog can learn new tricks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB