Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=339205.0
  2. trq

    Classes

    Classes are used to group together and encapsulate functionality and any data this functionality might need to do it's job. You should read this: http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect It is the first of a 3 part series which is well worth reading.
  3. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=339210.0
  4. You haven't checked your query succeeded before using $result. Your query has failed. Why, most likely becuase of the fact that 'password' is a reserved word in MySql. Change your filed name and try again. You have other issues with your code: session_register has long been depricated and should no longer be used. PS: You posted this in a board with the topic of MSSQL. Your post is way off topic.
  5. I'm not sure anyone is going to be able to explain it any better than the manual. Where exactly are you stuck?
  6. You'll want to run php under fastcgi in IIS. You should find plenty of resources Googling it, including a few official hits on the IIS website.
  7. Did you replace the call to eregi() with a call to preg_match()? Also, I wouldn't remove the default regex from the argument list. Doing so has the potential to break calling code.
  8. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=339130.0
  9. This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=339128.0
  10. Of course it's possible.
  11. Where are you stuck?
  12. A simple mod_rewrite rule in your .htaccess file should do what your after. Something like: RewriteCond %{HTTP_HOST} !domain.com$ [NC] RewriteCond %{HTTP_HOST} ^([a-z0-9-]+).domain.com [NC] RewriteRule (.*) %2/$1 [L]
  13. Yes, un-comment that include, then read here: http://httpd.apache.org/docs/current/vhosts/mass.html
  14. This is a question I wish more people would ask. Using die is often overkill as it kills your application completely, learning to handle situations is often the better choice. And the syntax is simple. For queries that are expected to return data, check that they return data: if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { // $result has data and is good to use. } else { // no data found. } } else { // query failed. } For queries that change data. if ($result = mysql_query($sql)) { if (mysql_affected_rows($result)) { // data changed } else { // nothing changed } } else { // query failed. }
  15. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=339015.0
  16. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=339021.0
  17. See http://www.phpfreaks.com/forums/index.php?topic=277416.0
  18. Hi guys, it's been a long while since I've actually asked a question on these forums but I'm in a bit of a predicament at the moment trying to resolve an issue of what is responsible for what (between my Router & Dispatcher). I have a working Router implemented which takes a series of Route patterns and matches them against a given URL. The first to match successfully will have my Router return a Command object full of all the goodies my Dispatcher needs (name of controller, action and any other parameters). At the moment this Command object would be passed to the Dispatcher to initiate the controller and dispatch the action. It is however right at this same point that I am a little stuck with how to handle things. I would very much like to have the ability (as most frameworks do) to default back to a default Module, Controller & Action if the Route returned by my Router is not dispatchable as is. Here is where the problem lies. What (between the Router & the Dispatcher) do you guys think should be responsible for injecting these defaults? On one had I have a Router which in my eyes should simply match patterns to urls and hand control to something else when it's done. On the other hand, I don't want the Dispatcher to be playing around with what is (at this stage) considered a valid Route. A big part of me want's this to be handled at the Router. I already have plans for another step in the bootstrap process to sit between the Router and Dispatcher but it (this other step) will definitely require knowledge of what is about to be dispatched. However allot of code that I have seen seems to have the Dispatcher attempt to load what the Router has given it, and if it can't the dispatcher itself starts injecting defaults until it can. Any thoughts on the subject would be much appreciated. Thanks. (There is a link to the project in my signature if looking at the code helps)
  19. Your Apache user (www on Ubuntu) will need to be in the groups with sufficient permissions to run desktop applications. I'm not exactly sure what groups this would entail on Ubuntu but on Gentoo, video should suffice. Even then, I'm not sure how (or if) you could get permissions to execute something on another users desktop. You would likely need to have the process su to your own users first.
  20. Get yourself a copy of Apress's PHP 5 Objects, Patterns and Practice. It's the best resource I've found specifically for PHP.
  21. Firstly, use explode to create your array. Secondly, why are you executing two identical queries? Third and most importantly, what debugging have you done? Simply telling us your code doesn't work doesn't help.
  22. Not going to happen. It's hard enough keeping on top of spam as it is.
  23. This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=338872.0
  24. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=338827.0
×
×
  • 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.