Jump to content

enerjiza

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    msu3sacrowd
  • Website URL
    http://www.auroradigital.net

Profile Information

  • Gender
    Not Telling
  • Location
    Dallas,Texas

enerjiza's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm still relatively new to OOP so I'm not sure if I'm doing this effeciently. Below are 2 examples of how I'm handling classes: class authors { private $db; private $articles; public function __construct($db) { $this->db = $db; $this->articles = new Articles(); } } Is there any other way I can call methods from the articles class without instantiating the articles class in the Authors class? I'm using PDO and passing the connection to the Authors class in the construct, is this the right way or is there a better way of handling this? Any input would be great.
  2. I've been reading many topics and articles about the MVC design pattern. Here is my question. Doesn't phpdoctrine, an Object Relationship Mapper (ORM), work just like the model, and wouldn't Smarty be considered the Controller/View? If you were to combine the technologies?
  3. I believe you need to do the following: foreach ($_FILES['files'] AS $key=>$val) { echo $key . ': ' . $val; } I believe that should output all the file information you're looking for; name, size, and type. Let me know if that doesn't work.
  4. I have been wondering what the point of creating and implementing an interface class is. If anyone could explain this it would be helpful.
  5. I'm trying to count how many entities I have, but everytime I use the count function it returns 1.  Anyone have any experience with counting simplexml arrays?
  6. [code] Function Authenticate( $username, $password, $remember, $refer ) { global $db; $sqlUser = mysql_query("SELECT userID,username,password,access,COUNT(userID) AS count FROM ".$db->dbPrefix."_login WHERE username='".$username."' AND password='".md5($password)."' GROUP BY `userID`") or die(mysql_error()); $row = mysql_fetch_assoc( $sqlUser ); if ( $row['count'] > 0 ) { if ( $remember > 0 ) { $data = $row['username']."_".$row['password']; setcookie("sbn_access", $data, time()+300); session_register('userID'); session_register('access'); $_SESSION['access'] = $row['access']; $_SESSION['userID'] = $row['userID']; session_register('username'); session_register('password'); $_SESSION['username'] = $row['username']; $_SESSION['password'] = $row['password']; } else { session_register('userID'); session_register('access'); $_SESSION['access'] = $row['access']; $_SESSION['userID'] = $row['userID']; } mysql_query("UPDATE ".$db->dbPrefix."_login SET lastlogin='".mktime()."', ip='".$ip."' WHERE username='".$username."'") or die(mysql_error()); if ( empty($refer) ) { header('Location: index.php'); } else { header('Location: '.$refer); } } else { header('Location: index.php?errorID=1'); } }[/code] Here is my function, maybe that will help out.  I'm running on IIS windows 2000.
  7. would starting and setting sessions count?
  8. I am using the following setookie code inside an authentication function within my users class.  It never sets the cookie, but when I run the script in a seperate file outside of the class it works perfectly, any ideas? [code]setcookie("sbn_access", $row['username']."_".$row['password'], time()+2592000);[/code] Yes, I have tried setting the domain and directory.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.