Jump to content

corbin

Staff Alumni
  • Posts

    8,102
  • Joined

  • Last visited

Everything posted by corbin

  1. What do you mean by 1 mil visitors? As in 1 million unique visitors? 1 mil unique hits? 1 mil hits of any kind? 1 mil users on at any given time (good luck). How many actual hits would you expect in a year? What's the number of hits/second that you would expect per peak time? On a realistic note, I would wait until you need to scale to scale. Perhaps code the site so that it would be easy to add another server or whatever later, but don't waste the money right now on hardware overkill.
  2. The basic concept: Gather all the lines into a vector, then get the size of the vector and pick a random line from 0 through (size of vector-1). Then that's your URL. As for whatever else you said in that post, no idea what you were asking. Side note: If you're scraping google, that's probably against their ToS. (Anyway, look into fopen, fgets and vector.)
  3. There's socket creation in HTML 5? Wooooo!
  4. Session IDs are typically stored in cookies, and browsers typically delete those cookies when closed. As such, you will have to store it in cookies unless you plan on having a user leave his browser open 12 hours. Just remember with cookies, never trust the user data. Instead of having something like: username=corbin loggedin=1 In the cookies, have something like username=corbin password=md5 hash of password (or sha1 or whatever) That way you can actually validate something and not just blindly trust the cookie.
  5. Uhmmm..... And what would be the purpose of that? First thought is a spam bot. Anyway, you'll want to use preg_match_all once you get the content in a variable.
  6. Hrmmm perhaps. If you ran the installer as the user you're logged on as though, that user should definitely have full access. What folder did you install it in? If you installed it in some weird folder, it could be inheriting strange permissions.
  7. Works better than ODBC? Performance wise, less bugs, or what? MS have there own extension for mssql now. Its by far the best I've used, but still, its not a PDO driver. Ive not seen support for ODBTP in Zend either. Yeah, I've used it before since I used to use the old php_mssql extension, then it technically stopped being supported with MSSQL 2000. I used it for a while after that, but apparently it and 2005 don't get along. As for the MS made one, I've used it a bit too, but I mainly just like PDO. Too bad there's not a PDO driver that uses that. Hrmmm... I should probably check to make sure I won't run into any weird issues down the road with PDO_ODBC. I'll have a few BLOB columns so I figure that will give me trouble if anything.
  8. Techie, think you got a beastly enough computer? lol
  9. Ahhh... Yeah. The more I learn about the MVC pattern, the more it makes sense to use it. Hopefully my days of gluing some objects together with some hideous switch statements are soon gone lol. (Although routing isn't with just MVC of course... Definitely seems easier with MVC.) Good luck with that. I've had no end of trouble getting PDO working properly with MSSQL. You'll need to use the ODBC driver, which eliminates Zend from the picture for the moment. Hrmmm.... Crap. Didn't know that Zend_Db didn't have a ODBC driver. I thought it basically had all the drivers that PDO does. I guess if I use Zend (don't know if I'll even use a framework), I'll just use PDO in Zend.
  10. Oooo thorpe, that's a good idea. I'm plan on using MSSQL with PDO, but I see that the PDO fetchObject method has the same functionality. Is like not like a OOP no-no though? Seems kind of ghetto to just pass in all of the values. Then again, I guess without doing a SELECT for every user object created (which would obviously be stupid if like 50 users were listed) that's got to happen somewhere. By the way, gizmola, I read the ZF docs quite a bit the other night, and I think the design idea of the MVC design (or whatever you would call it) finally clicked (I used to not get how the three interacted together, just what each individually was supposed to do), but I didn't come across anything that was directly related to this. I read most of the Zend_Db related stuff, and at one point it linked to an article talking about the active record pattern and rowset pattern and so on which kind of helped. I guess basically I just need to realize that there's not a magical PHP wand that can be waved to make this entirely pretty. You probably already know this, but that's not valid syntax. Was just too lazy to break it into 2 lines. Maybe some day .
  11. What in the world do you mean? I can edit my httpd.conf fine under Win 7 x.x. Are you installing it as an administrator and where are you installing it?
  12. Either rewrite it transparently and don't use a redirect (although if the original page will be accessible too, you will either need to have that redirected to the page that will appear in the URL bar) or use a 301 redirect.
  13. Hrmmm.... I'll definitely take a good look at the Zend stuff (by the way, I haven't looked at MVC as much as I should've by this point, but how is that involved? I guess maybe just the design in a major MVC framework would help me understand?) I think I'm going to go with registry for the database stuff, but I'm stuck on the user filtering... I guess I need to google more ;p.
  14. Wow.... I can actually see this majorly catching on if it's easy enough to use and stable. Then again, I guess most sites don't need that extra speed lol. Nifty though!
  15. Hrmmm.... I bet your host is not running PHP5. If they're not, there's not much you can do unless you have the option to run PHP5 or you use another XML parsing library.
  16. Hi... I have a bit of an OOP design question. The question basically comes down to this: I have a table of users in a database. I want to extract users based on user names, IDs, first name or whatever. I already know I'm going to have a User object, but how should I go about creating/retrieving that user object? (Perhaps I should dig more deeply into some ORM software... Or just use a ORM library lol). Let's pretend I have this: class User { public function getFirstName() { //would return the first name } public function getUserId() { //blah } public function setFirstName() { //would set first name } } Simple enough. But how would you go about populating the data in the user class? If I were just doing object generating like: $u = new User(1); Or $u = new User('Corbin'); That would be easy, but what if I want to do more criteria? Like, how would I design something where I could search for users whose first name is Corbin and are over 20 years old? What would the object layout of this be? The more and more I think about this, the more I think I should use just use Propel or Doctrine. Doctrine seems to have a few issues with MSSQL though.... (Stuck with MSSQL.) Also, I think this is an interesting learning experience. Obviously I need an object that does the work of extracting the users from the DB based on criteria... For example: $users = (new UserFilter())->equals('firstName', 'Corbin%')->greaterThan('age', 20)->getUsers(); Or something like that. That would just build a SQL string, run it and so on. That brings up another question though. What's the best way to go about generating User objects from inside that? Just passing an array of data to the User constructor? Also, how should I pass around my database handle? Obviously I want to avoid globals. I also want to avoid a singleton, and passing the DB handle as an argument seems ghetto. Should I have a factory or something, or is passing it the way to go? Now to go read the OOP tutorials again and to look at Doctrine/Propel code . (Hopefully the tutorials don't cover this situation... Otherwise I'm going to feel stupid ;p.)
  17. Have you tried doing some benchmarking? It might be kind of ghetto, but you could temporarily just throw in some code to time some specific parts of code.
  18. I bet that's super expensive! Cool though.
  19. I started a tutorial/blog-ish type thing about common programming blunders that people new to programming make. Never finished it though x.x.
  20. Uhhhh? What? That's probably just a timestamp of 0 adjusted to your timezone.
  21. Uhhhh..... I think GA shows referrals from all search engines, not just Googles. By the way, if you mean that you want to figure out what placement your site is in the search results for a term (like 3rd for "potato" for example) then that's not possible. Well, technically possible, but the only way I know of to do it on google is to google it then click through the results until you find it (or make a script that does that).
  22. Why in the world is this in Math Help? Also, to the OP, no one's going to code it for you unless you're willing to pay. Have you tried anything? Or researched anything? Have you looked into AJAX? (Or do you want to do it with Flash or Java or something?)
  23. So, uh.... Why use a knock off of GA when you can just use GA? Or are you trying to stick to open source or something?
  24. Edit: Someone else posted, but posted it anyway since it gives another option. Strings in PHP are essentially binary safe, so what you can do is something like this: $str = chr(4) . "Hey... Here's something to everyone!" . chr(255); Another option could be sprintf: $str = sprintf("%c%s%c", 4, "Hey.....", 255); Or even: $str = sprintf("%c%s" . chr(255), 4, "Hey.....");
×
×
  • 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.