PHP on IIS using <? ?>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Daryl Rubble

    #1

    PHP on IIS using <? ?>

    I am trying to script a page on my IIS server running PHP, and every time i try to use the <? ?> in the script, it wont load it.


    Normal Page with NO error

    Code:
    <?php
      echo"this is what is working fine but when i close and reopen the php it causes a error";
      
    ?>
    Page With Error
    Code:
    <?php
      echo"this is what is working fine but when i close and reopen the php it causes a error";
     ?>
    <head>
    </head>
    <body>
    <center>this is where it causes the error<br> because i shut the php down using the "?>"</center>
    </body>
    <?
    echo"Now the page wont load couse i used the ?> <?"; 
    ?>

    Any help on this ASAP would be greatly appricated
    Last edited by Dormilich; Oct 8 '10, 05:38 AM.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    When you say it doesn't load the page, do you see just white space? can you look at the page source and see if there's anything is there?

    Do you have PHP error reporting turned on?


    Dan

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      You probably don't have short_open_tag turned on. Use <?php ?> instead.

      Comment

      • dlite922
        Recognized Expert Top Contributor
        • Dec 2007
        • 1586

        #4
        Can't believe I didn't catch that. I've seen better days, I guess.


        Dan

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #5
          Originally posted by Markus
          You probably don't have short_open_tag turned on. Use <?php ?> instead.
          Seconded.

          The <? ... ?> syntax is turned off by default. Best to just forget about it and always use <?php ... ?>.

          Comment

          Working...