View previous topic :: View next topic |
Author |
Message |
jkmcgrath Smarty n00b
Joined: 14 May 2003 Posts: 4
|
Posted: Wed May 14, 2003 7:38 pm Post subject: Windows 2000 Server |
|
|
Hi all,
I am using 2.5 smarty on a w2k server and all I get is a white screen and no errors.
Even if I intentionaly create an error in the code it will not generate an error.
I read in the documentation where this has been fixed after 1.4 but I am having the problem.
Same code right out of the smarty doc works on linux and apache but not windows? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 14, 2003 7:48 pm Post subject: |
|
|
More details please. What does the php error log say?
Ensure that you are using absolute paths. |
|
Back to top |
|
jkmcgrath Smarty n00b
Joined: 14 May 2003 Posts: 4
|
Posted: Wed May 14, 2003 8:20 pm Post subject: |
|
|
[14-May-2003 15:17:47] PHP Parse error: parse error, unexpected T_REQUIRE in c:\inetpub\wwwroot\test\index.php on line 3
here is my file
Code: |
<?php
error_reporting(E_ALL); ini_set('display_errors', TRUE)
require('Smarty.class.php');
$smarty = new Smarty
$smarty->template_dir = 'test/templates/';
$smarty->compile_dir = 'test/templates_c/';
$smarty->config_dir = 'test/configs/';
$smarty->cache_dir = 'test/cache/';
$smarty->caching = false;
$name = 'John'
$smarty->assign('name','$name');
$smarty->display('index.tpl');
?>
|
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed May 14, 2003 8:28 pm Post subject: |
|
|
hmmm.
Quote: | [14-May-2003 15:17:47] PHP Parse error: parse error, unexpected T_REQUIRE in c:\inetpub\wwwroot\test\index.php on line 3 |
That should tell you that something is wrong in YOUR code
line 3:
Quote: | $smarty = new Smarty |
is missing a ; at the end of the line. |
|
Back to top |
|
jkmcgrath Smarty n00b
Joined: 14 May 2003 Posts: 4
|
Posted: Thu May 15, 2003 12:22 pm Post subject: same error |
|
|
Code: |
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'test/templates/';
$smarty->compile_dir = 'test/templates_c/';
$smarty->config_dir = 'test/configs/';
$smarty->cache_dir = 'test/cache/';
$smarty->caching = false;
$name = 'John'
$smarty->assign('name','$name');
$smarty->display('index.tpl');
?>
|
Quote: |
[15-May-2003 07:09:13] PHP Parse error: parse error, unexpected T_VARIABLE in c:\inetpub\wwwroot\test\index.php on line 14
|
But this code did not. The only difference is in the $name = "John";
Code: |
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'test/templates/';
$smarty->compile_dir = 'test/templates_c/';
$smarty->config_dir = 'test/configs/';
$smarty->cache_dir = 'test/cache/';
$smarty->caching = false;
$smarty->assign('name','John');
$smarty->display('index.tpl');
?>
|
Then I tried this both with single and double quotes
Code: |
<?php
require('Smarty.class.php');
$smarty = new Smarty;
$smarty->template_dir = 'test/templates/';
$smarty->compile_dir = 'test/templates_c/';
$smarty->config_dir = 'test/configs/';
$smarty->cache_dir = 'test/cache/';
$smarty->caching = false;
$name = "John";
$smarty->assign('name','$name');
$smarty->display('index.tpl');
?>
|
and get this
Why will it not pick up the variable I wonder? |
|
Back to top |
|
sweatje Smarty Regular
Joined: 17 Apr 2003 Posts: 70 Location: Bettendorf, Iowa, USA
|
Posted: Thu May 15, 2003 1:16 pm Post subject: |
|
|
single quotes disables php variable replacement.
Code: | $smarty->assign('name',$name); |
_________________ Jason
jsweat_php AT yahoo DOT com |
|
Back to top |
|
jkmcgrath Smarty n00b
Joined: 14 May 2003 Posts: 4
|
Posted: Thu May 15, 2003 1:34 pm Post subject: |
|
|
dOh
the basics
Thats what I get for taking on too much at one lol
Thanks for all the help guys! |
|
Back to top |
|
|