|
Uncreative Labs PC XT and AT forums
|
Author |
Message |
Puckdropper
Site Admin
Joined: 02 Oct 2004
Posts: 767
Location: Not in Chicago
|
Posted:
Mon May 23, 2005 12:30 am |
|
Can I store data in text files on a web server using PHP? While I've got database access, all I want right now is a very very small store of data (namely, a number, comma, second number) that my web page will allow me to update. |
|
|
|
|
harshbarj
Joined: 01 Oct 2004
Posts: 169
Location: behind you!
|
Posted:
Mon May 23, 2005 3:44 am |
|
sure you can. My memory is a bit fuzzy on how to but I know it's rather simple. (open, print commands like basic)
My games database is written in this way. |
_________________ Raise Your IQ. Eat Gifted Children. |
|
|
|
harshbarj
Joined: 01 Oct 2004
Posts: 169
Location: behind you!
|
Posted:
Mon May 23, 2005 3:47 am |
|
ok here is the code I used to start my game database
Code: |
<?PHP
$TITLE = "wolfenstein 3d";
$ssloc = "images/hires/dos_wolf3d2.jpg";
$desc = "A classic first person shooter. You play as Captain William J. "B.J." Blazkowicz an american spy who was taken prisoner by the Natzis. You managed to keep a knife hidden and killed a guard in your cell. You start the game with just the gun and one round of ammo. Lucky for you most enemy's drop a clip of ammo when they die Overall a good game with great graphics.";
$rat_gr = "3";
$rat_so = "2";
$rat_co = "5";
$rat_fu = "5";
$rat_ov = "4";
$req_pro = "80286";
$req_sp = "12";
$req_ram = "1024";
$req_hdd = "2";
$req_ms = "yes";
$req_sc = "no";
$dl_link = "http://www.wolf3d.co.uk/";
$real_path = realpath ("game_db.dbf");
print "$real_path";
$fp = fopen( "$real_path", "a+" );
flock( $fp, LOCK_EX ); // exclusive lock
fwrite($fp, "1 \n");
fwrite($fp, "$TITLE \n");
fwrite($fp, "$ssloc \n");
fwrite($fp, "$desc \n");
fwrite($fp, "$rat_gr \n");
fwrite($fp, "$rat_so \n");
fwrite($fp, "$rat_co \n");
fwrite($fp, "$rat_fu \n");
fwrite($fp, "$rat_ov \n");
fwrite($fp, "$req_pro \n");
fwrite($fp, "$req_sp \n");
fwrite($fp, "$req_ram \n");
fwrite($fp, "$req_hdd \n");
fwrite($fp, "$req_ms \n");
fwrite($fp, "$req_sc \n");
fwrite($fp, "$dl_link \n");
flock( $fp, LOCK_UN ); // release the lock
fclose( $fp );
?> |
|
_________________ Raise Your IQ. Eat Gifted Children. |
|
|
|
Puckdropper
Site Admin
Joined: 02 Oct 2004
Posts: 767
Location: Not in Chicago
|
Posted:
Mon May 23, 2005 4:52 am |
|
Thanks. I can hit the LRM now and get the syntax of the statements you used. |
_________________ >say "Hello sailor"
Nothing happens here.
>score
Your score is 202 (total of 350 points), in 866 moves.
This gives you the rank of Adventurer. |
|
|
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB
© 2001/3 phpBB Group :: FI Theme ::
All times are GMT
| |