WoodShedd
11-17-2002, 08:24 PM
I only have rudimentary knowledge of php. I've learned what I know mostly by examining other scripts.
Today I had the need to create a form that exports the username and password entered into a dat file. in the format username|password|0 the 0 is always there and is not an option on the forum. It is required by he program that reads that dat file.
So far I've got
<?php
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(
strrev($PHP_SELF),"/"));
$message="username: ".$username."
password: ".$password."
";
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $username."|".$password."|"."0
";
fwrite($make,$to_put);
header("Refresh: 0;url=http://url.com/thx.html");
}
?>
that modifies the file fine but there is the problem of someone flooding the form with multiple user:pass combos. What I'm looking to do is make it so that the form will only accept a submission once every 30 seconds. IP logging would be good too, butI can live without it.(probably too hard for me anyways)
Could someone help?
=THanks
Today I had the need to create a form that exports the username and password entered into a dat file. in the format username|password|0 the 0 is always there and is not an option on the forum. It is required by he program that reads that dat file.
So far I've got
<?php
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(
strrev($PHP_SELF),"/"));
$message="username: ".$username."
password: ".$password."
";
$make=fopen("admin/data.dat","a");
$to_put="";
$to_put .= $username."|".$password."|"."0
";
fwrite($make,$to_put);
header("Refresh: 0;url=http://url.com/thx.html");
}
?>
that modifies the file fine but there is the problem of someone flooding the form with multiple user:pass combos. What I'm looking to do is make it so that the form will only accept a submission once every 30 seconds. IP logging would be good too, butI can live without it.(probably too hard for me anyways)
Could someone help?
=THanks
