SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: simple error

  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    simple error

    I have a php page with just a few lines of php in a lot of html. When I run the page it gives me this error:

    Parse error: parse error in /var/www/html/sandburg/test/home.php on line 1

    It gives me that error even if I delete all the php out of the page. if i rename to htm then it works fine without php
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Despite the usual posts *not* to post a whole lot of code, can you show us the entire snippet?
    My name is Steve, and I'm a super-villian.

  3. #3
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <?xml version='1.0' encoding='ISO-8859-1'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="style.css" /> 
    
    
    <script language="JavaScript">
    <!--
    function mmLoadMenus() {
      if (window.mm_menu_0820221005_0) return;
      window.mm_menu_0820221005_0 = new Menu("root",153,17,"Verdana, Arial, Helvetica, 
    
    sans-serif",11,"#666666","#ffcc33","#cccccc","#666666","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
      
    
    mm_menu_0820221005_0.addMenuItem("Computer&nbsp;Lab","location='http://www.aux.uwm.edu/sandburg/oncampus/computerlab/computer
    
    lab.php'");
      
    
    mm_menu_0820221005_0.addMenuItem("Fitness&nbsp;Center","location='http://www.aux.uwm.edu/sandburg/oncampus/greenroom/greenroo
    
    m.php'");
      mm_menu_0820221005_0.addMenuItem("Channel","location='http://www.aux.uwm.edu/sandburg/oncampus/channel/channel.php'");
      mm_menu_0820221005_0.addMenuItem("Flicks","location='http://www.aux.uwm.edu/sandburg/oncampus/flicks/flicks.php'");
      
    
    mm_menu_0820221005_0.addMenuItem("Sandburg&nbsp;Cable&nbsp;Network","location='http://www.aux.uwm.edu/sandburg/oncampus/scn/s
    
    cn.php'");
      
    
    mm_menu_0820221005_0.addMenuItem("Programming","location='http://www.aux.uwm.edu/sandburg/oncampus/programming/programming.ph
    
    p'");
      
    
    mm_menu_0820221005_0.addMenuItem("S.H.A.C.&nbsp;(Student&nbsp;Govt.)","location='http://www.aux.uwm.edu/sandburg/oncampus/sha
    
    c/shac.php'");
      mm_menu_0820221005_0.addMenuItem("Emporium","location='http://www.aux.uwm.edu/sandburg/oncampus/emporium/emporium.php'");
      
    
    mm_menu_0820221005_0.addMenuItem("Employment","location='http://www.aux.uwm.edu/sandburg/oncampus/employment/employment.php'"
    
    );
       mm_menu_0820221005_0.hideOnMouseOut=true;
       mm_menu_0820221005_0.menuBorder=1;
       mm_menu_0820221005_0.menuLiteBgColor='#cccccc';
       mm_menu_0820221005_0.menuBorderBgColor='#666666';
       mm_menu_0820221005_0.bgColor='#cccccc';
      window.mm_menu_0820220440_0 = new Menu("root",135,17,"Verdana, Arial, Helvetica, 
    
    sans-serif",11,"#666666","#ffcc33","#cccccc","#666666","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
      
    
    mm_menu_0820220440_0.addMenuItem("Towers&nbsp;(N,S,W)","location='http://www.aux.uwm.edu/sandburg/facility/towers/towers.php'
    
    ");
      
    
    mm_menu_0820220440_0.addMenuItem("Houses&nbsp;(N,S,W)","location='http://www.aux.uwm.edu/sandburg/facility/houses/houses.php'
    
    ");
      
    
    mm_menu_0820220440_0.addMenuItem("Room&nbsp;Info","location='http://www.aux.uwm.edu/sandburg/facility/roominfo/roominfo.php'"
    
    );
      
    
    mm_menu_0820220440_0.addMenuItem("Suites&nbsp;and&nbsp;Rooms","location='http://www.aux.uwm.edu/sandburg/facility/suites/suit
    
    es.php'");
      
    
    mm_menu_0820220440_0.addMenuItem("East&nbsp;Tower","location='http://www.aux.uwm.edu/sandburg/facility/suites/east/east.php'"
    
    );
      
    
    mm_menu_0820220440_0.addMenuItem("Special&nbsp;Living&nbsp;Options","location='http://www.aux.uwm.edu/sandburg/facility/speci
    
    al/special.php'");
      mm_menu_0820220440_0.addMenuItem("Purin&nbsp;Hall","location='http://www.aux.uwm.edu/sandburg/facility/purin/purin.php'");
      mm_menu_0820220440_0.addMenuItem("Main&nbsp;Desk","location='http://www.aux.uwm.edu/sandburg/facility/mndesk/mndesk.php'");
      mm_menu_0820220440_0.addMenuItem("Mail","location='http://www.aux.uwm.edu/sandburg/facility/mail/mail.php'");
      
    
    mm_menu_0820220440_0.addMenuItem("Telephone","location='http://www.aux.uwm.edu/sandburg/facility/telephone/telephone.php'");
      mm_menu_0820220440_0.addMenuItem("Laundry","location='http://www.aux.uwm.edu/sandburg/facility/security/security.php'");
      mm_menu_0820220440_0.addMenuItem("Parking","location='http://www.aux.uwm.edu/sandburg/facility/parking/parking.php'");
       mm_menu_0820220440_0.hideOnMouseOut=true;
       mm_menu_0820220440_0.menuBorder=1;
       mm_menu_0820220440_0.menuLiteBgColor='#cccccc';
       mm_menu_0820220440_0.menuBorderBgColor='#666666';
       mm_menu_0820220440_0.bgColor='#cccccc';
      window.mm_menu_0820213231_0 = new Menu("root",141,17,"Verdana, Arial, Helvetica, 
    
    sans-serif",11,"#666666","#ffcc33","#cccccc","#666666","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
      
    
    mm_menu_0820213231_0.addMenuItem("Sandburg&nbsp;Experience","location='http://www.aux.uwm.edu/sandburg/contract/experience/ex
    
    perience.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Application&nbsp;Process","location='http://www.aux.uwm.edu/sandburg/contract/application/a
    
    pplication.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Application&nbsp;for&nbsp;Housing","location='http://www.aux.uwm.edu/sandburg/contract/hous
    
    ing/housing.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Housing&nbsp;Contract","location='http://www.aux.uwm.edu/sandburg/contract/uh_contract/uh_c
    
    ontract.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Rules&nbsp;and&nbsp;Regulations","location='http://www.aux.uwm.edu/sandburg/contract/rules/
    
    rules.php'");
      mm_menu_0820213231_0.addMenuItem("Costs","location='http://www.aux.uwm.edu/sandburg/contract/costs/costs.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Computer&nbsp;Connections","location='http://www.aux.uwm.edu/sandburg/contract/computer/com
    
    puter.php'");
      
    
    mm_menu_0820213231_0.addMenuItem("Guest&nbsp;Policy","location='http://www.aux.uwm.edu/sandburg/contract/guests/guests.php'")
    
    ;
      
    
    mm_menu_0820213231_0.addMenuItem("Summer&nbsp;Housing","location='http://www.aux.uwm.edu/sandburg/contract/summer/summer.php'
    
    ");
      
    
    mm_menu_0820213231_0.addMenuItem("For&nbsp;More&nbsp;Information","location='http://www.aux.uwm.edu/sandburg/contract/info/in
    
    fo.php'");
       mm_menu_0820213231_0.hideOnMouseOut=true;
       mm_menu_0820213231_0.menuBorder=1;
       mm_menu_0820213231_0.menuLiteBgColor='#cccccc';
       mm_menu_0820213231_0.menuBorderBgColor='#666666';
       mm_menu_0820213231_0.bgColor='#cccccc';
    
      mm_menu_0820213231_0.writeMenus();
    } // mmLoadMenus()
    
    //-->
    </script>
    <script language="JavaScript1.2" src="mm_menu.js"></script>
    </head>
    <body>
    <script language="JavaScript1.2">mmLoadMenus();</script>
    
    <div id="topbar">
    <img name="topbar" src="images/topbar.gif" width="800" height="109" border="0" usemap="#m_topbar" alt="" /><map 
    
    name="m_topbar" id="m_topbar">
    <area shape="rect" coords="469,83,572,104" href="#" alt="" onmouseout="MM_startTimeout();"  
    
    onmouseover="MM_showMenu(window.mm_menu_0820221005_0,469,101,null,'topbar');"  />
    <area shape="rect" coords="358,82,463,105" href="#" alt="" onmouseout="MM_startTimeout();"  
    
    onmouseover="MM_showMenu(window.mm_menu_0820220440_0,353,100,null,'topbar');"  />
    
    <area shape="rect" coords="274,79,352,105" href="#" alt="" onmouseout="MM_startTimeout();"  
    
    onmouseover="MM_showMenu(window.mm_menu_0820213231_0,275,101,null,'topbar');"  />
    </map>
    </div>
    <div id="recentnews"><img src="images/recentnews.gif" alt="" /></div>
    
    <div id="leftnewsbar">
    <img src="images/leftnewsbar.gif" alt="" />
    </div>
    
    <div id="bottomnewsbar">
    <img src="images/bottomnewsbar.gif" alt="" />
     </div>
    
    <div id="rightnewsbar">
    <img src="images/rightnewsbar.gif" alt="" /></div>
    
    <div id="newsbox"> 
    
    <?php
    
    require_once("news.php");
    
    ?>
    
    </div>
    
    <div id="announce">
    <img src="images/announce.gif" alt="" /></div>
    <?php
    
    require_once("announcements.php");
    
    ?>
    <div id="announcebox">	
    
    </div>
    
    <div id="photos">  <img src="images/photos.gif" alt="" /></div>
    
    <div id="welcome"> 
    
    <h2>University Housing</h2>
    University Housing provides your "home away from home" while
    you attend University of Wisconsin-Milwaukee. You will find our
    suites unique compared to many colleges and universities.
    Come inside and see what we have to offer!
    <p></p>
    <strong>Download 
              Contract Information<br />
              </strong><a href="http://www.aux.uwm.edu/sandburg/contract/uh_contract/contract%20book%202002.pdf" 
    
    target="_blank">Contract 
              Book PDF</a><br />
    
              <a href="http://www.aux.uwm.edu/sandburg/contract/uh_contract/cancellation%20form.pdf" target="_blank">Cancellation 
              Form</a><br />
              <a href="http://www.aux.uwm.edu/sandburg/contract/rules/rules&regs.pdf" target="_blank">Rules 
              and Regulations PDF</a><br /><br />
              <a href="http://www.adobe.com/products/acrobat/readstep.php"><img 
    
    src="http://www.aux.uwm.edu/sandburg/images/getacro.gif" alt="" width="88" height="31" border="0" /></a>
            <p></p><strong>Apply 
              On Line<br />
              </strong><a href="http://www.aux.uwm.edu/sandburg/contract/housing/housing.php">Housing 
              Application</a>
    
    
    </div>
    
    <div id="copyright">
    <table border="0" cellspacing="6"><tr><td valign="top" width="50%">
    UWM University Housing Sandburg Halls<br />
    3400 N. Maryland Avenue Milwaukee, WI 53211-2953<br />
    1-800-622-0286 (414) 229-4065 Fax: (414) 229-4127<br />
    </td><td width="10%"></td>
    <td width="30%" valign="top">
    Site maintained by ldt@uwm.edu<br />
    Last updated: August 21, 2003
    </td></tr></table>
    </div>
    
    </body>
    </html>
    The only php I have is two require_once() functions
    Free Science Homework Help
    http://www.physicsforums.com

  4. #4
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    NJ/NY
    Posts
    346
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remove your xml info.

    ie. <?xml..... ?>

  5. #5
    SitePoint Zealot rae's Avatar
    Join Date
    Apr 2003
    Location
    bedroom :P
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dtang4
    Remove your xml info.

    ie. <?xml..... ?>
    Yep, the "<?" is called short tag. Normally if you write php code you use <?php as the starting tag.

    you can set to enable or disable short tags in php.ini
    search for the line
    "short_open_tag = "

    and there is also some info about that in the php.ini
    Allow the <? tag. Otherwise, only <?php and <script> tags are recognized. NOTE: Using short tags should be avoided when developing applications or
    libraries that are meant for redistribution, or deployment on PHP servers which are not under your control, because short tags may not be supported on the target server. For portable, redistributable code, be sure not to use short tags.

  6. #6
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dtang4
    Remove your xml info.

    ie. <?xml..... ?>


    Also, the <?xml ... ?> isn't strictly required in *any* XML document, so it's safe & legal to remove it.
    My name is Steve, and I'm a super-villian.

  7. #7
    SitePoint Zealot rae's Avatar
    Join Date
    Apr 2003
    Location
    bedroom :P
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm... it's not required? good to hear that how did you know?

  8. #8
    La la la la la bronze trophy lieut_data's Avatar
    Join Date
    Jun 2003
    Location
    Waterloo, ON
    Posts
    1,517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rae
    hmm... it's not required? good to hear that how did you know?
    [Searches] -- ahh, yes picked it up here

    That thread also mentions that <?xml ... ?> forces IE6 into quirks mode, often an undesirable effect.
    My name is Steve, and I'm a super-villian.

  9. #9
    SitePoint Zealot rae's Avatar
    Join Date
    Apr 2003
    Location
    bedroom :P
    Posts
    157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lieut_data
    <?xml ... ?> forces IE6 into quirks mode, often an undesirable effect. [img]images/smilies/biggrin.gif[/img]
    Thx for the info!

    I hope Mozilla and XML are better friends

  10. #10
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very interesting, thanks guys!
    Free Science Homework Help
    http://www.physicsforums.com


Bookmarks

Posting Permissions

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