Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Web design and Programming (https://novahq.net/forum/forumdisplay.php?f=32)
-   -   More help (https://novahq.net/forum/showthread.php?t=26528)

atholon 06-06-2005 05:10 PM

More help
 
In this code what does -> do?

I simply want to select the password from sql, is there an easier way to do it? The password is encrypted though...

PHP Code:

 if ( $DB->get_num_rows() )
 {
  
$member $DB->fetch_row();
  
  if ( empty(
$member['id']) or ($member['id'] == "") )
  {
   
$this->log_in_form'wrong_name' );
  }
  
  if (
$member['password'] != $password)
  {
   
$this->log_in_form'wrong_pass' );
  } 


JonM 06-06-2005 07:42 PM

did u make a class, or else that won't work...

DevilDog#1 06-06-2005 08:32 PM

Quote:

Originally posted by -Elite-
did u make a class, or else that won't work...
Told him that ...

atholon 06-06-2005 08:57 PM

Yes, it is part of a login script for Invisionboard.

JonM 06-06-2005 09:14 PM

okay i remember what "->" does...it's fairly simple...classes are made for OOP (object oriented programming) in this your sending a varialbe, such as $DB to do something, perhaps
PHP Code:

$DB = new Db_QUERY 

PHP Code:

$member $DB->function();  //is executing a function for a varialbe to go through... 

simple no?

IcIshoot 06-06-2005 09:23 PM

Doing -> just means your referencing the function or variable in side the class.

PHP Code:

class test {
var 
$myvar "test string";

function 
md5string ($string) {

return 
md5($string);
}
}

$myclass = new test();

echo 
$myclass->myvar// outputs Test string

echo $myclass->md5string("Hi!"); //echos the md5 hash of "Hi!" 

IcI

atholon 06-06-2005 10:44 PM

you know what md5 is?

I can post the php files that I got it from if you'd like.

I need to make it so my login can unencrypt the password that the board encrpyts.

Or at leat compair the two so that it can validate a user.

Scott 06-06-2005 11:50 PM

you cannot decrypt md5.. it's a 1 way encryption.

But you can match what the user input when logging in..

$username=addslashes($_POST['username']);
$password=md5($_POST['password']); //will turn there submitted password to a md5 hash.


$query=mysql_query("SELECT * FROM invision_users WHERE username='$username' AND password='$password' LIMIT 1");

atholon 06-06-2005 11:55 PM

Yeah I figured the login out. Now I have to figure out what I need to put in the session and what the session's name is for IPB

JonM 06-07-2005 12:01 AM

IPB and all that is most likely confusing ;) why don't you copy their login script and change needed varialbes? this would work great for registration and stuff on the site and not at the forums

atholon 06-07-2005 12:05 AM

I think it is more complicated to do it your way Elite.

All I have to do is make it so it recognizes the same session. :D

JonM 06-07-2005 12:11 AM

yes but also look through, most boards do this -- they have a function to grab userdata, simply do that then if username = guest (or whatever guest username is...) then don't let them do this or whatever :D

Scott 06-07-2005 12:28 AM

Clear your cache and then go directly to your boards and login.. now open your temp files and you'll see the cookie.. Open it and the names of all the cookies placed by ipb are there ;).

atholon 06-07-2005 12:32 AM

Good idea, I'll check on that.

atholon 06-07-2005 11:12 AM

Looks like what invision does is it creates a session and then stores the variables in a database. I still have no idea how to create the same session.

DevilDog#1 06-07-2005 11:13 AM

Check session ID ...

King 06-07-2005 11:25 AM

ehh, cant you use the session & cookie of the forum ?

DevilDog#1 06-07-2005 11:31 AM

That's what he's trying to use bud

JonM 06-07-2005 12:20 PM

like i said in my last post (in this thread) ... but seeings how nobody listens to me... :p

DevilDog#1 06-07-2005 12:26 PM

Quote:

Originally posted by -Elite-
like i said in my last post (in this thread) ... but seeings how nobody listens to me... :p
Join the club bud. He seems to be zoned out nowadays. :p


All times are GMT -5. The time now is 01:45 AM.

Powered by vBulletin®