ANY PHP CODERS?

Daily chitchat.

Moderators: Moderators, Junior Moderators

Forum rules
This General Forum is for general discussions from daily chitchat to more serious discussions among Somalinet Forums members. Please do not use it as your Personal Message center (PM). If you want to contact a particular person or a group of people, please use the PM feature. If you want to contact the moderators, pls PM them. If you insist leaving a public message for the mods or other members, it will be deleted.
User avatar
IRONm@N
SomaliNet Super
SomaliNet Super
Posts: 5122
Joined: Tue May 01, 2001 7:00 pm
Location: Jannatul-Fardowsa
Contact:

Re: ANY PHP CODERS?

Post 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:
haxxor
SomaliNetizen
SomaliNetizen
Posts: 973
Joined: Thu Oct 28, 2010 2:48 pm

Re: ANY PHP CODERS?

Post by haxxor »

I give up, I was too busy at that time and I am still busy at moment.
User avatar
Rightwing
SomaliNet Super
SomaliNet Super
Posts: 9248
Joined: Mon Dec 23, 2002 7:00 pm
Location: Maqaamka lagu xadreeyo MEDED, MEDED
Contact:

Re: ANY PHP CODERS?

Post 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
haxxor
SomaliNetizen
SomaliNetizen
Posts: 973
Joined: Thu Oct 28, 2010 2:48 pm

Re: ANY PHP CODERS?

Post by haxxor »

Okay, let's see.
User avatar
Rightwing
SomaliNet Super
SomaliNet Super
Posts: 9248
Joined: Mon Dec 23, 2002 7:00 pm
Location: Maqaamka lagu xadreeyo MEDED, MEDED
Contact:

Re: ANY PHP CODERS?

Post 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
?>

User avatar
Cinque Mtume
SomaliNet Heavyweight
SomaliNet Heavyweight
Posts: 4005
Joined: Fri Mar 06, 2009 5:36 pm
Location: Tres Puntos

Re: ANY PHP CODERS?

Post by Cinque Mtume »

Stupid nerds
User avatar
Murax
SomaliNet Super
SomaliNet Super
Posts: 28303
Joined: Sat Dec 29, 2007 4:45 am

Re: ANY PHP CODERS?

Post by Murax »

I wish I knew PhP its a good skill to have on the resume.
Locked
  • Similar Topics
    Replies
    Views
    Last post

Return to “General - General Discussions”