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.


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

php sessions,logouts & the bloomin back button!
Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed,

Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.
I am attempti

Preloading images
Posting this question here because I am not sure where this should belong.I am building an asp.net a

Secure pages Sessions vs. Cookies & session_destroy() help
Im new here and new to PHP, I hope you can help me with some questions.

Im writing my web ap

The IE or FF detector
Hello Friends,

Problem of today ( we seek for php help ) as following ,

we know all th

Images in email problem
I found this script for sending emails, it works but if the email has <img src="image.jp

Checkbox info wont include in Mailto
Hey, im new to php.
Basically I have made a form to request which type of job(s) are needed, whic

how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s

how to get different value in second view of webdynpro?
hello guys,

In ABAP webdynpro I am trying to create one application having two views.

Insert Failing.
Hey,
I am making a Sign up page for a website, but the insert query into the Database does not se

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