naldo_10 Postado Dezembro 20, 2010 Denunciar Share Postado Dezembro 20, 2010 Parse error: syntax error, unexpected T_STRING in C:\SERVER\www\source\admin\library\config.php on line 17 1. <?php 2. ini_set('display_errors', 'On'); 3. //ob_start("ob_gzhandler"); 4. error_reporting(E_ALL); 5. 6. // start the session 7. session_start(); 8. 9. // database connection config 10. $dbHost = 'localhost'; 11. $dbUser = 'mark1471_michton'; 12. $dbPass = 'nottelling; 13. $dbName = 'mark1471_plaincart'; 14. 15. // setting up the web root and server root for 16. // this shopping cart application 17. $thisFile = str_replace('\\', '/', __FILE__); 18. $docRoot = $_SERVER['DOCUMENT_ROOT']; 19. 20. $webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile); 21. $srvRoot = str_replace('library/config.php', '', $thisFile); 22. 23. define('WEB_ROOT', $webRoot); 24. define('SRV_ROOT', $srvRoot); 25. 26. // these are the directories where we will store all 27. // category and product images 28. define('CATEGORY_IMAGE_DIR', 'images/category/'); 29. define('PRODUCT_IMAGE_DIR', 'images/product/'); 30. 31. // some size limitation for the category 32. // and product images 33. 34. // all category image width must not 35. // exceed 220 pixels 36. define('MAX_CATEGORY_IMAGE_WIDTH', 110); 37. 38. // do we need to limit the product image width? 39. // setting this value to 'true' is recommended 40. define('LIMIT_PRODUCT_WIDTH', true); 41. 42. // maximum width for all product image 43. define('MAX_PRODUCT_IMAGE_WIDTH', 300); 44. 45. // the width for product thumbnail 46. define('THUMBNAIL_WIDTH', 110); 47. 48. if (!get_magic_quotes_gpc()) { 49. if (isset($_POST)) { 50. foreach ($_POST as $key => $value) { 51. $_POST[$key] = trim(addslashes($value)); 52. } 53. } 54. 55. if (isset($_GET)) { 56. foreach ($_GET as $key => $value) { 57. $_GET[$key] = trim(addslashes($value)); 58. } 59. } 60. } 61. 62. // since all page will require a database access 63. // and the common library is also used by all 64. // it's logical to load these library here 65. require_once 'database.php'; 66. require_once 'common.php'; 67. 68. // get the shop configuration ( name, addres, etc ), all page need it 69. $shopConfig = getShopConfig(); 70. ?> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 svjets Postado Dezembro 20, 2010 Denunciar Share Postado Dezembro 20, 2010 Essa função troca "\" por "/" no caminho+nome do arquivo config.php.Troque:$thisFile = str_replace('\\', '/', __FILE__); Por: $thisFile = str_replace("\\", "/", __FILE__); Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
naldo_10
Parse error: syntax error, unexpected T_STRING in C:\SERVER\www\source\admin\library\config.php on line 17
1.
<?php
2.
ini_set('display_errors', 'On');
3.
//ob_start("ob_gzhandler");
4.
error_reporting(E_ALL);
5.
6.
// start the session
7.
session_start();
8.
9.
// database connection config
10.
$dbHost = 'localhost';
11.
$dbUser = 'mark1471_michton';
12.
$dbPass = 'nottelling;
13.
$dbName = 'mark1471_plaincart';
14.
15.
// setting up the web root and server root for
16.
// this shopping cart application
17.
$thisFile = str_replace('\\', '/', __FILE__);
18.
$docRoot = $_SERVER['DOCUMENT_ROOT'];
19.
20.
$webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);
21.
$srvRoot = str_replace('library/config.php', '', $thisFile);
22.
23.
define('WEB_ROOT', $webRoot);
24.
define('SRV_ROOT', $srvRoot);
25.
26.
// these are the directories where we will store all
27.
// category and product images
28.
define('CATEGORY_IMAGE_DIR', 'images/category/');
29.
define('PRODUCT_IMAGE_DIR', 'images/product/');
30.
31.
// some size limitation for the category
32.
// and product images
33.
34.
// all category image width must not
35.
// exceed 220 pixels
36.
define('MAX_CATEGORY_IMAGE_WIDTH', 110);
37.
38.
// do we need to limit the product image width?
39.
// setting this value to 'true' is recommended
40.
define('LIMIT_PRODUCT_WIDTH', true);
41.
42.
// maximum width for all product image
43.
define('MAX_PRODUCT_IMAGE_WIDTH', 300);
44.
45.
// the width for product thumbnail
46.
define('THUMBNAIL_WIDTH', 110);
47.
48.
if (!get_magic_quotes_gpc()) {
49.
if (isset($_POST)) {
50.
foreach ($_POST as $key => $value) {
51.
$_POST[$key] = trim(addslashes($value));
52.
}
53.
}
54.
55.
if (isset($_GET)) {
56.
foreach ($_GET as $key => $value) {
57.
$_GET[$key] = trim(addslashes($value));
58.
}
59.
}
60.
}
61.
62.
// since all page will require a database access
63.
// and the common library is also used by all
64.
// it's logical to load these library here
65.
require_once 'database.php';
66.
require_once 'common.php';
67.
68.
// get the shop configuration ( name, addres, etc ), all page need it
69.
$shopConfig = getShopConfig();
70.
?>
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.