Jump to content

MrBloop

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

MrBloop's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This is the script: I got it from the internet somewhere and wanted to use it on the school server that I manage, but I just needed to create a nice looking front-end which I did in deamweaver...I just linked a button from my dreamweaver to the PHP file that has this function in it... ALL I WANT IT TO DO IS JUST RUN IT FUNCTION...when it people click on the button and it calls this PHP file what you see below is excatly what I get in the browser.... host=$host; } // get IP address public function getIp(){ if(!$ip=gethostbyname($this->host)){ throw new Exception('Error resolving host IP address.'); } return $ip; } // get list of IP addresses public function getIpList(){ if(!$ips=implode(' - ',gethostbynamel($this->host))){ throw new Exception('Error getting list of IP addresses for the provided hostname.'); } return $ips; } // get host name public function getHost(){ if(!$host=gethostbyaddr($this->getIp())){ throw new Exception('Error resolving host name.'); } return $host; } // get TCP ports of Internet services public function getServicePorts(){ $output='Retrieving services ports...Please wait. '; foreach($this->services as $service){ if(!$port=getservbyname($service,'tcp')){ $output.='Error retrieving port of service '.$service.' '; } else{ $output.='Service '.$service. ' runs on TCP port :'. $port.' '; } } return $output; } // get Services by TCP ports public function getServiceNames(){ $output='Retrieving services names...Please wait. '; foreach($this->ports as $port){ if(!$service=getservbyport($port,'tcp')){ $output.='Error retrieving service name on port '.$port.' '; } else{ $output.='TCP Port '.$port. ' is used by service :'. $service.' '; } } return $output; } } try{ // instantiate 'QueryProcessor' object $queryProc=new QueryProcessor('hotmail.com'); // display host IP address //echo $queryProc->getIp(); // displays 64.4.32.7 // display host name //echo $queryProc->getHost(); // displays 'hotmail.com.br' // display IP list //echo $queryProc->getIpList(); // displays 64.4.32.7 - 64.4.33.7 // display services ports echo $queryProc->getServicePorts(); /* displays the following list Retrieving services ports...Please wait. Service http runs on TCP port :80 Service https runs on TCP port :443 Service ftp runs on TCP port :21 Service telnet runs on TCP port :23 Service imap runs on TCP port :143 Service smtp runs on TCP port :25 Service nicname runs on TCP port :43 Service gopher runs on TCP port :70 Service finger runs on TCP port :79 Service pop3 runs on TCP port :110 Service www runs on TCP port :80 */ // display service names echo $queryProc->getServiceNames(); /* displays the following list Retrieving services names...Please wait. TCP Port 21 is used by service :ftp TCP Port 23 is used by service :telnet TCP Port 25 is used by service :smtp TCP Port 43 is used by service :nicname TCP Port 70 is used by service :gopher TCP Port 79 is used by service :finger TCP Port 80 is used by service :http TCP Port 110 is used by service :pop3 TCP Port 143 is used by service :imap TCP Port 443 is used by service :https */ } catch(Exception $e){ echo $e->getMessage(); exit(); } ?> But when I run it in eclipse this is what I get and this is what I want to see in the browser... Retrieving services ports...Please wait. Service http runs on TCP port :80 Service https runs on TCP port :443 Service ftp runs on TCP port :21 Service telnet runs on TCP port :23 Service imap runs on TCP port :143 Service smtp runs on TCP port :25 Service nicname runs on TCP port :43 Service gopher runs on TCP port :70 Service finger runs on TCP port :79 Service pop3 runs on TCP port :110 Service www runs on TCP port :80 Retrieving services names...Please wait. TCP Port 21 is used by service :ftp TCP Port 23 is used by service :telnet TCP Port 25 is used by service :smtp TCP Port 43 is used by service :nicname TCP Port 70 is used by service :gopher TCP Port 79 is used by service :finger TCP Port 80 is used by service :http TCP Port 110 is used by service :pop3 TCP Port 143 is used by service :imap TCP Port 443 is used by service :https I HOPE THIS INFO HELPS
  2. Hey there, thanks for your help and urgent replies so far... Okay I have a script that searches what IP'S are on a server, written in PHP of course, now I created a PHP File in Dreamweaver (Interface) that has a specific button linking to the PHP class/function. I have tested the script on Eclipse and it works there fine... I want to know do I have to have a Database to run this script? I have only ever used PHPMYADMIN to create sql databses for Joomla and Drupal CMS sites, but I really do not know how to run anything else through my localhost besides a cms... So if I need a database and I create it in PHPMYADMIN how do I run this simple script?
  3. Okay, but is there no way that I can test it on a localhost that has MYSQL and PHP? I have XAMMP and Wampserver can these not allow me to test them?
  4. Hi Everyone! I could not find if this topic has been covered before, but I have written a php project in Eclipse and it runs wonderfully in Eclipse, so I have exported the files. I now worked on my HTM frontend in Deamweaver but saved it as PHP for ease of use and have linked a image to the PHP file that will perform my search function but all that comes up in the browser as the PHP code. I presume that eclipse perhaps emulates a local server? and is that why the process wont run? I am not collecting any input from the user or using POST or GET, because the PHP Class just searches all IP ports Displays them. Please Help!! I thank you in advanced for any help....
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.