Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
So here's the code for a ban system on my website:
PHP
<?php
$f = fopen(".htaccess","a+");
fwrite($f,"my text");
fclose($f);
?>
What I would like is for it to prompt for the IP address information ("my text") to add to the .htaccess file, so it's easier to add users to my htaccess file. So I was wondering how I would go about doing this?
Posted
Updated 18-Oct-13 14:41pm
v2

1 solution

PHP does not prompt for anything, as it operates on the server side. PHP script simply generates resource sent to client side, such as HTTP. And it can generate JavaScript, and JavaScript can generate prompts. But still, it makes no sense. You prompt for text, now what? You want to write it to .htaccess, but this is a kind of configuration file, which is supposed to be static data. So, I don't know what do advise, as your goal is unclear to me. Maybe, to learn basics of Web functioning…

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900