Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Error on blank line

Hello all,

I am getting a error message that says"Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\shirts4mike\contact.php on line 73"

<tr> <th> <label for="message">message</label> </th> <td> <textarea name="message" id="message"></textarea

          </td>
          </tr>



          </table>
          <input type="submit" value="Send" />


           </form>


            </div>
            <?php
             include('includes/footer.php');
             <?

I don't have anything on the line it says the error is on. What I am I doing wrong?

Thanks, Shannon

4 Answers

if your code is <?php include('includes/footer.php'); <? the <? is wrong so try ?>

Thanks I did fix my <? but It is still giving me the same error message.

Okay so now the error message says "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\shirts4mike\contact.php on line 75" This is after I fixed my tag error.

can you post the updated code?

Good idea here you go.

<tr> <th> <label for="email">Email</label> </th> <td> <input type="text" name="email" id="email"> </td> </tr>

          <tr>
          <th>
          <label for="message">message</label>
          </th>
          <td>
          <textarea name="message" id="message"></textarea

          </td>
          </tr>



          </table>
          <input type="submit" value="Send" />


           </form>


            </div>
            <?php
             include('includes/footer.php');
             ?>

only thing i see that wrong is the </textarea isn't closed </textarea>. If that doesn't work id start looking towards the include argument. Is includes the right folder is footer.php the right file and if so is the code that your trying to include correct because that might be where the "invisible" line 75 is coming from.

If it was an error in the include file that would be reported for example parse error in footer.php and the line in that file would be referenced, without this it would be very difficult to debug large applications.

I would suggest looking higher in your script, if there is nothing on the line the error is reported on that would suggest to me something earlier in the code was incorrect. Happy hunting!