Jump to content


Photo

Echo Problem


  • Please log in to reply
3 replies to this topic

#1 superhoops

superhoops
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 September 2006 - 11:49 AM

I have a couple of variables and im trying to echo them into my table. Most of is html but i have added the php info where i want it.

Here is the code:

<html>

<head>
<meta http-equiv="Content-Language" content="en-gb">
<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>Welcome to FMProtasy</title>
</head>

<body>

<table border="0" bgcolor="#FF8C00" width="100%" 

cellpadding="10">
<tr>

<td width="100%" valign="top" style="border-style: 

solid; border-width: 2">
<p align="left"><b><font face="Arial" 

size="2">Tottenham</font></b></td>

</tr>
</table>

<table border="0" bgcolor="#FF8C00" width="100%" 

cellpadding="10" height="15">
<tr>

<td width="100%" valign="top" height="1" style="border-

style: solid; border-width: 2">

<p align="center">
<img border="0" src="tot.gif" width="155" height="183" 

align="left"></p>
<table border="0" width="67%" id="table1">
	<tr>
		<td width="163" align="center" 

bgcolor="#FFFFFF">
		<font face="Arial" size="2">Team 

Name:</font></td>
		<td align="center" 

bgcolor="#FFFFFF"><font face="Arial" 

size="2">Tottenham</font></td>
	</tr>
	<tr>
		<td width="163" align="center" 

bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">Manager:</font></td>
		<td align="center" bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">Peter Jobes</font></td>
	</tr>
	<tr>
		<td width="163" align="center" 

bgcolor="#FFFFFF">
		<font face="Arial" 

size="2">Squad:</font></td>
		<td align="center" 

bgcolor="#FFFFFF"><b><font face="Arial" size="2">
		<a href="Sprs.txt"><span style="text-

decoration: none">
		<font 

color="#000000">Squad</font></span></a></font></b></td>
	</tr>
	<tr>
		<td width="163" align="center" 

height="20" bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">Division:</font></td>
		<td align="center" height="20" 

bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">Premiership</font></td>
	</tr>
	<tr>
		<td width="163" align="center" 

bgcolor="#FFFFFF">
		<font face="Arial" size="2">Stadium 

Name:</font></td>
		<td align="center" 

bgcolor="#FFFFFF"><font face="Arial" size="2">
		White Hart Lane Stadium</font></td>
	</tr>
	<tr>
		<td width="163" align="left" 

bgcolor="#000000">
		<p align="center"><font face="Arial" 

size="2" color="#FFFFFF">Stadium Capacity:</font></td>
		<td align="center" bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">20,000</font></td>
	</tr>
	<tr>
		<td width="163" align="left" 

bgcolor="#FFFFFF">
		<p align="center"><font face="Arial" 

size="2">Home Fan Base:</font></td>
		<td align="center" 

bgcolor="#FFFFFF"><font face="Arial" 

size="2">13,000</font></td>
	</tr>
	<tr>
		<td width="163" align="left" 

bgcolor="#000000">
		<p align="center"><font face="Arial" 

size="2" color="#FFFFFF">Away Fan Base:</font></td>
		<td align="center" bgcolor="#000000">
		<font face="Arial" size="2" 

color="#FFFFFF">4,000</font></td>
	</tr>
[color=red]<?php
include = code.php
$val = 10 - $week;
	echo '<tr>';
		echo '<td width="163" align="left" 

bgcolor="#FFFFFF">
		<p align="center"><font face="Arial" 

size="2">Training Facilities:</font></td>
		<td align="center" 

bgcolor="#FFFFFF"><font face="Arial" size="2">Italio 
        o Flabio - '.$val.' weeks left</font></td>';

	echo '</tr>';
?>[/color]
</table>
</td>
</tr>
</table>

The red font is the php part.

This is the error message displayed:

Parse error: syntax error, unexpected '=' in /home/www/fmprotasy.com/Teams1/Prem/totmain.php on line 78

Im sure ive made an obvious mistake as i am a no but any help would be much appreictaed.

#2 annihilate

annihilate
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts
  • LocationUK

Posted 03 September 2006 - 11:55 AM

Look up how to use include statements.  You don't use an equals sign on it.
include('code.php');

Personal site: NewEnigma  |  Java and JSF Discussion

#3 superhoops

superhoops
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 September 2006 - 11:58 AM

Thanks, hat is very starneg as a chatroom i have uses include = blah.php. Thanks

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 September 2006 - 12:01 PM

This:
include = code.php


is supposed to be this:
include 'code.php';

You cannot use include with an equal sign. As it isn't the the correct syntax. The include synx is either of the following:
include("filename.php");
include "filename.php";
include 'filename.php';





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users