Help - Search - Members - Calendar
Full Version: Php Question
Linuxhelp > Support > Technical Support
Robert83
Hi,

I installed Squidguard [ managed to do it finally smile.gif ], and I've got myself a awesome porn blacklist (2MB in size).

I'm succesfully dropping all porn sites for all 3 companies.

Now the question I would like to ask is :

If I install PHP (can I do it with yum install php or something?), can I write a PHP page of some sort, that would show the same picture and stuff as my current html page, and + show the users IP adress, and then pass it to some nasty_users.log ? and can anyone help me with it? , some site to learn php? or something?


Sincerely
Robert B
Termina
Yay! smile.gif Did you find that on some site, is there a universal list, or did you do the research yourself? wink.gif *giggles*

Well, enough for my horrible attempt for converstaion and/or humor.

Anyways, you could try this IP counter (I havn't tested it, sorry!)

<?php
$filename = "/tmp/nasty_users.txt" ;

$file = file($filename);
$file = array_unique($file);
$hits = count($file);
echo $hits;

$fd = fopen ($filename , "r");
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;
$fd = fopen ($filename , "w");
$fcounted = $fstring."n".getenv("REMOTE_ADDR");
$fout= fwrite ($fd , $fcounted );
fclose($fd);
?>

This would also tell you how many people have been recorded.

Just put this on your page:

<?php include('url/to/file/index.php'); ?>


/tmp/nasty_users.txt should have the permissions of 777

----
Edit: I'll test this when I get home. Unfortuanly I cannot use putty here. ;-_- "omfg! what is that! HACKER!" Damn computers facing the wall, intead of letting us sit with our backs to the wall. happy.gif
Robert83
Thanx Termina smile.gif

by the way anyone know a very good mp3 - video blacklist ? that is atleast 2MB , or even better 7-8MB ?

SquidGuard : www.squidguard.org

Adult blacklist [this is really good, and up to date April 21 , 2004] : ftp://ftp.univ-tlse1.fr/pub/reseau/cache/...ib/adult.tar.gz
the website is : http://cri.univ-tlse1.fr/documentations/ca...en.html#contrib


Sincerely
Robert B
Termina
Anyone know how to execute a command from a remote computer using PHP? happy.gif

Example: My website has a PHP page, and it wants to excecute the "ps -C gserver | wc -l" command from a computer (that has SSH/SCP enabled).
Robert83
Thanks again Termina,

But the problem is, emm...I'm absolutely new to PHP, how do I put a background picture into it, how do I write text, are the commands same as HTML + the aditional commands supported by PHP ?

then my index.html should be index.php right? any site or how-to with pictures( would be really nice smile.gif perhaps a dream) or something?

Sincerely
Robert B
hughesjr
php pages are HTML .... except the items that you include inside:

<?php

?>

Those items are excuted by the webserver and the result is filled in at that location....so the rest of the HTML is rendered as is and the RESULTS of the php are rendered. That is what makes php so attractive if you have a database .... you can use normal sql tools to adjust the database and when you make a change it is automatically on all your webpages.

This site uses php to store the posts in a MySQL database and when we do a search, it uses php and sql to search the database and display the results.
Robert83
Thank you very much for your fast answer smile.gif


Sincerely
Robert B
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.