PHP website question

Discussion in 'General Mac Discussion' started by D0ct0rteeth, Apr 24, 2002.

  1. D0ct0rteeth macrumors 65816

    D0ct0rteeth

    Joined:
    Mar 11, 2002
    Location:
    Franklin, TN
    #1
    So heres the deal... I know that this is COMPLETELY unrelated to MAC's but i would ask anyway... the threads have been mostly general discussion lately anyhow...

    I have a php based website that is going threw a redesign hosted on my proprietary linux server...

    folder structure is set up like this...

    html
    -element
    -image
    -script
    -sfo
    -shop
    -spec
    -and various html files


    to eventually test the redesign I have setup an additional folder called "TEST" inside "HTML" that duplicates the heirarchy like so:

    html
    -test
    --element
    --image
    --script
    --sfo
    --shop
    --spec
    --and various html files
    -element
    -image
    -script
    -sfo
    -shop
    -spec
    -and various html files

    well all is well and good until i try to load the page... when i point the browser to the "index.php3" page in the "TEST" folder it takes forever to load and eventually locks up the browser...

    is this a database issue due to the moved files, or a php thing?

    I have never had a problem like this before; but then again this is the most complex site I have done..

    I appreciate any feedback and let me know if i didnt explain things too clearly...

    Thanks "A TON" in advance...

    C-
     
  2. arn macrumors god

    arn

    Staff Member

    Joined:
    Apr 9, 2001
    #2
    Re: PHP website question

    Your PHP file probably is in an infinate loop for some reason... when it starts loading... hit STOP in the browser and view source... you'll probably see some error message.

    arn
     
  3. D0ct0rteeth thread starter macrumors 65816

    D0ct0rteeth

    Joined:
    Mar 11, 2002
    Location:
    Franklin, TN
    #3
    <?php
    $element = array("AA2", "HT4", "MA5100", "MC275-II", "MC500", "MQ107", "MX113", "SL-1","TD190", "M1", "S3", "MAC1900", "SL-6", "MAC4100", "MC7108", "MR7082", "MVS3", "C39", "MA6200");
    shuffle($element);
    $r1 = $element[0];
    if(!($r1=fopen("./element/$r1.htm","r1"))) {
    print(" ");
    }
    while(!feof($r1)) {
    $line = fgets($r1, 255);
    print("$line");


    these are the lines of code that are "freezing the browser" oddly the files/paths are the exact same as the ones on the live server... which works fine

    thanks again... i will keep playing.. im sure it is me somehow...

    i'll start in the "element" folder...

    C-
     
  4. Choppaface macrumors 65816

    Joined:
    Jan 22, 2002
    Location:
    SFBA
    #4
    remember you have to close the file

    also maybe try separating the variable so "./element/$r1.htm" is "./element/".$r1.".htm" sometimes i've had problems with this.

    also instead of ./element/file, maybe try a relative URL, element/file

    also is your while loop closed? or did you just cut off the last }
     
  5. kishba macrumors 6502a

    kishba

    Joined:
    Dec 11, 2001
    Location:
    Michigan
    #5
    yes, check for a closing }

    i've learned how important that is
     
  6. kishba macrumors 6502a

    kishba

    Joined:
    Dec 11, 2001
    Location:
    Michigan
    #6
    yes, check for a closing }

    i've how important that is
     
  7. D0ct0rteeth thread starter macrumors 65816

    D0ct0rteeth

    Joined:
    Mar 11, 2002
    Location:
    Franklin, TN
    #7
    Choppaface;

    seperating the variable worked... now let the redesign begin...

    thanks everyone for the help...

    "snif" I love macrumors

    C-
     

Share This Page