Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Ok i'm pretty comfortable with PHP but this is getting the better of me.

 

Aim: to create a web page that allows end-user to append a domain url (eg: example.com) to a dansguardian blocklist

 

I have a perl script that does it, and can suss how to pass data from a textbox in PHP, and know to use

fopen("FILENAME", "a+")

to open a file to append data to the end of it.

 

However this isn't happening nor do i know the correct coding structure to achieve this..

Posted

From Tizag:

 

$myFile = "testFile.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "New Stuff 1\n";
fwrite($fh, $stringData);
$stringData = "New Stuff 2\n";
fwrite($fh, $stringData);
fclose($fh);

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...