Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Php Question
Robert83
post Apr 21 2004, 11:37 AM
Post #1


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Termina
post Apr 21 2004, 01:10 PM
Post #2


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



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


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Robert83
post Apr 21 2004, 02:32 PM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
Termina
post Apr 21 2004, 11:10 PM
Post #4


RMS is my Hero
******

Group: Support Specialist
Posts: 862
Joined: 18-February 04
From: Wisconsin
Member No.: 2,404



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).


--------------------
*Points finger at the author above him* They're a witch! Burn them!
---
Vist my website!
Join me in IRC! Server: st0rage.org Channel: #UnhandledExceptions
Go to the top of the page
 
+Quote Post
Robert83
post Apr 22 2004, 05:30 AM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



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


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post
hughesjr
post Apr 22 2004, 05:40 AM
Post #6


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



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.


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
Robert83
post Apr 22 2004, 05:51 AM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Support Specialist
Posts: 1,439
Joined: 3-January 04
From: Germany
Member No.: 2,069



Thank you very much for your fast answer smile.gif


Sincerely
Robert B


--------------------
Robert Becskei
robert83@linuxhelp.net
--------------------
May the source be with us!
--------------------
AMD X2-3800 @ 2400Mhz
2048MB DDR 400Mhz
DFI Lanparty UT4 NF4 ULTRA-D
GeForce 7800GT
250GB+250GB
Pioneer DVD-RW
17inch Samsung Syncmaster 757NF
WinXP Pro (SP2)/ CentOS 4.3
--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2017 - 11:28 AM