hey, i was wondering if someone could help me with the code i will describe below.
this is what im trying to do:
i want to make a link called grpsuper9.stylehosting.com/log.php
and in that file, i want me to be able to do this
grpsuper9.stylehosting.com/log.php?username=GRPsuper9&password=hihihihi
then, i want the information that i typed "GRPsuper9" and "hihihihi" to be writting automaticly to this page
grpsuper9.stylehosting.com/logged.php
and each time i used this url grpsuper9.stylehosting.com/log.php?username=aaaa&password=bbbbb, it would stack the information in an array i guess... if thats what u call it. by an array, i mean it would stack it like this everytime i went to that url.
aaaa bbbbb
aaaa bbbbb
aaaa bbbbb
GRPsuper9 hihihihi
how would i do this?
Logging Information
Moderator: General Moderators
thanks, that information seems sorta like i want. but cant anyone walk me through the steps? because im new to PHP and i dont quite get all of this stuff 
edit: so i figured out i had to put this into my log.php file
<?php
$file = fopen('test.txt', 'a', 1);
$text="Your text to write\n";
fwrite($file, $text);
fclose($file);
?>
the above code is inserted into log.php. now my question comes to this, instead of just going to the page log.php and it writing it automaticly, how do i make it write WHAT I WANT it to write?
for instance, grpsuper9.stylehosting.com/log.php?message=i want it to log this
how would i make it log what i told it to do? and how would i make it so i would be able to write message in there and after message, it will log it?
edit: so i figured out i had to put this into my log.php file
<?php
$file = fopen('test.txt', 'a', 1);
$text="Your text to write\n";
fwrite($file, $text);
fclose($file);
?>
the above code is inserted into log.php. now my question comes to this, instead of just going to the page log.php and it writing it automaticly, how do i make it write WHAT I WANT it to write?
for instance, grpsuper9.stylehosting.com/log.php?message=i want it to log this
how would i make it log what i told it to do? and how would i make it so i would be able to write message in there and after message, it will log it?
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
Code: Select all
function writeLog ($text) {
$file = fopen('test.txt', 'a', 1);
fwrite($file, $text);
fclose($file);
}
//to call
writeLog ("write this text to file");