Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unexpected T_REQUIRE Error


sowjourn

Recommended Posts

Good afternoon,

 

I read the forum threads on this error and tried adding the semi-colon, adding/deleting the ">" and other things, but I keep getting the error message. Can somebody tell me what is missing in the code below?

 

php require(DIR_WS_LANGUAGES . '$language.php' . FILENAME_DEFAULT);>

Link to comment
Share on other sites

<?php

require(DIR_WS_LANGUAGES . '$language.php' . FILENAME_DEFAULT);

?>

 

Thanks for the suggestion. However when I made that change, I received the following error message:

 

Parse error: syntax error, unexpected '<' on line 32. (which is where "<?php" is located.)

Link to comment
Share on other sites

Thanks for the suggestion. However when I made that change, I received the following error message:

 

Parse error: syntax error, unexpected '<' on line 32. (which is where "<?php" is located.)

 

Is there already an open <?php that you are trying to put it in?

If so put it in as

 

require(DIR_WS_LANGUAGES . '$language.php' . FILENAME_DEFAULT);

 

Nic

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Link to comment
Share on other sites

Is there already an open <?php that you are trying to put it in?

If so put it in as

 

require(DIR_WS_LANGUAGES . '$language.php' . FILENAME_DEFAULT);

 

Nic

 

There was not an open <?php, but I have tried several combinations. With/without <?php & ?php>, semi-colon, single quotes and others. But I still keep getting a syntax error. What happens if I just delete that line?

Link to comment
Share on other sites

Sometimes an error on one line is actually the result of an error someplace else.

 

If you have an error on line 32, post the first 50 lines of code.

 

I sure Nic will be able to spot the error in less time than you can say "Jack Spratt"...

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

Sometimes an error on one line is actually the result of an error someplace else.

 

If you have an error on line 32, post the first 50 lines of code.

 

I sure Nic will be able to spot the error in less time than you can say "Jack Spratt"...

 

Here are the first 50 or so lines of code, I have left line 32 as is.

 

<?php

/*

$Id: index.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

// the following cPath references come from application_top.php

$category_depth = 'top';

if (isset($cPath) && tep_not_null($cPath)) {

$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");

$cateqories_products = tep_db_fetch_array($categories_products_query);

if ($cateqories_products['total'] > 0) {

$category_depth = 'products'; // display products

} else {

$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");

$category_parent = tep_db_fetch_array($category_parent_query);

if ($category_parent['total'] > 0) {

$category_depth = 'nested'; // navigate through the categories

} else {

$category_depth = 'products'; // category has no products, but display the 'no products' message

}

}

}

require(DIR_WS_LANGUAGES . '$language.php'.; (This is the line the error message is pointing to.)

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

Link to comment
Share on other sites

use this

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 

Nic

 

I made the change you suggested and then I received the following error message for the next line of code after the one we have been working on.

 

Parse error: syntax error, unexpected '<' in /home/mpowe3/public_html/sowjourn/storefront/admin/index.php on line 33

 

When I removed the < and > from the front and end of the code in line 33, I then received the "Unexpected T_REQUIRE" error.

 

Let me make sure I am not messing things up myself. This index.php should go in the admin folder, correct?

Link to comment
Share on other sites

And right after the line Nic gave you:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

You'll need this:

 

?>

That will get rid of your error.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

And right after the line Nic gave you:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

You'll need this:

 

?>

That will get rid of your error.

 

I am still getting the following message for the line after the one we have been working on.

 

Parse error: syntax error, unexpected '<' in /home/mpowe3/public_html/sowjourn/storefront/admin/index.php on line 33. This is the code that this error message is referring to: <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

 

Is there a way I can get a clean copy of index.php? Maybe if I upload that, I can see if that works. I probably will need a clean copy of index.php for the admin folder since I have been uploading the previous attempts into that folder.

 

With these errors, I am unable to log-in.

 

Thanks for your patience.

Link to comment
Share on other sites

The first thing you need to do is find out what version you have installed:

 

What version is my shop?

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You can download the full package here:

 

Click Me

 

If you have a "standard" osC install you should be able to replace single files from that download.

 

If you have a purchased template.... Well, let's just say it's not looking good for the home team...

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

You can download the full package here:

 

Click Me

 

If you have a "standard" osC install you should be able to replace single files from that download.

 

If you have a purchased template.... Well, let's just say it's not looking good for the home team...

:blush:

 

Jim,

 

Thanks for the download. I will try to upload the index.php files. I appreciate your help.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...