Ok, first off I am not doing this course,
but after reading a post from another student asking about classes in 2613... well my ego got the best of me and I decided to rewrite my web page in a more OOP way.
(and I know its not needed in year 2, but I like learning this and am impatient, so please help me)
so I have a person class...
a constructor method and a display method that does something like this...
but I have a method to delete this person from the db...
but as this is sitting server side... how do I call this method in the hreff... is it possible, can I do it with a button?
should I even have a method like this?
or just use my previous code: (that works?)
Registered: 13 years ago
You do not call the method in the a href - you merely send the id to the delete page with th a href. There the id is caught and used in the method. It appears a bit of an overkill - I'll just have a simple delete statement since the query is specific i.e. to delete a player. Why write a 4 line function when a one line delete query can do the same job? Not to say you must not.... but OO is not always better. A delete method that can be used with more than one table is useful.
sorry for stupid question previously...
might have another though...
I have a action page...
and depending on the action it will include diffrent things...
//some code here$page = "otherPage";
//what to do here... I need to refresh the entire page or table.. so would like to jump to the above code "Viewall" action...header("Location: ?Controller=Fixtures&Action=ViewAll"); //this does not work (guessing its because of me including this into another page??break;}include('Views/' . $page . '.php');