-
Posts
39 -
Joined
-
Last visited
Never
Posts posted by Highlander
-
-
The only advantage is that you can have a Control panel to change the source for the site. But the downside is that you need to develop a framework for handling a requests, and generate all output every time (Client can't cache the data)
-
Yea, a database and use views / SP:s to handle the different client.
-
The only problem as far as I know is the fact that you need to know if the data is valid.
So, if the data in the database is updated, the session instance doesn't know about it.
Other then that, it should be ok.
-
how about reading about PDO in PHP?
-
look at __get() and __set() for classes http://se.php.net/manual/en/language.oop5.overloading.php
-
Or you can just use the PDO classes.
-
Just a tought: Is it not better to serialize the object?
-
Sounds like a plan. Don't like the global variable but works for now.
Thanks
-
That will work for simple auth, but the problem is that I must check if a member is member of a given group.
One solution I have thought of was:
<?php if( $logged_in_member->checkIfMemberOfGroup ("Admin") ) { echo "<a href='/delete/id'>delete</a>"; } ?>
The problem with this solution is that I need to store a member object on each page.
Any suggestions?
-
Hello guys!
This is my first post so bare with me here
I'm reading on OOP and MVC pattern and I need some opinions about this code:
<?php class MemberView { # Reference to a model private $model; # Creates a new view from a model public function __construct( $memberModel ) { $this->model = $memberModel; } /* displays the list of members */ public function display( ) { $members = $this->model->getMembers( ); foreach ($members as $member) { $name = $member->getName( ); echo " <p>Name: $name</p> "; } } } ?>
This code just prints out all members. But now to the question:
How do I add access control to this view? I mean if a member that is logged in and views this given page has access to delete a member, then MemberView needs to add a link to a delete action. But how is the best way to do this?
-
<?php $query = " SELECT * FROM PRODUCT ORDER BY URN LIMIT 0, 10"; ?>
-
the = sets the variable and == compares the left and the right side:
$id = 3; // Sets $id to 3 if ($a == $b) { // Checks if $a has the same content as $b }
-
OOP does take more work, but when you getter better at it, you can reuse your code in another place in the project or maybe in another project. Reuse is the keyword when developing with OO paradigm.
help with designing my database
in Application Design
Posted
Read about foreign keys