Jump to content
Larry Ullman's Book Forums

muuucho

Members
  • Posts

    18
  • Joined

  • Last visited

muuucho's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. Sorry for my "rough" post, i thought you had it ready and that you just forget it. Didn't mean to stress you, My post was just meant as a joke. Thanks for the code and all your work!
  2. I want the code for the CMS in the yii2 book to be downloadable in, lets say, maximum 5 minutes, I am stucked and I know that you have it so you better give it to me!
  3. Thanks for your answer Larry. I am just spoiled with your other books where it is more clear. My favorite way of learning is downloding your scripts and play with them while reading the book. I actualy found your ch5 scripts and downloaded them. So now my battle to understand OOP and MVC continue. I also look back to your new "PHP Advanced.." book in order to, like you say, "hammer it home".
  4. Thanks for the reply. I understand that most of the code (or whatever you prefer to call it) might fit in i in Larrys CMS project. But since I haven't got any detaild info about the CMS yet, I am not sure what code will end up in the final result of the project. If I remove code like some suggested snippets is doing in ch5, will MY version of the CMNS project be able to work later on? Sorry but I am not familiar with yii yet, this Is why I bought this book. Also I havent clearly understand OOP yet even thoug iäve been struggeling with class Pet and other examples througout Larrys earlier books. I am a slow learner especialy from books, but when I implemented Larrys procedural CMS in his earlier books and then started to make changes myself, I learnd it, Maybe something is wrong with me, but this is the way I things. Maybe Larry could answer this?
  5. Hi Larry, In chapter 4 you started a CMS project that I am eager to learn more about. I was introduced to genereat scripts with the amazing zii module. Then, in chapter 5 you discuss various things regarding models, you also show by real world example code how it can be done. Now my question: Shall I implement all code snippets in ch5 in the scripts generated in ch4 in order to follow you towards the end of the CMS project? Maybe you could be clearer about when you show code that could/should be omplemented in the CMS projects and not. Great book, anyway!
  6. OK, I will try to take it from there. However the QuickForm2 is not covered so well in your book, you refere to forum on the web wich is fine, but I still feel that I need more real world (and more basic oop script) in order to understand oop once and for all. I think that a script that has features for new-update-delete of posts in a databasedriven table in the book had been great. I mean, thats what I try do in almost all of my small projects. When searching various forums there are comments that says that QuickForm2 is not very useful when you want to extend your forms, nor is it well documented. Maybe someone can post a basic oop-way to handle mysql-based new-update-delete issues of posts?
  7. Hi larry, Thanks for another great book, I bought this new addition in order to learn oop at last. However, I havn't found any part that covers databasedriven tables with add-change-delete features the oop way. Many web-based php applications is about presenting databased data in a table with abilities to add change or delete data/posts using buttons and forms. I know how how to achieve this the procedural way with validation and so on, and now I am eager to learn it the oop way. A simpel loginform is a start but forms with dropdowns, radios, checkboxes would be most apreciated to learn.
  8. I think i've got question 1 after having read in the book again: isset ($tasks[$task_id]) means is there an array element in $tasks whose key is this task_id? Only Q2 is yet to be solved!
  9. Edit. About script 1.3 view_tasks.php Question1: How can the code below see if the task has a subtask by looking at the task's task_id? Question2: Is there a way to determine if the task's parent_id=0 inside the foreach? (I want to add a link to each Main task) // Check for subtasks: if (isset($tasks[$task_id])) { // Call this function: make_list($tasks[$task_id]); }
  10. Yes, I just wanted to hear from someone with greater experience than me that I'm on the right track. I will try to accomplish something like that. Thanks.
  11. Yes, I want to achieve a sticky from like Larry goes through vere nice in PHP6/mysql5 and also in the PHP5 Advanced. However in the Ecom book he is discussing putting the logic in the form process in a separate script so it can be reused several times in different applications. In a project I might have several "change posts" occasions: changing (updating) of posts in various tables that are storing stuffs like clients articles suppliers and so on. What I want to do is making a reusable function for this. In Ecom Larry is showing how to acomplish a reusable fumction for adding new posts to a table via a sticky form. What I try to descibeis the posibilies to achieve the same nice concept when you want to change an existin post. I hope this clarifies what I was trying to say from the start. If not, don't hesitate to ask specificly whats unclear. Best Regards, Muuucho
  12. Hi! The idea of storing the logic in a form process is great since it's used over and over again in many (most in my case) projects. What I can't find in the book is an explanation how to use it in a "change case". Let me explain: Let's say I have a script for displaying contacts that are stored in a table in a db. The script display my contacts in my browser in a dynamic table that is based on this mysql table. The contact list only has first_name and last_name to deal with. (Let's keep it simple here) After each post I have a Change botton that passes the posts id back to the script. The scripts sees the id in the url and creates a sticky form, meaning it displays the posts first_name and last_name from the mysql table. I'd like to change the form_funtion in the book that it suits also this purpose (and only optionaly, since it is used only in this "change scripts") Can anyone give me some thoughts about how to achieve this? Shall I pass the first_name and last_name as some sort of optional arguments?
  13. Hi again. i've done it like this, does it seams OK in your eyes? If remember me is checked the script generates a random number to wich I add salt and then hash it. (By the way, does it do any good to security to add salt or hash it?) It's then stored as a cookie in the users browser and in a new column "cookies" in table "users". I have set the cookie to 4 weeks. If the user returns to the page within this time the loginscript look for the cookie and compares is to all values in the column in the users tables cookies. It finds a match and set the users sessiondata like when an ordinary login attempt is carried out. Also it gives a new 4 weeks to the cookie. Best Regards, muuucho
  14. Jonathon: Simply beacurese I was to lazy to calculate how many sec there are in one week. It should of course have been 60*60*24*7. But if I close my browser and then come back I'm kicked out if my brake is longer than approx say 2 minutes.
  15. what about this: session_set_cookie_params(1200); session_start(); Doesn't this keep you logged in for 20 minutes? If I just add something like: if ("remember me for 20 minutes" is checked){session_set_cookie_params(1200);} session_start();
×
×
  • Create New...