Coder Profile - Show off your skills, get a coder profile.
 
 
 
code pin board PHP-GTK Port Scaner Download Source Code
Author Details Code Information
Craige ( Craige Leeder )

Pinned 2 Codes
Posted 0 Coding Articles

Send A Message
View Coders Profile
Language PHP (Hypertext Preprocessor)
Expires Never
Length 4,344 Characters (163 Lines)
Password no password
Description

Fatal error: Using $this when not in object context Line 153
  1. <?php
  2. /*
  3.   ******************************
  4.   * Port Scanner *
  5.   * Main Window Class *
  6.   ******************************
  7.   */
  8.  
  9. if (!class_exists('gtk')) {
  10.    die("Please load the php-gtk2 module in your php.ini\r\n");
  11. }
  12.  
  13. class PSWindow extends GTKWindow
  14. {
  15.    private $vbxWrapper; // Wrapper. Will hold a number of GtkHBox's
  16.  
  17.    /****
  18.     * GtkHBox for the Remote Address options (List, Save)
  19.     ****/
  20.    private $hbxRemote;
  21.    private $cmbRemoteAddr;
  22.    private $chkRemoteSave;
  23.  
  24.    /****
  25.     * GtkHBox for the Ports options (List, Save)
  26.     ****/
  27.    private $hbxPorts;
  28.    private $cmbPorts;
  29.    private $chkPortsSave;
  30.  
  31.    /****
  32.     * GtkHBox for the Options Line (Save, Print)
  33.     ****/
  34.    private $hbxOptions;
  35.    private $chkSaveRes;
  36.    private $chkPrintRes;
  37.  
  38.    /****
  39.     * GtkHBox for the Scan GtkButton
  40.     ****/
  41.    private $hbxScan;
  42.    private $btnScan;
  43.  
  44.    /****
  45.     * GtkHBox for results GtkLabel
  46.     ****/
  47.    private $hbxResults;
  48.    private $lblResults;
  49.  
  50.    /****
  51.     * Form Values
  52.     ****/
  53.    private $remoteAddr;
  54.    private $ports;
  55.  
  56.    public function __construct()
  57.    {
  58.      parent::__construct();
  59.  
  60.      /****
  61.       * Set up the Window
  62.       */
  63.      $this->set_title('Port Scanner');
  64.      $this->set_default_size(340,150);
  65.  
  66.      $this->vbxWrapper = new GtkVBox();
  67.  
  68.  
  69.      /****
  70.       * Remote Address
  71.       ****/
  72.      $this->hbxRemote = new GtkHBox();
  73.      /**********/
  74.      $this->cmbRemoteAddr = GtkComboBoxEntry::new_text();
  75.      $this->cmbRemoteAddr->append_text('127.0.0.1');
  76.      /**********/
  77.      $this->chkRemoteSave = new GtkCheckButton('Save This Address');
  78.      $this->chkRemoteSave->set_inconsistent(true);
  79.      /**********/
  80.      $this->hbxRemote->pack_start($this->cmbRemoteAddr, false, false, 5);
  81.      $this->hbxRemote->pack_start($this->chkRemoteSave, false, false, 5);
  82.      /**********/
  83.      $this->vbxWrapper->pack_start($this->hbxRemote, true, true, 5);
  84.  
  85.  
  86.      /****
  87.       * Ports
  88.       ****/
  89.      $this->hbxPorts = new GtkHBox();
  90.      /**********/
  91.      $this->cmbPorts = GtkComboBoxEntry::new_text();
  92.      $this->cmbPorts->append_text('21,23,25,79,80,110,135,137,138,139,143,443,445,1433,3306,3389');
  93.      /**********/
  94.      $this->chkPortsSave = new GtkCheckButton('Save This list');
  95.      /**********/
  96.      $this->hbxPorts->pack_start($this->cmbPorts, false, false, 5);
  97.      $this->hbxPorts->pack_start($this->chkPortsSave, false, false, 5);
  98.      /**********/
  99.      $this->vbxWrapper->pack_start($this->hbxPorts, true, true, 5);
  100.  
  101.  
  102.      /****
  103.       * Options
  104.       ****/
  105.      $this->hbxOptions = new GtkHBox();
  106.      /**********/
  107.      $this->chkSaveRes = new GtkCheckButton('Save Results');
  108.      /**********/
  109.      $this->chkPrintRes = new GtkCheckButton('Print Results');
  110.      $this->chkPrintRes->set_active(true);
  111.      /**********/
  112.      $this->hbxOptions->pack_start(new GtkLabel(), true);
  113.      $this->hbxOptions->pack_start($this->chkSaveRes, false, false, 10);
  114.      $this->hbxOptions->pack_start($this->chkPrintRes, false, false, 10);
  115.      $this->hbxOptions->pack_start(new GtkLabel(), true);
  116.      /**********/
  117.      $this->vbxWrapper->pack_start($this->hbxOptions,true, true, 5);
  118.  
  119.  
  120.      /****
  121.       * Scan
  122.       ****/
  123.      $this->hbxScan = new GtkHBox();
  124.      /**********/
  125.      $this->btnScan = new GtkButton('Scan!');
  126.      $this->btnScan->connect('clicked', array('PSWindow', 'scan'));
  127.      /**********/
  128.      $this->hbxScan->pack_start(new GtkLabel(), true);
  129.      $this->hbxScan->pack_start($this->btnScan, false, false, 10);
  130.      $this->hbxScan->pack_start(new GtkLabel(), true);
  131.      /**********/
  132.      $this->vbxWrapper->pack_start($this->hbxScan, true, false, 5);
  133.  
  134.  
  135.      /****
  136.       * Results
  137.       ****/
  138.      $this->hbxResults = new GtkHBox();
  139.      /**********/
  140.      $this->lblResults = new GtkLabel();
  141.      /**********/
  142.      $this->hbxResults->pack_start($this->lblResults, true, true, 10);
  143.      /**********/
  144.      $this->vbxWrapper->pack_start($this->hbxResults, true, true, 10);
  145.  
  146.  
  147.      $this->add($this->vbxWrapper);
  148.  
  149.    }
  150.  
  151.    public function scan(GtkButton $button)
  152.    {
  153.      $this->remoteAddr = $this->cmbRemoteAddr->get_active_text();
  154.    }
  155.  
  156. }
  157.  
  158. $wnd = new PSWindow();
  159. $wnd->connect_simple('destroy', array('gtk', 'main_quit'));
  160.  
  161. $wnd->show_all();
  162. Gtk::main();
  163. ?>
code pin board Back To Code Pin Board Post New Code
Please login to post comments.
Page 1 of 1
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved