template

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
egoo
-


Joined: 22 Jan 2008
Posts: 16

PostPosted: Sat Mar 15, 2008 2:08 pm    Post subject: template Reply with quote

I have a problem with compilation. It gives me an error. I 've got Php Designer 2007 ver. 5.4.

template.tpl :

<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="author" content="TEAM ViRiLiTY">

<title><?php echo $tpl['title'];?></title>
</head>

<body>
<h1><?php $echo $tpl['title'];?></h1>
<p>
<?php echo $tpl['description']; ?>
</p>
<?php echo $tpl['content'];?>

</body>
</html>



list_parts.tpl.php:

<?php

/**
* @author TEAM ViRiLiTY
* @copyright 2008
*/

$header = <<<END
<table>
<tr> <th> Name<th><th>City</th></tr>
END;
$footer = <<<END
</table>
END;

$item = "<tr><td>{name}</td><td>{city}</th>";
?>



show_names.php:

<?php

/**default :
* @author TEAM ViRiLiTY
* @copyright 2008
*/

include 'list_parts.tpl.php';// here is the error
$list = array('Andy'=>'Tel Aviv','Derick'=>'London','Stig'=>'Trodheim');
$items ='';
foreach ($list as $name =>$city) {
$items .= str_replace(
array('{name}','{city}'),
array($name,$city),$item);
}
$tpl = array();
$tpl['title']= "List wiith names";
$tpl['Description']= "This list shows names and the cities.";
$tpl['content']= $header.$items.$footer;

include 'template.tpl';
?>

When there are compilation an error is appeared: Parse error:syntax error,Unexpected T_SL in C:\Users\owner\Documents\Architecture\list_parts.tpl.php


Last edited by egoo on Tue Mar 18, 2008 9:37 pm; edited 2 times in total
Back to top View user's profile Send private message
pkSML
-


Joined: 29 May 2006
Posts: 952
Location: Michigan, USA

PostPosted: Sun Mar 16, 2008 7:25 pm    Post subject: Reply with quote

Quote:
include 'list_parts.tpl.php';// here is the error


try this:

Code:
include('list_parts.tpl.php');

and make sure list_parts.tpl.php is in the same dir as the script that's calling it.

Or you could try
Code:
include("./list_parts.tpl.php");


If you could include your error, that would certainly help more.
_________________
Stephen
Need a LitlURL?


http://CodeBin.yi.org
Back to top View user's profile Send private message Visit poster's website
rrinc
-


Joined: 24 Feb 2006
Posts: 725
Location: Arkansas, USA

PostPosted: Sun Mar 16, 2008 9:54 pm    Post subject: Reply with quote

It isn't necessary to use parenthesis with include. It's a language construct, kind of like echo. Either your file doesn't exist or you're having include path issues. Can you give us the error you get?
_________________
-Blake | New Server :D
SaveTheInternet
Soy hispanohablante. Puedes contactarme por mensajes privados.
Back to top View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
fiasco
-


Joined: 12 Aug 2008
Posts: 8

PostPosted: Tue Aug 12, 2008 6:52 am    Post subject: Reply with quote

please explain me briefly I can't palpable your problem.
Back to top View user's profile Send private message Visit poster's website
fiasco
-


Joined: 12 Aug 2008
Posts: 8

PostPosted: Thu Sep 04, 2008 6:41 am    Post subject: Reply with quote

thanks to share this template.
_________________
web design company
free templates
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group