www.webdeveloper.com
Results 1 to 5 of 5

Thread: PHP on IIS using <? ?>

  1. #1
    Join Date
    Oct 2010
    Posts
    2

    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.

    Code:
    Normal Page with NO error
    
    <?php
      echo"this is what is working fine but when i close and reopen the php it causes a error";
      
    ?>
    ----------------------------------
    Page With Error
    
    <?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

  2. #2
    Join Date
    Aug 2006
    Posts
    1,908
    I don't think it has anything to do with "reopening php" for a second time. Your server needs to be configured to use the "<?" syntax instead of "<?php" - have you tried just using "<?php" everywhere?

    Dave

  3. #3
    Join Date
    Oct 2010
    Posts
    2
    yes i have, and it just comes up blank

  4. #4
    Join Date
    Aug 2006
    Posts
    1,908
    Is the above example (the one that doesn't work) exactly what you're testing with? For example the last echo is outside </body>, which probably isn't where you want it, and contains the text "?>" within the quotes of the echo statement, which could be quite exciting for php to parse, etc, etc.

    Otherwise, I don't see it, though I've never used IIS.

    Dave

  5. #5
    Join Date
    Jul 2007
    Location
    Wisconsin
    Posts
    468
    I would check your phpinfo() for short_open_tags. Sounds like that might be dissabled (as i should).

    I think starting with some version of PHP4, it is disabled by default. With short_open_tags turned off, you need to use the full <?php ?> tag set, not the shorthand <? ?> or <?= ?>. It's a safer, more portable method, even if it is an extra 3-7 characters.
    Last edited by OctoberWind; 10-08-2010 at 07:21 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles