Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Posts posted by Edward

  1. Usually when i created a Yii app on the localhost, i have this arrangement

     

    C:/xampp/htdocs/yii-1.1.10

    C:/xampp/htdocs/testapp (testapp being generated by Yiic at the Yii application)

     

    I can see that this folder yii-1.1.10 has to be there for the framework to be able to run as well at the yii files i have in the testapp which was generated. But if i install this on a hosting server i don't want to have to put www.mydomain.com/testapp/index.php to be able to run it i would prefer to run this from www.mydomain.com/index.php. So my question is it safe to have the yii-1.1.10 folder in the same area as the index.php for testapp. Or how should we go about doing this? Do we also need to change file permissions of every folder or is the way Yii default has them already okay? These may seem dumb questions but this is my first time with a live host.

  2. I hope this will not offend anyone i should of probably kept this till Halloween but i have a nice way to remember Foreign Keys. Well the fact is with foreign keys is that if there are constraints say with say a user having a Bank Account (parent) and possibly having one or two loans (children). If you try to delete the users Bank Account (parent) first without deleting the loans (children) first you will always get an error due to the constraint. So the way to remember is "You must kill the children first before you kill their parents", this may sound horrible and its definitely not something i would do in the real life, but i thought it was cool way to remember this stuff.

     

    FOREIGN KEYS - "You must always remember to kill the Children first before you kill their Parents"

    "HeHeHe"

  3. Yes, in my web app I need the user_id both stored in a session and database. I dont understand why user_id will be a problem but usernames and email addresses won't be a problem. Don't they have same level of vulnerability if stored in a session?

     

    Well you could think of i this way, the less information you can provide a hacker the better. They will already have the user name to work with, and if you give them a user_id also they have two.

  4. Yes, if you need the iD. store it. The problem with Using user id is that everyone knowns numbers. If you use usernames or email adresses, you won't have that problem.

     

    The thing with user agent is to force a new login if the users switches agent. That'll probably never happen for the legit user, so it's more like a security. Chanses are, if it's not the same agent, it's someones hacking

     

    Yes and Admin on a major site can have user_id of 0 or 1 in the database, so people know what to look for. I like the ENUM data type so you that way you can distinguish between a member and the administrative side.

  5. Larry do you watch the TV series 'The Walking Dead'? Season 3 is starting in the Fall, that's around the time that your new Advanced PHP book is coming out.

  6. The REQUIRE can cause a fatal error, it means that the files cannot be found and the script will stall at that point and no longer run like it would if you have a INCLUDE. You need to check you have the mysql.inc.php script in the correct folder, check files on the server make sure the URI is correct and order of folders. That's usually what leads to this kind of error.

    • Upvote 1
  7. I was checking out Ebay.com and i saw the time on some items in PDT, then i checked ebay.com.sg Singapore, it shows the time in SGT. Does that mean Ebay will store the times in UTC and then convert with the SQL CONVERT_TZ function to the location of where the ebay site is located?

     

    I tried the CONVERT_TZ on my localhost but i got the NULL reading back, i guess i will leave that for later on installing the UTC times.

  8. Thanks for taking your time to answer my question, i like to hear your opinion. Well it appears that your books will be out in the time frame in which i require them, so i am very happy about that.

     

    You commented "Frankly, I don't know how you remember anything going through as many different books as you do!"

     

    Well part of that will come down to the temporal lobe and hippocampus of my brain. I also have to believe in myself which results in a positive mental attitude. I am aware that reading many books can make your broad but it won't make you exact. To become exact you need to practice. I wish i was just able to read one book, put a smile on my face and then happily start coding, but unfortunately this is not the case. Even if i were to read and practice every book you had, i am sorry to say it is not enough for me to complete what it is i have to do. And neither on the market there is any single book that can gear me up for such a website i wish to complete.

     

    I believe in staying positive and reading as much as i can, i don't forget everything, i remember the important points which relate to my project from each book, and i am aware were these points are and in which book. So later I will come back to reference these points at each stage of the project.

     

    You mentioned being in a muddle if start to build in yii when i learn, well i can tell you i did almost finish the yii book that was out, but again, that book does doesn't cover even 10% of what i need to do. And i don't believe any books that come out are going to be enough. So i believe regardless of doing the books or not, the muddle is going to come whether i like it or not. I love to read your books more than any of the authors, but as you know they are just starting points, and at some point you will have to get your hands dirty.

  9. Larry when is the Yii book due to come out? And also when do you think you will finish

     

    PHP 5 Advanced: Visual QuickPro Guide (2nd Edition) 3rd Edition,

     

    I really want to do this new book instead of the 2nd Edition that i have.

     

    Larry if you have planned your project all the database design and functionality, would it be a good idea to start building that in Yii along side learning Yii. Rather than going through all the three Yii books, and may be forgetting stuff and going back again to do them all? (Just one thing i want to add, i will not start Yii books until i have finish David Powers, all of Matt Zandstra and lastly your new OOP Advanced PHP book, i am a man of integrity)

     

    Another question i have is if you are doing a big website is it best to leave out the javascript first and get it to work with MySQL and PHP first then add in the javascript later?

     

    Lastly i worked through your SQL stuff in the last two days, they were awesome chapters packed with more stuff than you can imagine. Ive actually know people before to do all the date formatting in php rather than using the SQL functions to do it, so it was good to see that being done on the lower level. I hope Yii has a way to incorporate the low level SQL stuff.

  10. I am ordering the comics because the TV series is based on them, so want to give them a read to compare, awesome series. What i am surprised about is how Rick Crimes "Andrew Lincoln" main actor is from England but can but that cool american country cowboy accent on, just seems strange why America is such a big country but they picked him. Characters are and so in the series are supposed to resemble the comic book characters.

     

    I have been writing code Antonio, i done most of my practice in the David Powers OOP book first section, but now i paused on that book after section 1 to get the Larry PHP and MySQL book done, i am also doing review and persue sections in there all the questions and exercises. Last week i wrote the biggest sticky forum i have ever done with all the inputs in, it was fun and i got it all to work 100%. I do want to do my study in the correct order, After the book i am on now i will go onto finish the Coffee shop in Effortless E-commerce. I noticed that Larry is changing the Advanced PHP book, so i may do some other books until this one comes out, maybe go back to finish David powers, that new book Larry he has coming out is awesome, its stages you up for the frameworks, and i saw he will have introduction to Zend Framework. I am going to learn Yii, because i believe it to be better than the other frameworks, and you can also incorporate Zend framework into it, it also handles jquery, which code ignitor does not do as well. There was some people at Rackspace that supported me on the fact that Yii was the right way to be going.

     

    I am getting the Javascript book, i have worked through say 1.5 books on it already, i am not sure when i am going to study that book right now, the problem is i have learned some stuff then forgotten it, so that's why i was concerned with the order i was learning in so i can pull all together at once, let alone css and html, css which is tough. I want to make a multiple user E-commerce site, a German programmer told me to look more closely at factory patterns. Its difficult to really discuss design patterns at this point, i will need to finish Larry's books and the Yii books and those design patterns books, plan my databases and write down all the site functionality and then start to figure out which ones to use.

     

    I actually wanted to say looking at the design pattern books available, i think matt zandstra maybe the best one, because he has examples and also shows those patterns in practice and with PHP. I didn't have a problem understanding all the stuff in his book. I come from a background of higher Maths, so i understand well algebra and manipulation of variables, which seems to be the most part of coding.

     

    Ive checked out some of JREAMdesign video's before, i saw some design patterns video's on Youtube but unfortunately i find the Indian accents very frustrating. I like this one of building a basic MVC by Johny White:

     

  11. Jonathon is right: You might read the first few chapters of Zandstras book, but it is way more advanced than Powers'. You should really understand what Powers do before you take a close look at Zandstras book. I'm not digging Zandstras writing style, as he makes pretty basic things like Exceptions hard to understand. Therefor, wait with it, or read it but don't expect to understand everything straight away.

     

    As to patterns and such things, Zandstra is definitely a very good read. Please note that patterns are not like "the holy grail" or something that supersedes everything. Patterns are for solving common programming difficulties. You should be sure you need a pattern before deploying it.

     

    The book "Design Patterns" by Christoffer G. Lasater is also very good. I'm not done with it, but he explains hard-to-grasp patterns relatively easily, just like Larry is an expert on. The book is for Java, but for this kind of code, you won't have any problems understanding it or using it in a PHP-context. PHP and Java are very similar.

     

    Hey Antonio, I'm about to make my purchase on Amazon today for the new Larry's Javascript book and also these design patterns book you are recommending "Design Patterns" by Christoffer G. Is there anything else you recommend i get before i put my order in? I'm also going to order The Walking Dead "Robert Kirkman" comics books to see what they are like while waiting for Season 3 to start in the fall.

  12. I went through a lot of online help which ended up not working, so i decided to call it quits and just completely reinstall a new version of XAMMP. After the installation phpunit worked out fine. I thought with that Jeffrey Winesett book that some of the phpunit testing was quite trival, and the application could of just been tested the usual way we do by simple debugging, so be quite honest phpunit seemed a little over the top. Much of the debugging work comes is all about a good level of common sense.

  13. Duplicate form submission is something that is really bugging me, ive seen this problem happening on some major php websites. Where someone will submit a form and maybe double click the submit button or click it multiple times, therefore we end up with multiple records in the database. Ive also seen this happening when people either reload the page after submitting by clicking the browers back button.

     

    I am aware if you are in using javascript with your forms that you can get around this problem by disabling the button elements after an onclick event, but on the other hand if the user has javascript disabled in their options it will still happen. I have seen in the O'rielly Php Cookbook a method they use where you can add a token into an sql lite database and then recall the value to see if the token was already submitted.

     

    So Larry and others here, how do you handle such problems on website with multiple transactions. And Larry, this would be something very useful for people useful if added to a later addition of this book.

×
×
  • Create New...