SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    folders with same language and design but different database query problem

    dear everyone..
    i am developing a website that contains 4 folders (gl,gb,kz,eg) each folder related to different country and all the website data are in English language but the difference is in the MySQL query of database to get data according to the country

    1) www.example.com/gl/ (Global English version)
    2) www.example.com/gb/ (UK version)
    3) www.example.com/kz/ (Kazakh version)
    4) www.example.com/eg/ (Egyptian version)



    i don't want to add my files to the root of each folder to avoid the headache when changing css or anything in the website..

    i dont want to change everything in 4 folders, i want to change only one file and those changes to affect in each folder, i tried to put my files in the root of my project and in each folder i made include to get the data


    for example : in gl:
    PHP Code:


    $select_query1 
    "SELECT * FROM databaseo where page='about' and lango='gl'";
        
    //print "select_query1: " . $select_query1 . "<br>";
        
    $res_query1 mysql_query($select_query1)
        or die (
    "table error1: " mysql_error());
    $res_rows1 mysql_num_rows($res_query1);
    //echo $res_rows1;
    //$tr_res_query1 = mysql_fetch_array($res_query1);

    //or

        
    while ($tr_res_query1 mysql_fetch_array($res_query1))
        {
        echo 
    'result here<br>';
        
        }
    include(
    '../about.php'); 
    and in gb

    PHP Code:
    $select_query1 "SELECT * FROM databaseo where page='about' and lango='gb'";
        
    //print "select_query1: " . $select_query1 . "<br>";
        
    $res_query1 mysql_query($select_query1)
        or die (
    "table error1: " mysql_error());
    $res_rows1 mysql_num_rows($res_query1);
    //echo $res_rows1;
    //$tr_res_query1 = mysql_fetch_array($res_query1);

    //or

        
    while ($tr_res_query1 mysql_fetch_array($res_query1))
        {
        echo 
    'result here<br>';
        
        }
    include(
    '../about.php'); 
    etc..............

    but it did not work for me because of difference in paths for *.js files and for folders.. any idea????

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure why you would duplicate this page 4 times over rather than putting it in the root with a selector for language, but... to each their own.

    You've given us about 50% of the information, i believe...
    "but it did not work for me because of difference in paths for *.js files and for folders"
    What JS files? What folders? You havent shown us any references to those. Are those references inside "about.php"? What do they look like?
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.


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
  •