Jump to content



Photo

Chapter 3 Define (Base_Uri

chapter3 base_uri

  • Please log in to reply
5 replies to this topic

#1 YELLOWSKT

YELLOWSKT

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 3 January 2018 - 2:06 PM

When I open index.php in the browser, the following error appears:

 

Parse error: syntax error, unexpected 'define' (T_STRING) in C:\wamp\www\exemplo1\html\includes\config.inc.php on line 12

 

in the config.inc.php is:

 

12  define ('BASE_URI', 'C:\wamp\www\exemplo1\html\\');
13  define ('BASE_URL', 'localhost/exemplo1/html/');
14  define ('MYSQL', BASE_URI . 'mysql.inc.php');
 
in the mysqli_inc.php is:
 
2  DEFINE ('DB_HOST', 'localhost');
3  DEFINE ('DB_USER', 'root');
4  DEFINE ('DB_PASSWORD', '');
5  DEFINE ('DB_NAME', 'ecommerce1');
 
7  $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_Name);
8  mysqli_set_charset($dbc, 'utf8');
 
10  function escape_data ($data, $dbc) {
 
12  if (get_magic_quotes_gpc()) $data = stripslashes($data);
13  return mysqli_real_escape_string ($dbc, trim ($data));
14  }
 
Can someone help me?
 

  • 0

#2 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 3 January 2018 - 3:40 PM

It looks like you've copied the actual line numbers to. If so, you'll need to remove those. 


  • 0

#3 YELLOWSKT

YELLOWSKT

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 3 January 2018 - 5:40 PM

It looks like you've copied the actual line numbers to. If so, you'll need to remove those. 

the number of lines is just a reference.


  • 0

#4 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 3 January 2018 - 10:08 PM

Ah, okay. I think it's caused by the double backslash at the end of line 12 there. Change that to a single backslash.


  • 0

#5 YELLOWSKT

YELLOWSKT

    Newbie

  • Members
  • Pip
  • 4 posts

Posted 5 January 2018 - 6:24 PM

the problem was in my directory and in the DEFINE('CONTACT_EMAIL', 'you@example.com');

I'm using localhost so I commented the code: //DEFINE('CONTACT_EMAIL', 'you@example.com'); and it worked.

In windows normal bar also works: 'C:/wamp/www/exemplo1/' or 'C:\wamp\www\exemplo1\\'.

thanks!!


  • 0

#6 Larry

Larry

    Administrator/Writer

  • Administrators
  • 4921 posts
  • LocationState College, PA (USA)

Posted 6 January 2018 - 1:34 PM

Cool. Glad you figured it out and thanks for sharing the solution!


  • 0