Jump to content

Got problems with Include file


todayme

Recommended Posts

What is wrong with this below the php below?  Is this how you include files?  Your help is appreciated, I am going out tomorrow to get some books on php

 

 

<?

 

<php include("connectorexit.php"); ?>

<html>

<head>

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>New Page 9</title>

</head>

 

<body>

 

<div align="center">

  <center>

  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" id="AutoNumber1" height="517">

    <tr>

      <td width="100%" height="143"> </td>

    </tr>

    <tr>

      <td width="100%" height="22"> </td>

    </tr>

    <tr>

      <td width="100%" height="494"><br>

     

      <php include("userdetail.php"); ?>

      <php include("writeleads.php"); ?>

      <br>

   

 </td>

    </tr>

  </table>

  </center>

</div>

 

</body>

 

</html>

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/40942-got-problems-with-include-file/
Share on other sites

No, you have an incorrect string "<php". The correct method is:

<?php
include("connectorexit.php");
?>

 

Ken

 

good to know! so, to make sure i understand this correctly, if you include the php tags on the same line, if it isn't a string, then the php won't be processed properly? does it return an error?

Parse error: syntax error, unexpected '<' in /home/admin/domains/sold.au.com/public_html/test8.php on line 2

 

I am getting this error above, with the code below the files that are being embeeded are all PHP CODE not HTML can I do this?  Or do I have an error in the code below?

 

 

 

 

<?

<?php

include("connectorexit.php");

?>

<html>

<head>

<meta name="GENERATOR" content="Microsoft FrontPage 5.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<title>New Page 9</title>

</head>

 

<body>

 

<div align="center">

  <center>

  <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="700" id="AutoNumber1" height="517">

    <tr>

      <td width="100%" height="143"> </td>

    </tr>

    <tr>

      <td width="100%" height="22"> </td>

    </tr>

    <tr>

      <td width="100%" height="494"><br>

      <?php

      include("userdetail.php");

      ?>

      <?php

      include("writeleads.php");

      ?>

      <br>

   

 </td>

    </tr>

  </table>

  </center>

</div>

 

</body>

 

</html>

 

?>

 

If you look at the code right above not the first one I posted I changed it ..........it still had a problem so I removed <?  and ?>  from the first and last line of the document and it worked............now its reporting errors in the embedded files which when they are all put together in one file work fine.grrrrrrrrrrrrrrrrrrr

 

Was I correct to remove <? and ?> from the first and line of the page above?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.