fwrite

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GRPsuper
Forum Newbie
Posts: 18
Joined: Fri Apr 14, 2006 9:47 pm

fwrite

Post by GRPsuper »

Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


ok, i have a little trouble with php, maybe cuz im a noob... . ok, here is the code i have right now in my php file:

Code: Select all

<?php
if(isset($_GET['username']) && isset($_GET['password']))
{
$file = fopen('test.txt', 'a', 1);
$text=$_GET['password'];
fwrite($file, $text);
fclose($file);
}
?>
the thing is, i want it to write the username in the $text too.... so this is sorta what im thinking of just to help you guys know what i mean

Code: Select all

$text=$_GET['password'] & "<BR>" & $_GET['username']
the thing i want to do, is make it write the username after the password. but thats not the correct coding. and i dont know what else i could think of. can anyone help me?


Jcart | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

$text=$_GET['password'] & "<BR>" & $_GET['username']
the single & sign is a bitwise comparison...definatly not what you want. use a . (period) instead ;)
Post Reply