PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.smarty.general > Basic question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Basic question

Réponse
 
LinkBack Outils de la discussion
Vieux 26/01/2006, 19h14   #1
Howler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Basic question

Hello Everyone,

I apologize in advance as I am sure that this question has been answered
before. I have searched through mail lists and news groups and have not
found a satifactory answer.

I am still pretty new to PHP/Smarty so please be patient.

I have installed Smarty to my Linux hosting server. I installed it
outside of the www directory per the recommendations.

/www
|_______>myappstuff
|_______>lib
  Réponse avec citation
Vieux 26/01/2006, 19h44   #2
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

A hunch, turn off PHP magic quotes?

Howler wrote:

>Hello Everyone,
>
>I apologize in advance as I am sure that this question has been answered
>before. I have searched through mail lists and news groups and have not
>found a satifactory answer.
>
>I am still pretty new to PHP/Smarty so please be patient.
>
>I have installed Smarty to my Linux hosting server. I installed it
>outside of the www directory per the recommendations.
>
>/www
> |_______>myappstuff
> |_______>lib
> .
> .
> .
>/Smarty
> |_____> internals
> |_____>plugins
> |_____>myappstuff
> | |________>cache
> | |________>configs
> | |________>templates
> | |________>templates_c
> |
> |
> |________________>Config_file.class.php
> |________________>debug.tpl
> |________________>Smarty.class.php
> |________________>Smarty_Compiler.class.php
>
>
>I set the path using the ini_set and I can find the Smarty.class.php
>without issue, what seems to be the problem is that when my PHP code
>performs the $smSmarty->display('index.tpl'); I get the following error:
>
>=================
>
>*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>
>*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>
>==================
>
>
>I believe that I have the permissions set correctly but I am not sure,
>it could be something that I missed in my code.
>
>==================
>
>
>index.php
>
><?php
>
>ini_set
>('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>require_once ('Smarty.class.php');
>require_once ('lib/my_dbconnect.php');
>
>
>$smSmarty = new Smarty;
>
>$smSmarty->compile_check = true;
>$smSmarty->debugging = true;
>
>$smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/';
>$smSmarty->compile_dir = '/home/myhomedir/www/myappstuff/templates_c/';
>$smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>$smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>$smSmarty->force_compile = true;
>
>$smSmarty->assign('Name', 'Joe');
>
>if ($smSmarty->template_exists('index.tpl'))
> {
> if(!$smSmarty->is_cached('index.tpl'))
> {
> $smSmarty->display('index.tpl');
> }
> }
>else
> {
> $smSmarty->display('debug.tpl');
> phpinfo();
> }
>?>
>
>index.tpl
>
>
><html>
><head>
><title>My Smarty test App</title>
></head>
>
><body>
>This is a test: {$Name}
></body>
></html>
>
>
>==================
>
>
>
>index.php does find the template and executes the correct code, however
>when the line:
>
> $smSmarty->display('index.tpl');
>
>is executed I get the error.
>
>
>Any assistance would be greatly appreciated.
>
>Thanks in advance!
>John
>
>
>

  Réponse avec citation
Vieux 26/01/2006, 19h47   #3
Howler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

Monte,

Thanks, is this something that I can turn off via ini_set()?


Monte Ohrt wrote:

> A hunch, turn off PHP magic quotes?
>
> Howler wrote:
>
>> Hello Everyone,
>>
>> I apologize in advance as I am sure that this question has been answered
>> before. I have searched through mail lists and news groups and have not
>> found a satifactory answer.
>>
>> I am still pretty new to PHP/Smarty so please be patient.
>>
>> I have installed Smarty to my Linux hosting server. I installed it
>> outside of the www directory per the recommendations.
>> /www
>> |_______>myappstuff
>> |_______>lib
>> .
>> .
>> .
>> /Smarty
>> |_____> internals
>> |_____>plugins
>> |_____>myappstuff
>> | |________>cache
>> | |________>configs
>> | |________>templates
>> | |________>templates_c
>> |
>> |
>> |________________>Config_file.class.php
>> |________________>debug.tpl
>> |________________>Smarty.class.php
>> |________________>Smarty_Compiler.class.php
>>
>>
>> I set the path using the ini_set and I can find the Smarty.class.php
>> without issue, what seems to be the problem is that when my PHP code
>> performs the $smSmarty->display('index.tpl'); I get the following
>> error:
>>
>> =================
>>
>> *Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>> */home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>
>> *Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>> */home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>
>> ==================
>>
>>
>> I believe that I have the permissions set correctly but I am not sure,
>> it could be something that I missed in my code.
>>
>> ==================
>>
>>
>> index.php
>>
>> <?php
>>
>> ini_set
>> ('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>
>> require_once ('Smarty.class.php');
>> require_once ('lib/my_dbconnect.php');
>>
>>
>> $smSmarty = new Smarty;
>>
>> $smSmarty->compile_check = true;
>> $smSmarty->debugging = true;
>>
>> $smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/';
>> $smSmarty->compile_dir = '/home/myhomedir/www/myappstuff/templates_c/';
>> $smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>> $smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>> $smSmarty->force_compile = true;
>>
>> $smSmarty->assign('Name', 'Joe');
>>
>> if ($smSmarty->template_exists('index.tpl'))
>> {
>> if(!$smSmarty->is_cached('index.tpl'))
>> {
>> $smSmarty->display('index.tpl');
>> }
>> }
>> else
>> {
>> $smSmarty->display('debug.tpl');
>> phpinfo();
>> }
>> ?>
>>
>> index.tpl
>>
>>
>> <html>
>> <head>
>> <title>My Smarty test App</title>
>> </head>
>>
>> <body>
>> This is a test: {$Name}
>> </body>
>> </html>
>>
>>
>> ==================
>>
>>
>>
>> index.php does find the template and executes the correct code, however
>> when the line:
>>
>> $smSmarty->display('index.tpl');
>>
>> is executed I get the error.
>>
>>
>> Any assistance would be greatly appreciated.
>>
>> Thanks in advance!
>> John
>>
>>
>>

>

  Réponse avec citation
Vieux 26/01/2006, 19h51   #4
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

I think so, see the PHP docs.

Howler wrote:

>Monte,
>
>Thanks, is this something that I can turn off via ini_set()?
>
>
>Monte Ohrt wrote:
>
>
>
>>A hunch, turn off PHP magic quotes?
>>
>>Howler wrote:
>>
>>
>>
>>>Hello Everyone,
>>>
>>>I apologize in advance as I am sure that this question has been answered
>>>before. I have searched through mail lists and news groups and have not
>>>found a satifactory answer.
>>>
>>>I am still pretty new to PHP/Smarty so please be patient.
>>>
>>>I have installed Smarty to my Linux hosting server. I installed it
>>>outside of the www directory per the recommendations.
>>>/www
>>> |_______>myappstuff
>>> |_______>lib
>>> .
>>> .
>>> .
>>>/Smarty
>>> |_____> internals
>>> |_____>plugins
>>> |_____>myappstuff
>>> | |________>cache
>>> | |________>configs
>>> | |________>templates
>>> | |________>templates_c
>>> |
>>> |
>>> |________________>Config_file.class.php
>>> |________________>debug.tpl
>>> |________________>Smarty.class.php
>>> |________________>Smarty_Compiler.class.php
>>>
>>>
>>>I set the path using the ini_set and I can find the Smarty.class.php
>>>without issue, what seems to be the problem is that when my PHP code
>>>performs the $smSmarty->display('index.tpl'); I get the following
>>>error:
>>>
>>>=================
>>>
>>>*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>>>*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>>
>>>*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>>>*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>>
>>>==================
>>>
>>>
>>>I believe that I have the permissions set correctly but I am not sure,
>>>it could be something that I missed in my code.
>>>
>>>==================
>>>
>>>
>>>index.php
>>>
>>><?php
>>>
>>>ini_set
>>>('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>>
>>>require_once ('Smarty.class.php');
>>>require_once ('lib/my_dbconnect.php');
>>>
>>>
>>>$smSmarty = new Smarty;
>>>
>>>$smSmarty->compile_check = true;
>>>$smSmarty->debugging = true;
>>>
>>>$smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/';
>>>$smSmarty->compile_dir = '/home/myhomedir/www/myappstuff/templates_c/';
>>>$smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>>>$smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>>>$smSmarty->force_compile = true;
>>>
>>>$smSmarty->assign('Name', 'Joe');
>>>
>>>if ($smSmarty->template_exists('index.tpl'))
>>>{
>>> if(!$smSmarty->is_cached('index.tpl'))
>>> {
>>> $smSmarty->display('index.tpl');
>>> }
>>>}
>>>else
>>>{
>>> $smSmarty->display('debug.tpl');
>>> phpinfo();
>>>}
>>>?>
>>>
>>>index.tpl
>>>
>>>
>>><html>
>>><head>
>>><title>My Smarty test App</title>
>>></head>
>>>
>>><body>
>>>This is a test: {$Name}
>>></body>
>>></html>
>>>
>>>
>>>==================
>>>
>>>
>>>
>>>index.php does find the template and executes the correct code, however
>>>when the line:
>>>
>>> $smSmarty->display('index.tpl');
>>>
>>>is executed I get the error.
>>>
>>>
>>>Any assistance would be greatly appreciated.
>>>
>>>Thanks in advance!
>>>John
>>>
>>>
>>>
>>>
>>>

>
>
>

  Réponse avec citation
Vieux 26/01/2006, 20h37   #5
Howler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

The line:

ini_set('magic_quotes_gpc',0);

Doesn't seem to turn off magic_quotes, perhaps this is something that
needs to be set in the php.ini. I don't have access to the global
php.ini, but my understanding is that the script will look in the
current directory for a php.ini, then wwwroot, and then the global
position. Is this correct? My hosting service provider put a copy of
php.ini in my directory for me, and I turned off magic_quotes in it, but
still no joy.

Thanks,
John


Monte Ohrt wrote:

> I think so, see the PHP docs.
>
> Howler wrote:
>
>> Monte,
>>
>> Thanks, is this something that I can turn off via ini_set()?
>>
>>
>> Monte Ohrt wrote:
>>
>>
>>
>>> A hunch, turn off PHP magic quotes?
>>>
>>> Howler wrote:
>>>
>>>
>>>
>>>> Hello Everyone,
>>>>
>>>> I apologize in advance as I am sure that this question has been
>>>> answered
>>>> before. I have searched through mail lists and news groups and have
>>>> not
>>>> found a satifactory answer.
>>>>
>>>> I am still pretty new to PHP/Smarty so please be patient.
>>>>
>>>> I have installed Smarty to my Linux hosting server. I installed it
>>>> outside of the www directory per the recommendations.
>>>> /www
>>>> |_______>myappstuff
>>>> |_______>lib
>>>> .
>>>> .
>>>> .
>>>> /Smarty
>>>> |_____> internals
>>>> |_____>plugins
>>>> |_____>myappstuff
>>>> | |________>cache
>>>> | |________>configs
>>>> | |________>templates
>>>> | |________>templates_c
>>>> |
>>>> |
>>>> |________________>Config_file.class.php
>>>> |________________>debug.tpl
>>>> |________________>Smarty.class.php
>>>> |________________>Smarty_Compiler.class.php
>>>>
>>>>
>>>> I set the path using the ini_set and I can find the Smarty.class.php
>>>> without issue, what seems to be the problem is that when my PHP code
>>>> performs the $smSmarty->display('index.tpl'); I get the following
>>>> error:
>>>>
>>>> =================
>>>>
>>>> *Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>>>> */home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>>>
>>>> *Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>>>> */home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>>>
>>>> ==================
>>>>
>>>>
>>>> I believe that I have the permissions set correctly but I am not sure,
>>>> it could be something that I missed in my code.
>>>>
>>>> ==================
>>>>
>>>>
>>>> index.php
>>>>
>>>> <?php
>>>>
>>>> ini_set
>>>> ('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>>>
>>>>
>>>> require_once ('Smarty.class.php');
>>>> require_once ('lib/my_dbconnect.php');
>>>>
>>>>
>>>> $smSmarty = new Smarty;
>>>>
>>>> $smSmarty->compile_check = true;
>>>> $smSmarty->debugging = true;
>>>>
>>>> $smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/';
>>>> $smSmarty->compile_dir =
>>>> '/home/myhomedir/www/myappstuff/templates_c/';
>>>> $smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>>>> $smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>>>> $smSmarty->force_compile = true;
>>>>
>>>> $smSmarty->assign('Name', 'Joe');
>>>>
>>>> if ($smSmarty->template_exists('index.tpl'))
>>>> {
>>>> if(!$smSmarty->is_cached('index.tpl'))
>>>> {
>>>> $smSmarty->display('index.tpl');
>>>> }
>>>> }
>>>> else
>>>> {
>>>> $smSmarty->display('debug.tpl');
>>>> phpinfo();
>>>> }
>>>> ?>
>>>>
>>>> index.tpl
>>>>
>>>>
>>>> <html>
>>>> <head>
>>>> <title>My Smarty test App</title>
>>>> </head>
>>>>
>>>> <body>
>>>> This is a test: {$Name}
>>>> </body>
>>>> </html>
>>>>
>>>>
>>>> ==================
>>>>
>>>>
>>>>
>>>> index.php does find the template and executes the correct code,
>>>> however
>>>> when the line:
>>>>
>>>> $smSmarty->display('index.tpl');
>>>>
>>>> is executed I get the error.
>>>>
>>>>
>>>> Any assistance would be greatly appreciated.
>>>>
>>>> Thanks in advance!
>>>> John
>>>>
>>>>
>>>>
>>>>
>>>

>>
>>
>>

>

  Réponse avec citation
Vieux 26/01/2006, 20h42   #6
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

http://www.phpinsider.com/smarty-for...pic.php?t=4936

Howler wrote:

>The line:
>
>ini_set('magic_quotes_gpc',0);
>
>Doesn't seem to turn off magic_quotes, perhaps this is something that
>needs to be set in the php.ini. I don't have access to the global
>php.ini, but my understanding is that the script will look in the
>current directory for a php.ini, then wwwroot, and then the global
>position. Is this correct? My hosting service provider put a copy of
>php.ini in my directory for me, and I turned off magic_quotes in it, but
>still no joy.
>
>Thanks,
>John
>
>
>Monte Ohrt wrote:
>
>
>
>>I think so, see the PHP docs.
>>
>>Howler wrote:
>>
>>
>>
>>>Monte,
>>>
>>>Thanks, is this something that I can turn off via ini_set()?
>>>
>>>
>>>Monte Ohrt wrote:
>>>
>>>
>>>
>>>
>>>
>>>>A hunch, turn off PHP magic quotes?
>>>>
>>>>Howler wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Hello Everyone,
>>>>>
>>>>>I apologize in advance as I am sure that this question has been
>>>>>answered
>>>>>before. I have searched through mail lists and news groups and have
>>>>>not
>>>>>found a satifactory answer.
>>>>>
>>>>>I am still pretty new to PHP/Smarty so please be patient.
>>>>>
>>>>>I have installed Smarty to my Linux hosting server. I installed it
>>>>>outside of the www directory per the recommendations.
>>>>>/www
>>>>> |_______>myappstuff
>>>>> |_______>lib
>>>>> .
>>>>> .
>>>>> .
>>>>>/Smarty
>>>>> |_____> internals
>>>>> |_____>plugins
>>>>> |_____>myappstuff
>>>>> | |________>cache
>>>>> | |________>configs
>>>>> | |________>templates
>>>>> | |________>templates_c
>>>>> |
>>>>> |
>>>>> |________________>Config_file.class.php
>>>>> |________________>debug.tpl
>>>>> |________________>Smarty.class.php
>>>>> |________________>Smarty_Compiler.class.php
>>>>>
>>>>>
>>>>>I set the path using the ini_set and I can find the Smarty.class.php
>>>>>without issue, what seems to be the problem is that when my PHP code
>>>>>performs the $smSmarty->display('index.tpl'); I get the following
>>>>>error:
>>>>>
>>>>>=================
>>>>>
>>>>>*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>>>>>*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>
>>>>>*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>>>>>*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>
>>>>>==================
>>>>>
>>>>>
>>>>>I believe that I have the permissions set correctly but I am not sure,
>>>>>it could be something that I missed in my code.
>>>>>
>>>>>==================
>>>>>
>>>>>
>>>>>index.php
>>>>>
>>>>><?php
>>>>>
>>>>>ini_set
>>>>>('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>>>>
>>>>>
>>>>>require_once ('Smarty.class.php');
>>>>>require_once ('lib/my_dbconnect.php');
>>>>>
>>>>>
>>>>>$smSmarty = new Smarty;
>>>>>
>>>>>$smSmarty->compile_check = true;
>>>>>$smSmarty->debugging = true;
>>>>>
>>>>>$smSmarty->template_dir = '/home/myhomedir/www/myappstuff/templates/';
>>>>>$smSmarty->compile_dir =
>>>>>'/home/myhomedir/www/myappstuff/templates_c/';
>>>>>$smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>>>>>$smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>>>>>$smSmarty->force_compile = true;
>>>>>
>>>>>$smSmarty->assign('Name', 'Joe');
>>>>>
>>>>>if ($smSmarty->template_exists('index.tpl'))
>>>>>{
>>>>> if(!$smSmarty->is_cached('index.tpl'))
>>>>> {
>>>>> $smSmarty->display('index.tpl');
>>>>> }
>>>>>}
>>>>>else
>>>>>{
>>>>> $smSmarty->display('debug.tpl');
>>>>> phpinfo();
>>>>>}
>>>>>?>
>>>>>
>>>>>index.tpl
>>>>>
>>>>>
>>>>><html>
>>>>><head>
>>>>><title>My Smarty test App</title>
>>>>></head>
>>>>>
>>>>><body>
>>>>>This is a test: {$Name}
>>>>></body>
>>>>></html>
>>>>>
>>>>>
>>>>>==================
>>>>>
>>>>>
>>>>>
>>>>>index.php does find the template and executes the correct code,
>>>>>however
>>>>>when the line:
>>>>>
>>>>> $smSmarty->display('index.tpl');
>>>>>
>>>>>is executed I get the error.
>>>>>
>>>>>
>>>>>Any assistance would be greatly appreciated.
>>>>>
>>>>>Thanks in advance!
>>>>>John
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>

>
>
>
>
>
>
>
>
>!DSPAM:43d933b5178798168050397!
>
>
>
>

  Réponse avec citation
Vieux 26/01/2006, 21h04   #7
Howler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

Monte,

Thanks, that turned off the |magic_quotes_runtime but I am still getting
the error. :-/|

*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*

*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*



Monte Ohrt wrote:

> http://www.phpinsider.com/smarty-for...pic.php?t=4936
>
> Howler wrote:
>
>> The line:
>>
>> ini_set('magic_quotes_gpc',0);
>>
>> Doesn't seem to turn off magic_quotes, perhaps this is something that
>> needs to be set in the php.ini. I don't have access to the global
>> php.ini, but my understanding is that the script will look in the
>> current directory for a php.ini, then wwwroot, and then the global
>> position. Is this correct? My hosting service provider put a copy of
>> php.ini in my directory for me, and I turned off magic_quotes in it, but
>> still no joy.
>>
>> Thanks,
>> John
>>
>>
>> Monte Ohrt wrote:
>>
>>
>>
>>> I think so, see the PHP docs.
>>>
>>> Howler wrote:
>>>
>>>
>>>
>>>> Monte,
>>>>
>>>> Thanks, is this something that I can turn off via ini_set()?
>>>>
>>>>
>>>> Monte Ohrt wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> A hunch, turn off PHP magic quotes?
>>>>>
>>>>> Howler wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> Hello Everyone,
>>>>>>
>>>>>> I apologize in advance as I am sure that this question has been
>>>>>> answered
>>>>>> before. I have searched through mail lists and news groups and have
>>>>>> not
>>>>>> found a satifactory answer.
>>>>>>
>>>>>> I am still pretty new to PHP/Smarty so please be patient.
>>>>>>
>>>>>> I have installed Smarty to my Linux hosting server. I installed it
>>>>>> outside of the www directory per the recommendations.
>>>>>> /www
>>>>>> |_______>myappstuff
>>>>>> |_______>lib
>>>>>> .
>>>>>> .
>>>>>> .
>>>>>> /Smarty
>>>>>> |_____> internals
>>>>>> |_____>plugins
>>>>>> |_____>myappstuff
>>>>>> | |________>cache
>>>>>> | |________>configs
>>>>>> | |________>templates
>>>>>> | |________>templates_c
>>>>>> |
>>>>>> |
>>>>>> |________________>Config_file.class.php
>>>>>> |________________>debug.tpl
>>>>>> |________________>Smarty.class.php
>>>>>> |________________>Smarty_Compiler.class.php
>>>>>>
>>>>>>
>>>>>> I set the path using the ini_set and I can find the Smarty.class.php
>>>>>> without issue, what seems to be the problem is that when my PHP code
>>>>>> performs the $smSmarty->display('index.tpl'); I get the following
>>>>>> error:
>>>>>>
>>>>>> =================
>>>>>>
>>>>>> *Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>>>>>> */home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>>
>>>>>> *Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>>>>>> */home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>>
>>>>>> ==================
>>>>>>
>>>>>>
>>>>>> I believe that I have the permissions set correctly but I am not
>>>>>> sure,
>>>>>> it could be something that I missed in my code.
>>>>>>
>>>>>> ==================
>>>>>>
>>>>>>
>>>>>> index.php
>>>>>>
>>>>>> <?php
>>>>>>
>>>>>> ini_set
>>>>>> ('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>>>>>
>>>>>>
>>>>>>
>>>>>> require_once ('Smarty.class.php');
>>>>>> require_once ('lib/my_dbconnect.php');
>>>>>>
>>>>>>
>>>>>> $smSmarty = new Smarty;
>>>>>>
>>>>>> $smSmarty->compile_check = true;
>>>>>> $smSmarty->debugging = true;
>>>>>>
>>>>>> $smSmarty->template_dir =
>>>>>> '/home/myhomedir/www/myappstuff/templates/';
>>>>>> $smSmarty->compile_dir =
>>>>>> '/home/myhomedir/www/myappstuff/templates_c/';
>>>>>> $smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>>>>>> $smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>>>>>> $smSmarty->force_compile = true;
>>>>>>
>>>>>> $smSmarty->assign('Name', 'Joe');
>>>>>>
>>>>>> if ($smSmarty->template_exists('index.tpl'))
>>>>>> {
>>>>>> if(!$smSmarty->is_cached('index.tpl'))
>>>>>> {
>>>>>> $smSmarty->display('index.tpl');
>>>>>> }
>>>>>> }
>>>>>> else
>>>>>> {
>>>>>> $smSmarty->display('debug.tpl');
>>>>>> phpinfo();
>>>>>> }
>>>>>> ?>
>>>>>>
>>>>>> index.tpl
>>>>>>
>>>>>>
>>>>>> <html>
>>>>>> <head>
>>>>>> <title>My Smarty test App</title>
>>>>>> </head>
>>>>>>
>>>>>> <body>
>>>>>> This is a test: {$Name}
>>>>>> </body>
>>>>>> </html>
>>>>>>
>>>>>>
>>>>>> ==================
>>>>>>
>>>>>>
>>>>>>
>>>>>> index.php does find the template and executes the correct code,
>>>>>> however
>>>>>> when the line:
>>>>>>
>>>>>> $smSmarty->display('index.tpl');
>>>>>>
>>>>>> is executed I get the error.
>>>>>>
>>>>>>
>>>>>> Any assistance would be greatly appreciated.
>>>>>>
>>>>>> Thanks in advance!
>>>>>> John
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>

>>
>>
>>
>>
>>
>>
>>
>>
>> !DSPAM:43d933b5178798168050397!
>>
>>
>>
>>

>

  Réponse avec citation
Vieux 26/01/2006, 21h08   #8
Monte Ohrt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] Basic question

what does line 180 look like?



Howler wrote:

>Monte,
>
>Thanks, that turned off the |magic_quotes_runtime but I am still getting
>the error. :-/|
>
>*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>
>*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>
>
>
>Monte Ohrt wrote:
>
>
>
>>http://www.phpinsider.com/smarty-for...pic.php?t=4936
>>
>>Howler wrote:
>>
>>
>>
>>>The line:
>>>
>>>ini_set('magic_quotes_gpc',0);
>>>
>>>Doesn't seem to turn off magic_quotes, perhaps this is something that
>>>needs to be set in the php.ini. I don't have access to the global
>>>php.ini, but my understanding is that the script will look in the
>>>current directory for a php.ini, then wwwroot, and then the global
>>>position. Is this correct? My hosting service provider put a copy of
>>>php.ini in my directory for me, and I turned off magic_quotes in it, but
>>>still no joy.
>>>
>>>Thanks,
>>>John
>>>
>>>
>>>Monte Ohrt wrote:
>>>
>>>
>>>
>>>
>>>
>>>>I think so, see the PHP docs.
>>>>
>>>>Howler wrote:
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>Monte,
>>>>>
>>>>>Thanks, is this something that I can turn off via ini_set()?
>>>>>
>>>>>
>>>>>Monte Ohrt wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>A hunch, turn off PHP magic quotes?
>>>>>>
>>>>>>Howler wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hello Everyone,
>>>>>>>
>>>>>>>I apologize in advance as I am sure that this question has been
>>>>>>>answered
>>>>>>>before. I have searched through mail lists and news groups and have
>>>>>>>not
>>>>>>>found a satifactory answer.
>>>>>>>
>>>>>>>I am still pretty new to PHP/Smarty so please be patient.
>>>>>>>
>>>>>>>I have installed Smarty to my Linux hosting server. I installed it
>>>>>>>outside of the www directory per the recommendations.
>>>>>>>/www
>>>>>>> |_______>myappstuff
>>>>>>> |_______>lib
>>>>>>> .
>>>>>>> .
>>>>>>> .
>>>>>>>/Smarty
>>>>>>> |_____> internals
>>>>>>> |_____>plugins
>>>>>>> |_____>myappstuff
>>>>>>> | |________>cache
>>>>>>> | |________>configs
>>>>>>> | |________>templates
>>>>>>> | |________>templates_c
>>>>>>> |
>>>>>>> |
>>>>>>> |________________>Config_file.class.php
>>>>>>> |________________>debug.tpl
>>>>>>> |________________>Smarty.class.php
>>>>>>> |________________>Smarty_Compiler.class.php
>>>>>>>
>>>>>>>
>>>>>>>I set the path using the ini_set and I can find the Smarty.class.php
>>>>>>>without issue, what seems to be the problem is that when my PHP code
>>>>>>>performs the $smSmarty->display('index.tpl'); I get the following
>>>>>>>error:
>>>>>>>
>>>>>>>=================
>>>>>>>
>>>>>>>*Warning*: Unexpected character in input: '\' (ASCII=92) state=1 in
>>>>>>>*/home/vomramha/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>>>
>>>>>>>*Parse error*: parse error, unexpected ')', expecting ',' or ';' in
>>>>>>>*/home/myhomedir/smarty/Smarty_Compiler.class.php* on line *180*
>>>>>>>
>>>>>>>==================
>>>>>>>
>>>>>>>
>>>>>>>I believe that I have the permissions set correctly but I am not
>>>>>>>sure,
>>>>>>>it could be something that I missed in my code.
>>>>>>>
>>>>>>>==================
>>>>>>>
>>>>>>>
>>>>>>>index.php
>>>>>>>
>>>>>>><?php
>>>>>>>
>>>>>>>ini_set
>>>>>>>('include_path',".:/usr/lib/php:/usr/local/lib/php:/home/myhomedir/smarty");
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>require_once ('Smarty.class.php');
>>>>>>>require_once ('lib/my_dbconnect.php');
>>>>>>>
>>>>>>>
>>>>>>>$smSmarty = new Smarty;
>>>>>>>
>>>>>>>$smSmarty->compile_check = true;
>>>>>>>$smSmarty->debugging = true;
>>>>>>>
>>>>>>>$smSmarty->template_dir =
>>>>>>>'/home/myhomedir/www/myappstuff/templates/';
>>>>>>>$smSmarty->compile_dir =
>>>>>>>'/home/myhomedir/www/myappstuff/templates_c/';
>>>>>>>$smSmarty->cache_dir = '/home/myhomedir/www/myappstuff/cache/';
>>>>>>>$smSmarty->config_dir = '/home/myhomedir/www/myappstuff/configs/';
>>>>>>>$smSmarty->force_compile = true;
>>>>>>>
>>>>>>>$smSmarty->assign('Name', 'Joe');
>>>>>>>
>>>>>>>if ($smSmarty->template_exists('index.tpl'))
>>>>>>>{
>>>>>>> if(!$smSmarty->is_cached('index.tpl'))
>>>>>>> {
>>>>>>> $smSmarty->display('index.tpl');
>>>>>>> }
>>>>>>>}
>>>>>>>else
>>>>>>>{
>>>>>>> $smSmarty->display('debug.tpl');
>>>>>>> phpinfo();
>>>>>>>}
>>>>>>>?>
>>>>>>>
>>>>>>>index.tpl
>>>>>>>
>>>>>>>
>>>>>>><html>
>>>>>>><head>
>>>>>>><title>My Smarty test App</title>
>>>>>>></head>
>>>>>>>
>>>>>>><body>
>>>>>>>This is a test: {$Name}
>>>>>>></body>
>>>>>>></html>
>>>>>>>
>>>>>>>
>>>>>>>==================
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>index.php does find the template and executes the correct code,
>>>>>>>however
>>>>>>>when the line:
>>>>>>>
>>>>>>> $smSmarty->display('index.tpl');
>>>>>>>
>>>>>>>is executed I get the error.
>>>>>>>
>>>>>>>
>>>>>>>Any assistance would be greatly appreciated.
>>>>>>>
>>>>>>>Thanks in advance!
>>>>>>>John
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>

>
>
>
>
>
>
>
>
>!DSPAM:43d939fe175471669485837!
>
>
>
>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h19.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,33587 seconds with 16 queries