Return to Uncreativelabs.net front page Uncreative Labs
PC XT and AT forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

 Store data in Text files View next topic
View previous topic
Post new topicReply to topic
Author Message
Puckdropper
Site Admin


Joined: 02 Oct 2004
Posts: 766
Location: Not in Chicago

PostPosted: Mon May 23, 2005 12:30 am Reply with quoteBack to top

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.
View user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
harshbarj



Joined: 01 Oct 2004
Posts: 169
Location: behind you!

PostPosted: Mon May 23, 2005 3:44 am Reply with quoteBack to top

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.
View user's profileSend private messageSend e-mailVisit poster's website
harshbarj



Joined: 01 Oct 2004
Posts: 169
Location: behind you!

PostPosted: Mon May 23, 2005 3:47 am Reply with quoteBack to top

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. &quot;B.J.&quot; 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.
View user's profileSend private messageSend e-mailVisit poster's website
Puckdropper
Site Admin


Joined: 02 Oct 2004
Posts: 766
Location: Not in Chicago

PostPosted: Mon May 23, 2005 4:52 am Reply with quoteBack to top

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.
View user's profileSend private messageVisit poster's websiteAIM AddressYahoo MessengerMSN MessengerICQ Number
Display posts from previous:      
Post new topicReply to topic
 Jump to:   
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