Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. To elaborate on what fenway stated, in the context of apache, each script is running in its own thread, and thus its own connection. If it didn't work this way, mysql_insert_id would be useless. One other thing about a mult-insert is that it is by its definition, an atomic operation. This is important in mysql with myisam for example, which does not have transactions at all, and only does table locking. So in summary, no there is no way on a multi-row insert could end up with a non-contiguous range of id's.
  2. While it is fairly common knowledge that the server has a visitor's IP address available, by disclosing it to the public, you would be stripping a level of anonymity from some visitors. Doing a reverse IP lookup might lead other users to be able to identify the visitor or their place of origin. Since there is no public value to doing so, you're simply going to invite criticism, and angry users who will be asking why you are displaying their IP's to the public so they can be harvested by crackers. As for needing 2 queries -- no you wouldn't. Just the original query, and a helper function that goes through the results and builds an array with a count element for the anonymous users.
  3. Perhaps, but your use case was displaying the last 10 visitors. With anonymous users there is no real information being provided, as you pointed out. A fair compromise might be: 4 Anonymous users George Washington
  4. Displaying the IP addresses of visitors is a bad idea. I personally would remove all Anonymous visitors from that list --- of what value is it?
  5. I'm not entirely sure I understand your problem. Clear cut examples would help. Generally speaking however, "Redirects" and "rewrites" are 2 different things. From your list, you have no active redirection rules -- only rewrites. The 4 rewrites you have are pretty clear cut: RewriteRule ^logout.html$ index.php?a=k&jsat=log_out RewriteRule ^login.html$ index.php?a=k&jsat=login_form RewriteRule ^profile.html$ index.php?a=k RewriteRule ^preview.html$ index.php?a=k&task=preview Could you provide a specific example of what is not working in regards to these rules?
  6. There must be something in the code of the system that explains your timeout/logout/login problem. Does it use sessions?
  7. I didn't think he'd ever agree to accept the Mod badge. Great day for phpf!
  8. Based on your description something like this should work: select b.*, e.* FROM eventbooking_bookings e JOIN eventbooking_events b ON e.id = b.event_id AND b.applicant_id = {whatever applicant id} AND e.calendarid = 1 AND e.dt > NOW()
  9. Once you have a problem solved, please mark your thread as solved. If you now have a new question, as you are indicating here, please make a new thread.
  10. Amen to Fiddler2. That's a tool too few people seem to know about, but then again, these days, if you're doing Webdev on a Windows machine, you're not cool
  11. Serverside web development is challenging in that you are typically debugging code that is running on a different machine (the server) and getting it setup is not easy for many people. In some team environments getting debugging setup borders on impossible and so people make due. There are two php debuggers available: xdebug and zend debugger. I only have experience with xdebug, but there is an article i wrote back in 2010 that covers a lot of this territory: http://www.flingbits.com/tutorial/view/xdebug-for-developing-debugging-and-profiling-php.
  12. MySQL also has a client charset that in cases like this, often does not default to UTF-8. For this reason many people build a call into their database class to set the client charset explicitly. Many people do this by issuing this query just after they connect to the database: SET NAMES UTF8
  13. Speaking in general terms, you want the character set to match across the board, from the browser to the client database connection to the database/column. Your best bet is to use UTF8 for everything.
  14. Javascript is probably harder to learn than PHP, but the 2 languages share a lot of the basics. The essential thing to understand is that they serve different purposes. PHP runs on your server, and javascript runs inside the browser. You really need both to develop the type of site you want to have. You can play with a lot of different cms's at opensourcecms.com, including the 3 I mentioned.
  15. For administration of assets, I'd suggest you look at one of the popular CMS/Blog packages. The most popular ones are in no particular order: Joomla, Wordpress and Drupal. Alternatively you could write a basic CMS for your own personal use that would let you handle file uploads to the site. The rest of the UI features you are looking to have can be done with javascript, and a bit of ajax in some cases. A popular building block for implementing photoboxes and overlays and making ajax calls is jquery. Jquery is a foundation library that can be supplemented in all sorts of ways using addon libraries and plugins. This of course is going to mean that you learn the basics of javascript. Even though jquery is easy to use, you'll have issues if you don't at least understand the basics of the language.
  16. Where sites allow it, there are ways to store credentials and then make API calls to that site. This might be a possibility, however, an even better way to do this, if we're talking gmail, is to use gmail's imap api. There are also ways for sites to share authentication (primarily it's through sites implementing authentication trust using openid. There is no way that google will extend trust to your site, but you could implement trust of google (or facebook or twitter) and allow people to login to google first, and then accept that as authentication of your intranet site. What Requinix was pointing out is that most sites maintain session using cookies. You can't share cookies across sites of course. In the case of gmail, the client app is a giant blob of injected javascript, and there is no way even if you proxy the session through an elaborate series of curl calls, that you will ever get anything functional. I may have the facts incorrect,
  17. You were misunderstanding the way the mail function works. The 5th parameter is for switches that are passed through to the MTA which actually delivers the mail. You don't need it, and as you've seen it's disabled on your system. You set your from address in the $headers parameter: $headers = 'From: you@yourhost.com';
  18. You will need to elaborate on what "not working" means. You can also put your code inside either [code] [/code] or [code=php:0] [/code] Tags. I edited your post this time.
  19. gizmola

    VC?

    It pretty much depends on what the controller needs to do. If the controller needs to work with data, that is where models come into play. All the work you need to do with persisting or serializing data should be in models. You typically inject the model data into your views, so they can work with that data, but the view simply displays the data, or gathers user input. The models should always handle the persistinng of data, or querying etc. if that data is in a relational database.
  20. You can actually use the service interactively, so if you ever get one of those bugs where it's "So and so says the site is FUBAR on IE 6 on XP", you can actually jump into an IE6 environment and load your site up interactively and see if they are full of crap or not. The only environments they don't have are Mac. Last I talked to them they even have an IPAD cluster, but I think that is stilll in beta. Just a great idea, well executed so far.
  21. Many people don't realize that phpf is run by volunteers. Most of us are pretty busy, and we aren't the best at getting these projects deployed, but we do seem to manage to keep our head above water most of the time.
  22. Have you messed at all with Sauce Labs? One super sexy feature they have is the video recording feature. So not only do you get the test results, but you can watch a playback of the app running on a particular browser/os combo. They have a free trial to play with.
  23. I second the use of Git. If you can afford to, spend a few bucks on a private github account, or you can setup your own remote repo if you're so inclined. Then you can take advantage of its features to handle the deployment of your code to production. Best practice would be: You tag a particular version of your development app using the tagging convention of your liking. Something like "v1.00.builddate" is my particular preference. In git this is very easy to do, although you want to create an "annotated" tag, as described here. You can then push the tag to the remote repo: git push --tags Then your deployment script for production literally involves something as simple as this: cd /path/to/prod/dir git checkout master git pull git checkout This typically takes a few seconds at most to run.
  24. Selenium is some pretty cool stuff. You can also utilize the services of Sauce Labs which lets you deploy your selenium tests in the cloud and run them against a slew of different browsers and OS. I had planned to do a writeup about Sauce Labs but haven't gotten around to.
  25. Directly in mysql you can try this: SELECT id, points, @row := @row + 1 as position FROM ffa_points JOIN (SELECT @row := 0) as t WHERE matchid = $matchid order by points desc However, assuming you have to display the rows, you can also do it procedurally in your fetch loop and display the position that way.
×
×
  • 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.