Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do i insert such a long table


yanarasod

Recommended Posts

thanks, just had another question, how do i make my new file take for example

 

filename.php

 

i want it under a folder newfolder/filename.php

 

so the url will be www.mystore.com/newfolder/filename.php

 

i have my catalog installed on the root domain, do you have any ideas how i can achieve it.

Link to comment
Share on other sites

didnt understand this

 

"Depends on what you're doing with it"

 

i just want another folder with and in the file under it

 

includes/header.php, and all those things required for a normal page as conditions.php

Link to comment
Share on other sites

Yes, you would need to adjust the paths of all the included files from yourfilesdir/yourfile.php. If you change application_top.php and all the others to include files using absolute paths instead of relative paths, then you wouldn't need to worry unless you changed servers.

 

You need to make sure that DIR_FS_CATALOG has the correct value.

 

Replace all instances of

 

require( 'somefile.php' );

with

require( DIR_FS_CATALOG.'somefile.php' );

 

and

 

include( 'somefile.php' );

with

include( DIR_FS_CATALOG.'somefile.php' );

 

You will want to do this on a test site because you will run into lots of path issues trying to get everything right.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

just didn't get anything into my head.

 

 

The problem you're running into is this:

 

 

 

Your site has the following structure:

  • account.php
  • account_edit.php
  • account_history.php
  • etc.
  • includes
    • application_bottom.php
    • application_top.php
    • column_left.php
    • etc.

All files that are called use the catalog root - in your case it's the same as the site root. Since there are certain files needed to run OSC (includes/configure.php with the database connection information, etc), you need the includes directory and subdirectories.

 

If I'm pointing my browser to account.php in the root, account.php needs to include includes/application_top.php (which in turn includes configure.php). In this case, includes/ is a relative path. It's finding the application_top.php by looking in a subdirectory of the current directory called includes.

 

If you point your browser to mydir/somefile.php, then we're no longer in the root. So include('includes/application_top.php') will fail because there is no subdirectory of mydir called includes.

 

In order to get the correct directory included, you can use the full (absolute) path to the includes/ directory.

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

ok here was what i did, i added the chdir('..'); in front of require('includes/application_top.php'); , the page now doesnt even load. do i need to replace the .. of chdir('..'); with includes/application_top.php

 

<?php

/*

$Id: newsroom.php,v 1.22 2003/06/05 23:26:23 hpdl Exp $

*/

 

chdir('..');

require('includes/application_top.php');

 

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

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_INFO));

 

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_LOCATE_A_STORE));

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html <?php echo HTML_PARAMS; ?>>

<head>

 

<?php

// BOF: Header Tag Controller v2.5.7

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

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

<?php

}

// EOF: Header Tag Controller v2.5.7

?>

Link to comment
Share on other sites

Now you're getting an error because you haven't created the language file. You include it:

 

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

 

But it doesn't exist. Create a language file (or remove this line if you don't need one):

 

includes/languages/english/where_to_buy/locate_a_store.php

Contributions

 

Discount Coupon Codes

Donations

Link to comment
Share on other sites

THANKS, very much, worked like a charm, had been searching for it for almost 1 month in different forums thanks, so including

 

chdir('..');

 

did the trick, but just to be sure will it cause session loss or any other errors. thanks again

 

 

i will be glad if you could take a look at this topic, all my categories behave differently, i am unable to find a way out

 

http://www.oscommerce.com/forums/index.php?showtopic=211947

Link to comment
Share on other sites

back to the issue:

 

is there any way to make my url directly to sub-folder

 

www.site.com/subfolder

 

instead of

 

www.site.com/subfolder/index.php

 

i tried

define('FILENAME_FILE', 'subfolder');

 

instead of

define('FILENAME_FILE', 'subfolder/index.php');

 

but was of no help, by typing in the url in the address bar one can get there, but how do i make a link in the page itself.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...