[HELP] - PHP Class error thingy.

Status
Not open for further replies.

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Hey,

So when I run this;

$callUserClass->register($username, $passwordmd5, $email, $ip);

And my page I get this;

e549tr.png


Do I have to include something in my class? I'm not sure about this, I tried something but failed..

- Cheers.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Post your class, I fix.

It's nooby, but;

PHP:
<?php
 
class UserClass
{
function register($username, $password, $email, $ip) 
{
$db->query("INSERT INTO `users` (`username`, `password`, `email`) VALUES ('".$username."', '".$password."', '".$email."')") or die(mysql_error());
}
 
function login($username, $password) 
{
$_SESSION['loggedin'] = "1";
$_SESSION['username'] = $username;
header( "Location: home.php" );
exit;
}
}
?>
- Cheers.
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
PHP:
<?php
 
class UserClass
{
function register($username, $password, $email, $ip)
{
global $db;
$db->query("INSERT INTO `users` (`username`, `password`, `email`) VALUES ('".$username."', '".$password."', '".$email."')") or die(mysql_error());
}
 
function login($username, $password)
{
$_SESSION['loggedin'] = "1";
$_SESSION['username'] = $username;
header( "Location: home.php" );
exit;
}
}
?>

kthxbai
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Thread closed, thanks so much, give me your address, I'll give you funky time, kthnxbai.
 
Status
Not open for further replies.

Users who are viewing this thread

Top