GetDotted Domains

Viewing Thread:
"PHP help"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Wed 07/01/04 at 16:59
Regular
"Picking a winner!"
Posts: 8,502
Right I know very little about PHP and have been trying to learn some stuff for a project.
Hopefully someone here can point me in the right direction and let me know if this is possible.


I have a table on a online community that shows things like which users are online, how many posts have been made that day, number of topics, posts etc.
At the moment the information in the table is just made up, what I want to do is use PHP to get the information from somewhere. I know this is usually a database.

For the project though I don't need to use a database, I can just spoof how the information is retrieved. So I was thinking I could put the information into a text file and read it from there.

Is that possible?

Is it easy or would it be easier to just make a small database up for this purpose and use that.

Would appreciate any help or suggestions.
Thanks
Fri 09/01/04 at 16:51
Regular
"Picking a winner!"
Posts: 8,502
Finally got it working today, managed to get a bit of help elsewhere, not really used PHP much before so I guess its going to take a while to get used to and understand. Here's the code in case anyone is interested.

$fp = fopen("test.txt", "r");
$line_data = file("test.txt");
for($i=0;$i $line_elements = explode("¦", $line_data[$i]);
print trim($line_elements[0]) . '
';
print trim($line_elements[1]) . '
';
}
fclose($fp);
?>

Just need to work out a way of displaying the info better now.
Wed 07/01/04 at 23:49
Regular
"Picking a winner!"
Posts: 8,502
Been thinking about it some more and trying some things.
Can get it to write out each character from a line but what I really want is to have a line like:

Number of Users Online | 23

Then to be able to use the | as a seperator character (not sure what its called in PHP) so that I can use the "Number of Users Online" and the "23" parts seperately.

Anyone able to give me a help with this one?
Wed 07/01/04 at 16:59
Regular
"Picking a winner!"
Posts: 8,502
Right I know very little about PHP and have been trying to learn some stuff for a project.
Hopefully someone here can point me in the right direction and let me know if this is possible.


I have a table on a online community that shows things like which users are online, how many posts have been made that day, number of topics, posts etc.
At the moment the information in the table is just made up, what I want to do is use PHP to get the information from somewhere. I know this is usually a database.

For the project though I don't need to use a database, I can just spoof how the information is retrieved. So I was thinking I could put the information into a text file and read it from there.

Is that possible?

Is it easy or would it be easier to just make a small database up for this purpose and use that.

Would appreciate any help or suggestions.
Thanks

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Wonderful...
... and so easy-to-use even for a technophobe like me. I had my website up in a couple of hours. Thank you.
Vivien
Simple, yet effective...
This is perfect, so simple yet effective, couldnt believe that I could build a web site, have alrealdy recommended you to friends. Brilliant.
Con

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.