Jump to content

paulherron

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

paulherron's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That's great, thanks Ken! Am I right in saying that using external URLs is a bad idea anyway because it slows the processing down significantly? The includes folder is actually on the same level as the directory containing the script, so I got it working with: [code]<?php $ini_file = '../includes/site_config.ini'; $ini = parse_ini_file($ini_file, false); ?>[/code] I then developed that to the following to allow the code to work no matter what directory level it's placed at: [code]<?php $ini_file = $_SERVER['DOCUMENT_ROOT'].'/includes/site_config.ini'; $ini = parse_ini_file($ini_file, false); ?>[/code]
  2. Hi everyone. I'm trying to parse a .ini file called "site_config.ini". If I put it in the same directory as the executing script I have no problems with the following code: [code]$ini_filename = 'site_config.ini'; // Read .ini file if it is present. $ini = parse_ini_file($ini_filename, false);[/code] However, if I expand this code to point to a different directory... [code]$ini_path = 'http:www.mydomain.com/includes/'; $ini_filename = 'site_config.ini'; // Read .ini file if it is present. $ini = parse_ini_file($ini_path.$ini_filename, false);[/code] ... I get an error: "Warning: parse_ini_file(): Cannot open 'http://www.mydomain.com/includes/site_config.ini' for reading in /home/blah/blah/". I know the file is present in that directory because I can navigate to it. Putting both the path and the filename together in the same variable doesn't seem to work either. Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.