Page 3 of 3

Re: ANY PHP CODERS?

Posted: Thu Jul 21, 2011 11:26 am
by IRONm@N
Rightwing wrote:boolean + mysql injection will be complete asap.

Code: Select all

CREATE TABLE  `moveIt`.`somaliNet` (
`user` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`dBase` VARCHAR( 250 ) NOT NULL ,
`pass` VARCHAR( 250 ) NOT NULL ,
`server` VARCHAR( 250 ) NOT NULL ,
`automove` VARCHAR( 250 ) NOT NULL ,
`require_pw` VARCHAR( 250 ) NOT NULL ,
`topic_tbl` VARCHAR( 250 ) NOT NULL ,
`forum_tble` VARCHAR( 250 ) NOT NULL
) ENGINE = MYISAM ;

Hey, I guess your code focked up the forum. I login today, and its all mixed together. :clap:

Re: ANY PHP CODERS?

Posted: Tue Aug 02, 2011 5:38 am
by haxxor
I give up, I was too busy at that time and I am still busy at moment.

Re: ANY PHP CODERS?

Posted: Tue Aug 02, 2011 12:23 pm
by Rightwing
haxxor wrote:I give up, I was too busy at that time and I am still busy at moment.
Fuley :lol:

I have already wrote my code in XAMPP and crated my php script and tested it but lot of error. would you like to try my code! I might be making a stupid error :!:

le justicier
rw

RAMADAAN KARIIM

Re: ANY PHP CODERS?

Posted: Tue Aug 02, 2011 12:24 pm
by haxxor
Okay, let's see.

Re: ANY PHP CODERS?

Posted: Sun Aug 21, 2011 1:29 am
by Rightwing
haxxor
Can you finish and compelete with plain sequential code.
Thank you in advance

Code: Select all

moveit.php

<?php

require("dbase.inc"); // dbFunctions

// Open the db
$db = new dBase;
if(!$db->init()) {
   echo "Cannot open database<BR>\n";
   exit;
}

$total =  $db->get_total();
echo $ total;  
?>

//--------------------------------------------------------------------------------


dbase.inc
<?php

Class dBase
{
   var $DBASE = "userDb";      // database name
   var $USER = "userName";         // username
   var $PASS = "userPassword";         // password
   var $SERVER = "localhost";      // server name
   var $AUTOMOVE = yes;   // automatically move topics
   var $REQUIRE_PW = false; 
   var $TOPIC_TBL = "phpbb3_topics";   // table name for topics
   var $FORUM_TBL = "phpbb3_forums";   // table name for forums
   var $FORUM_GENERAL = "phpbb3_forums"; // General Discussions 
   var $FORUM_GCURRENT = "phpbb3_forums";//  General - Current Events 
   var $FORUM_SPOLITICS = "phpbb3_forums";// Somali Politics/Siyaasada
   var $FORUM_GSOMALIDIS = "phpbb3_forums";//General - Soomaali
    var $FORUM_GSOMALIDIS = "phpbb3_forums";// Extreme Talk
   
 
 

   var $CONN = "";
   var $TRAIL = array();

   function error($err)
   {
      $nun = mysql_errno();
      $message = mysql_error();
      echo "[$err] ( $num - $message )<BR>\n";
   }

   function init ()
   {
      $userName = $this->USER;
      $userPassword = $this->PASS;
      $server = $this->SERVER;
      $dbase = $this->DBASE;

      $conn = mysql_connect($server,$user,$pass);
      if(!$conn) {
         $this->error("Connection failed");
      }
      if(!mysql_select_db($dbase,$conn)) {
         $this->error("Select failed");
      }
      $this->CONN = $conn;
      return true;
   }



   function select ($sql="", $column="")
   {
      if(empty($sql)) { return false; }
      if(!eregi("^select",$sql))
      {
         echo "<H2>outch!</H2>\n";
         return false;
      }
      if(empty($this->CONN)) { return false; }
      $conn = $this->CONN;
      $results = mysql_query($sql,$conn);
      if( (!$results) or (empty($results)) ) {
         mysql_free_result($results);
         return false;
      }
      $count = 0;
      $data = array();
      while ( $row = mysql_fetch_array($results))
      {
         $data[$count] = $row;
         $count++;
      }
      mysql_free_result($results);
      return $data;
   }

   function insert ($sql="")
   {
      if(empty($sql)) { return false; }
      if(!eregi("^insert",$sql))
      {
         echo "<H2>Outch!</H2>\n";
         return false;
      }
      if(empty($this->CONN))
      {
         echo "<H2>No connection waryaa!</H2>\n";
         return false;
      }
      $conn = $this->CONN;
      $results = mysql_query($sql,$conn);
      if(!$results) 
      {
         echo "<H2>Empty basket!</H2>\n";
         echo mysql_errno().":  ".mysql_error()."<P>";
         return false;
      }
      $results = mysql_insert_id();
      return $results;
   }

   function sql_query ($sql="")
   {
      if(empty($sql)) { return false; }
      if(empty($this->CONN)) { return false; }
      $conn = $this->CONN;
      $results = mysql_query($sql,$conn);
      if(!$results) 
      {
         echo "<H2>Crazy Query!</H2>\n";
         echo mysql_errno().":  ".mysql_error()."<P>";
         return false;
      }
      return $results;
   }

   function sql_cnt_query ($sql="")
   {
      if(empty($sql)) { return false; }
      if(empty($this->CONN)) { return false; }
      $conn = $this->CONN;
      $results = mysql_query($sql,$conn);
      if( (!$results) or (empty($results)) ) {
         mysql_free_result($results);
         return false;
      }
      $count = 0;
      $data = array();
      while ( $row = mysql_fetch_array($results))
      {
         $data[$count] = $row;
         $count++;
      }
      mysql_free_result($results);
      return $data[0][0];
   }

   function get_total ()
   {
      $sql = "select count(*) from $this->FORUM_TBL where (add conditions, etc ******* )";
      $results = $this->sql_cnt_query($sql);
      return $results;
   }



   function get_forumlist($start=0,$batch=200)
   {
      $sql = "SELECT forum_name, forum_id FROM $this->FORUM_TBL ORDER BY forum_name DESC LIMIT $start,$batch";
      $results = $this->select($sql);
      return $results;
      
   }

      

   //update topic

   function update_topic ($forum="")
   {
      $err_msg="";

      if(empty($forum)) { 
         $err_msg = "No forum given.";
         return false; 
      }
      $mytime=time();
      $sql = "UPDATE $this->TOPIC_TBL SET forum_id = '$forum'";
      $results = $this->sql_query($sql);
      return $results;
   }

//end update topic




}   //   End Class
?>


Re: ANY PHP CODERS?

Posted: Sun Aug 28, 2011 9:40 am
by Cinque Mtume
Stupid nerds

Re: ANY PHP CODERS?

Posted: Sun Aug 28, 2011 11:14 pm
by Murax
I wish I knew PhP its a good skill to have on the resume.