Results 1 to 5 of 5

 

Thread: Inculde a static version of a dynamic php page

  1. #1
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts


    Hi (not exactly an affiliate thread I know)
    I am running OS COmmerce and an a bit miffed at the fact that the install from my host will only install to a sub folder.
    Thus my OSCommerce store has the URL
    www.shopscifi.co.uk/catalog
    I want www.shopscifi.co.uk/index.php to be a copy of www.shopscifi.co.uk/catalog/index.php
    I have tried include() but it tries to include a multitude of functions that have reletive paths specified.

    Help please

    (would there be any interest from peeps if i set up an affili prog with this store?)
    Follow Me | Looking for Merchants Who Do Scifi Stuff

  2. #2
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2,448
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The quick and dirty way of doing it would be to make index.php simply
    Code:
    <?
    readfile('http://www.shopscifi.co.uk/catalog/index.php');
    ?>
    though you would have to check all the paths on the catalog/index.php page include /catalog/ otherwise the images or links won't work correctly.

    The other option would be to make index.php
    Code:
    <?
    header('location: http://www.shopscifi.co.uk/catalog/index.php');
    ?>
    which would redirect the user to the location page. That will save you from any path issues and I don't think having catalog in the url is really a big issue.

  3. #3
    Registered User

    Status
    Offline
    Join Date
    Apr 2004
    Posts
    96
    Thanks
    0
    Thanked 0 Times in 0 Posts
    scifind, if I understand correctly all you need to do is use the FTP move function to move everything up a directory.

    You will the need to ammend the config.php file in both the catalog and admin part of the site (back them both up first).

    At present the path in the config.php file will point to catalog and catalog/admin. If you remove the directory catalog from the path then you should be sorted.

    PM me if you need any help.
    Work like you don’t need to, Love like you’ve never been hurt, Dance like no one is watching.

  4. #4
    thin[box]king

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Cambridge
    Posts
    1,905
    Thanks
    13
    Thanked 12 Times in 12 Posts
    Cheers - the readfile worked.

    I will do it this way for three reasons.
    1) I am lazy and writing 1 line of code is easier than moving the files and changing the config file
    2) I have some pages in google already
    3)I might put a pretty custom frontpage at some time.
    Follow Me | Looking for Merchants Who Do Scifi Stuff

  5. #5
    Can't Touch This

    Status
    Offline
    Join Date
    May 2004
    Location
    КРОМИДОВО
    Posts
    321
    Thanks
    3
    Thanked 0 Times in 0 Posts
    PHP Code:
    <base href="'http://www.shopscifi.co.uk/catalog/">


    <?
    $handle 
    =  file_get_contents ("http://www.shopscifi.co.uk/catalog/index.php");

    echo 
    $handle;
    ?>
    gets around all the image and other path issues



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
To Top

Content Relevant URLs by vBSEO 3.5.0 RC2