Welcome, Guest
  • Author Topic: Problems - Update Vars Tutorial !?!?!  (Read 2481 times)

    FlashBody

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • Email
    Problems - Update Vars Tutorial !?!?!
    « on: 02/21/02, 03:28 »
    allright folks
    here it goes !

    i am talking abou that updating and reading vars thing !

    uploaded all the files !
    got all the paths right !
    txt file is found ! data seams to be updated !
    BUT ... the new data is not been written !
    the new variables in the txt file are EMPTY - there is nothing ! not even the default stuff ! ? wuz the problem ??

     :'(
    « Last Edit: 02/21/02, 03:32 by Mark »

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #1 on: 02/21/02, 08:33 »
    Hi,

    you followed all the tips from the tutorial about access rights, too?
    For a standard unix webserver to write to a textfile, you need either
    a directory with permissions 777 (where the server can create your file if it does not exist) or
    an existing file with permissions 666 so the server can overwrite it

    Musicman

    FlashBody

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • Email
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #2 on: 02/21/02, 12:21 »
    well to set permission is no problem ! i got pretty much everything set the way is was told in the tut i guess 755 !
    well the script seems to access the txt but it doesnt write the new data to it ?

    txt --> what permission ? 755 ?
    cgi script --> what permission ? 755 ?

    i think it is only a little mistkae since everyting is read ,found and opened correctly just the new data is not been written to the text file ?!!!

    FlashBody

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • Email
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #3 on: 02/22/02, 01:48 »
    i set everything on the server to 777 !
    the data is just not been written ! the text file is EMPTY ???

    what to do ???

    wuz meant with absolute path ? i got everything in the same directory and just wrote

    open (LOG, ">bla.txt")

    ??? ??? help !?!?

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #4 on: 02/22/02, 03:00 »
    You'll have to locate the bla.txt file in a directory Outside of your CGI-Bin.  I'm not certain how you have it set up now.  But create a new folder that is one level up from your CGI-Bin.  

    Then you can use either the absolute path to reference this file - or a relative one.

    A relative one would look like this:  open (LOG, ">../TheNewFolder/bla.txt");

    The absolute one would contain the absolute path on your Server to the Text file.  This absolute path is Hard to find because in most cases your using a shared hosting environment and your webspace is just one folder/directory on that server.  The easiest way to find the absolute path is by looking at the path that your using with your FTP client.  For example with WS_FTP, on the right hand side under remote Site you'll see something like  /USER/ext/YourUserName/www   etc.  That would be the first part of the absolute path.  (It's probably better to go with the relative path however).  
    Flash-DB

    Flash-db

    • Administrator
    • Systems Administrator
    • *****
    • Posts: 1876
      • View Profile
      • Flash-db.com
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #5 on: 02/22/02, 03:01 »
    If this does not help - if possible post the script your using here and we can look over it for syntax errors or anything else that might be wrong or causing this problem.
    Flash-DB

    FlashBody

    • Server what's that
    • *
    • Posts: 7
      • View Profile
      • Email
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #6 on: 02/22/02, 04:04 »

    You'll have to locate the bla.txt file in a directory Outside of your CGI-Bin.  I'm not certain how you have it set up now.  But create a new folder that is one level up from your CGI-Bin.


    is just put it in any folder - i think that runs everywhere - i have no folder called
    CGI-Bin unless i create it myself. (By the way i am absolutaly sure i am allowed to excute cgi and stuff like that before the questions comes up  ;D)

    ok i try that with the new path - but relocating the txt can solve the problem that no data is written to it ???

    Musicman

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 2685
      • View Profile
      • Email
    Re:Problems - Update Vars Tutorial !?!?!
    « Reply #7 on: 02/22/02, 04:45 »
    Hi there,

    it is well possible that you have to create a cgi-bin and put your files there.
    Try to call the script from browser - if you see the code, it only works in cgi-bin
    If you see an error 500, there is a problem with the script
    Finding path: many servers are set up such that you do not see full paths in ftp, only your own area.
    Once you have any cgi script working on the server, you can try this one:
    #!/usr/bin/perl
    print "Content-type: text/plain\n\n";
    foreach $k (keys %ENV)
    { print "$k => $ENV{$k}\n";
    }
    This will certainly have the absolute path to the script, as SCRIPT_FILENAME or PATH_TRANSLATED
    Permissions: some servers refuse to run script with 777 permissions, only 755 works.
    The text files should be 666 rather than 777 - once it works you may try out protection effects, though

    Musicman