Looking for help reading a .txt or .ini file and outputting the info.


Posted on 16th Feb 2014 07:03 pm by admin

I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I would like it to be in a php file as just 0 if possible. Also how would I do this from php file to php file and let me explain.
Did you know?Explore Trending and Topic pages for more stories like this.


Server 1 Game Server
Server 2 Website

Both have Apache but of course I can't move the info.ini so I point the php script right to it then another php script on my server 2 would read it and do whatever it likes. My goal really is to have a simple .php stats page or maybe learn how to make it into GD in the future.

Any help would be great this what I was able to do so far:

Code: <?php
$myFile = "C:lalalalalalainfo.ini";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;


Thanks,
No comments posted yet

Your Answer:

Login to answer
172 Like 44 Dislike
Previous forums Next forums
Other forums

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

email form (cannot find the problem)
Hello there. I've been having trouble with an email form. Can't find the problem really. I've tested

php calculate
this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNum

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Cursor statement failed with errors
Following statement failed with the errors.

cursor proj_cursor1 is (select projectID from

Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages.

Dynamic links in an include file
I am working on a small piece of code that counts records from a database and displays the result to

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

[function.file]: failed to open stream: No such file or directory
Okay I wrote this little script to upload a csv file that is located on my webhosts server to a mysq

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash