I have recently downloaded several scripts that are using some type of syntax that I have not seen before.

An example is <?=$this_script?>

This works ok on my web server but will not work on my localhost. I did a google search and could not find any referance.

I tried <?php $this_script ?> but it still does not work. The code I am trying to use has about 20-30 lines with the strange equal sign...

Thanks for the help JZ

    it is the old, deprecated, style of writing

    <?php echo $this_script ?>

    change it all to the new style!

    you probably also have php opening tags in these old scripts that are just :
    <?

    change them all to <?php

    (they will only run on old installs - get rid of them!)

      Just to expound upon what cretaceous has already pointed out:

      jwzumwalt wrote:

      This works ok on my web server but will not work on my localhost.

      Sounds like you've got a configuration mismatch. As cretaceous suggests, the problem is with your script (and/or localhost) not on your remote web server. The 'short_open_tag' PHP directive should be disabled nowadays.

      This is an excellent example of why your development environment (e.g. localhost) should have the same configuration (or as close as possible) as your production environment (e.g. remote web server).

      jwzumwalt wrote:

      I tried <?php $this_script ?> but it still does not work.

      Actually, it probably did work - it just wasn't what you wanted.

      That code snippet doesn't actually do anything. It's the same as writing:

      <?php
      
      "Hello world";
      
      ?>

      which also won't do anything. However, if you write:

      <?php
      
      echo "Hello world";
      
      ?>

      you will of course see Hello world as the output because you told PHP to actually do something (such as [man]echo[/man] the string).

        Thanks for the help!

        On my local system I got the scripts running by using the following technique

        <?php echo $this_script; ?> vs <?=$this_script?>

          Don't forget to mark this thread resolved using the link on the Thread Tools menu above.

            Write a Reply...