I tried to change the path of smarty to C:\smarty\ and configure the config.php to
define("SMARTYPATH", "C:\xampp\htdocs\smarty\");
But still the same error, was that wrong?
I tried to change the path of smarty to C:\smarty\ and configure the config.php to
define("SMARTYPATH", "C:\xampp\htdocs\smarty\");
But still the same error, was that wrong?
As I said, escape the backslashes:
define("SMARTYPATH", "C:\\xampp\\htdocs\\smarty\\");
Oh yeah, sorry, it worked.. but now i got a new error:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampp\htdocs\filestore\config.php on line 41
Warning: require_once(C:/xampp/htdocs/filestore/smartySmarty.class.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\filestore\libs\header.php on line 17
Fatal error: require_once() [function.require]: Failed opening required 'C:/xampp/htdocs/filestore/smartySmarty.class.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\filestore\libs\header.php on line 17
Do you know what this is?
Probably the same problem: you are not escaping backslashes when you need to. Generally, you can avoid most of these backslash escaping by using single quote delimited strings (in which case you only need to escape a backslash if it is at the end of the string literal, or would otherwise cause an unintended escaping). Read the PHP manual on strings for more information.
Your problem is because you are using forward slashes and Windows expects backwards slashes:
so: C:/xampp/htdocs/filestore/smartySmarty.class.php should become: C:\xampp\htdocs\filestore\smartySmarty.class.php (note that if you have this enclosed in double quotation marks then each backlslash needs to be a double backslash.
Repeat for the line indicated by the second error message.
Your problem is because you are using forward slashes and Windows expects backwards slashes:
I have my doubts since require_once should be able to translate 'C:/xampp/htdocs/filestore/smartySmarty.class.php' correctly.
Oh, thank you, it worked! Now i can enter the site but it still says at the top:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampp\htdocs\filestore\config.php on line 41
One of these is line 41
//Maximum filesize allowed for file upload. Specify value in BYTES.
$upload_config=array(
"max_size"=>"5242880", // 1Kb = 1024 ; 1Mb = 1048576 ; 5Mb = 5242880
I believe it is the last problem
What is your current relevant code?
So is require_once() converting them to backslashes, which are themselves not escaped? Would probably be best to just use double backslashes for peace of mind?
Ok, i got it working, Thank You very much everyone!
Ok, i got it working, Thank You very much everyone!
No problem
Remember to mark this thread as resolved using the thread tools.
Also, kindly tell us how you solved your problem (e.g., show the code that was wrong, and then what you did to correct it). This could help another person who has a similiar problem and found this thread.
EDIT:
Ashley Sheridan wrote:So is require_once() converting them to backslashes, which are themselves not escaped?
No, since that would be incorrect translation. I'm fairly sure that part of legrand's code used paths with backslashes, and these needed the escaping, but the other part that used paths with forward slashes were fine.
Ashley Sheridan wrote:Would probably be best to just use double backslashes for peace of mind?
Considering that this is a Windows specific absolute path, I'd say yes, just so as to avoid surprising people (you are a good example :p). On the other hand, if it were relative to $_SERVER['DOCUMENT_ROOT'], using forward slashes would be the better option since that would likely be how the path would be formatted, even on Windows.