Current location: Hot Scripts Forums » Programming Languages » PHP » issue With a script i made a while ago


issue With a script i made a while ago

Reply
  #1 (permalink)  
Old 04-16-08, 05:52 AM
txt3rob txt3rob is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
issue With a script i made a while ago

PHP Code:

<?php

$getip 
$_SERVER['REMOTE_ADDR'];

echo (
'<Center><b>You Shouldnt Be Crawling Here Your I.P Is Now Beeing Banned via Our Firewall</b></center>');

print 
"$getip is now banned from this server";

exec("sudo /usr/local/sbin/apf -d $getip");
exec("sudo apf -r");

?>
now i know the user apache has rights to apf & iptables so is there any way i can make it give me an error to see why i would go wrong
__________________
N00b Coder! One of those guys who collects bits of code and puts them together and carnt really code for himself
Reply With Quote
  #2 (permalink)  
Old 04-16-08, 05:55 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
If you specify a second argument in exec(), it'll return the output in form of array.

www.php.net/function.exec

That might help or tell you what's happening.
Reply With Quote
  #3 (permalink)  
Old 04-16-08, 06:09 AM
txt3rob txt3rob is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
im afriad its been a while since i touched up on my very basic php and carnt seem to understand how to include the output to see if theres an error
__________________
N00b Coder! One of those guys who collects bits of code and puts them together and carnt really code for himself
Reply With Quote
  #4 (permalink)  
Old 04-16-08, 06:13 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Eg:
PHP Code:

exec("sudo /usr/local/sbin/apf -d $getip"$output);
echo 
'<pre>'print_r($outputtrue), '</pre>'
Reply With Quote
  #5 (permalink)  
Old 04-16-08, 06:31 AM
txt3rob txt3rob is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
thank you ill try that now.

i think my sudo file i corrupted so im going to try fix that and then try what you have given me
__________________
N00b Coder! One of those guys who collects bits of code and puts them together and carnt really code for himself
Reply With Quote
  #6 (permalink)  
Old 04-17-08, 09:33 AM
txt3rob txt3rob is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
i get

Quote:
Array
(
)
when putting that to my script under the anouncement of the ip beeing blocked
__________________
N00b Coder! One of those guys who collects bits of code and puts them together and carnt really code for himself
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
use html to open application absvinyl HTML/XHTML/XML 5 09-18-06 02:04 PM
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 2 01-02-06 11:55 PM
Script Request - Made Simple! Nick204k Script Requests 0 09-25-05 10:12 AM
web proxy script id10tn00b Script Requests 1 10-09-04 06:02 PM
security concerns new purchased script Ron_Long_Beach PHP 3 09-23-04 01:45 AM


All times are GMT -5. The time now is 07:42 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.