Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. gizmola

    round corners

    There is no solution for this that doesn't involve images prior to IE9. IE9 supports the border-radius property. Here's an article that shows how it can be used: http://msdn.microsoft.com/library/gg589503.aspx
  2. What is it writing to the html file? What is the purpose of the file. Is it continuously writing data? It seems that this is a script or even 2 that could be scheduled using cron, which is already designed to handle scheduling.
  3. This is kind of why I am asking for advices on how I should start, so that eventually I can fulfill the project... About frameworks, what would happen if I started using one and it died ? (Discontinued...) What you're asking for is the type of information that people have written entire books on. We can't adequately cover the topic here in a few bullet points. Search for "scalable website development". All these frameworks are open source. There is no particular worry if one of them is abandoned -- you have the source code and if you want to fix bugs, or enhance it, you can.
  4. If you implement a script that takes the GET parameter example I provided, then a mod_rewrite rule should not be an issue. It depends a good deal on what routing your site already uses, and whether or not you already have rewrite rules. Consider this example: www.yoursite/some_affiliate_name Has the issue that "some affiliate name" could literally be anything, and could interfere with valid urls you have to existing resources. There is no good reason not to use instead: www.yoursite.com/affiliate/affiliate_name Your rewrite rule for this might be something like this: rewriteRule ^affiliate/([a-z0-9]+)$ affiliate.php?affiliate=$1 [NC, L] That rule will route www.yoursite.com/affiliate/gizmola to the affiliate.php script and pass affiliate=gizmola to it as a get parameter. Google mod_rewrite, mod_rewrite tutorial etc. for articles you can read. Mod_rewrite rules support and typically require regular expressions, and you may be lost without doing some research into those if you don't already know what they do.
  5. This has nothing to do with age, it has to do with fundamental approaches to setting up apache with php. This is not specific to php, the same goes for any serverside language, although some serverside languages do not have apache modules. I will explain this momentarily. To understand this a bit of history is in order. Originally there was no provision made for webservers to run programs, but the NCSA which had created one of the first webservers (in a group that later would form Netscape), first confronted this need, they cooked up a spec for how webservers could be made to call programs. This spec was named the "common gateway interface" or CGI, and lives on to this day in php's $_SERVER superglob, not to mention the ability of programs to be run in CGI mode. CGI programs would get access to certain variables from the webserver, would get GET and POST variables through standard input, and anything they wrote to standard out would be caught by the executing webserver and returned as output (assumed in most cases to be HTML). As CGI caught on and people started writing CGI scripts one of the issues that came up was that it is expensive to run a program as a CGI. It has to be started up, memory allocated, executed, then memory deallocated, and the program shutdown. So the various webserver developers quickly realized that it would be helpful if they provided api's to their webservers that would allow people to write modules that could integrate with the webserver. For apache these extensions are called modules, and in fact a lot of what apache does is based on a series of core modules that come with the server. The PHP developers were quick to write a php module (mod_php) and this is what you are talking about when you mention files being owned by nobody or apache. When you are running a server with mod_php and your php script writes a file, that script is actually executing as the apache webserver itself, and it has the same privileges as the apache webserver, which is typically run as user nobody or apache for security reasons. So if you script needs to create an image for example, then the directory needs to be writeable by apache and the files will be owned by apache. If you know what you're doing from a security and administration standpoint, this is actually a great way to go, because it's very efficient for php to run in apache as an apache module. The place where this is a problem is in SHARED HOSTING. If you are on a shared host, and they have setup apache to run as mod_php, then anyone can write a php script and have it go read anything that apache is allowed to read, and write anywhere apache is allowed to write. Shared hosts of any competence, do not setup apache this way. They instead setup apache to run php scripts in cgi mode, utilizing a wrapper called suExec to change the permissions of the running program to be that of a particular user. On a shared host, this is going to be the user that gets created on the server related to your hosted account. Some of the lost performance can be regained via implementation of fastcgi, which implements some techniques that offset the cost of traditional cgi. To be clear, there is no problem running php with apache and mod_php as nobody or apache. On a dedicated or virtualized server that is what you would want to do. Shared hosts are not going to do that, so the problem should not exist in a shared hosting environment. These days, with so many virtualization vendors out there, I find it hard to recommend to people that they opt for shared hosting, when typically for a reasonable amount of money they can run a virtual server where they don't have to worry about running on a shared host.
  6. You can do wildcard subdomain handling with apache -- but why? That hardly seems justified for an affiliate program. Then there is the /username. That is really just a spin on id=affiliateID. You use a rewrite rule to pick off that first directory and route it to index.php?affiliate=affiliatename
  7. What is going to be happening inside these while loops?
  8. No offense but you are not capable of building a scalable website at this juncture. By your own admission you don't even know the php language adequately. We have a lot of professional php programmers here, and I believe most will tell you that they learn new things on a regular basis. Building a quality website is difficult. There is a lot to it, beyond static html and css. Should you use a framework? Most definitely, if you want to follow the path that most large websites use. Several others have provided reasons to do so. However with most every framework there will come a time when there is something you want to do where you'll need to read code, and you'll be hopelessly lost and frustrated. This may sound pessimistic, but it's realistic. People come here nearly every day and post these same questions. I'd suggest you just jump in and start with a simple website. If you really want to jump in the deep end, I recommend Symfony2.
  9. techker: the point is that if the first query fails OR it does not return a row, there is no reason to do the 2nd query because it will also fail. This is why you need to check the result of the query, and only do that if you have a result AND you were able to get a row to drive the 2nd query. This is simple IF THEN ELSE logic. I could write the code for you, but the purpose of this forum is to help people do for themselves. If you have new code that shows your progress but still doesn't work, we will help out, but so far I've not seen any new code from you that reflects you understand the advice I provided.
  10. The philosophy of symfony's creator was to build an efficient development environment for use at his own consulting firm. He went out looking for things to integrate, or built pieces modelled after other libraries that he thought were perfect. Symfony 2.0 for example, is a Dependency Injection framework based on Spring. Twig was based on a python template language called jinja. Rather than create a new template language from scratch he picked up twig (which was at the time basically a defunct project) and freshened it up. More about that here: http://fabien.potencier.org/article/34/templating-engines-in-php I certainly encourage you to start using one of their cookbooks to learn the framework and in the process delve into the php language elements you don't understand using php.net and google, and of course you're welcome to post specific questions here.
  11. Thanks for this insightful post, I only mentioned tinymce twice already in my two replies. Thank goodness you were here to also suggest the same thing that I suggested twice already --- but at least you posted the link to it. Wait.... I posted the link to it as well.
  12. There is no one answer. getElementId by itself will get an element by the id="key" key, but declaring a variable that points to that element does not change it, or add a new element on top of it, that has a higher zindex.
  13. They are not really comparable. CI was first built back in PHP 4.0 days when PHP oop was pretty minimal. ZF was first built on php 5.0 which had a lot of improvements to the oop, and it has been adapted continuously since then, including a major rewrite this year to take advantage of PHP's newest oop features. ZF is a giant library that has classes to do all sorts of things, and to also be a swiss army knife so you can integrate any 3rd party library you want. I think you also need to consider Symfony framework. There is no doubt that CI is easier to pickup, and the same could be said of CakePHP. They all have an MVC which is the main reason people go looking for a framework as the basis for their application.
  14. What people often do seperate is static assets from dynamic assets. For example, css, javascript, images etc. can be served from a static server infrastructure, and people will often use a low footprint webserver like lighttpd or nginx for those requests.
  15. An optimized join is better than two separate queries. As for caching data, I think you're better off with a data caching technology like memcache or apc rather than using session variables in most cases. Session variables should have the data you need for the session. Sure if you query data that you will be using throughout the session there is no problem sticking it in session variables, but depending on the session handler that is going to be in a database or files more often than not, and that data needs to be serialized between requests. Session variables are not the place for lookup tables in my opinion.
  16. Firefox firebug is a big helper for exploring these types of problems -- using right click inspect for the items in question. Also is how I determined (using the net panel) the libs that were being loaded on the contact page vs the store page.
  17. If you have a link to what you're talking about we might be able to offer more advice. Otherwise we can only guess. Sounds like you have a javascript rich text editor widget like tinymce or something similar.
  18. There is no way for anyone to know that if we don't know what the adss.js library is, and where you got it from.
  19. My best guess is that the store page is not loading the cufon related javascript files that are in the http://luminosityband.com/wp-content/themes/setlist/js/ directory.
  20. That is simply code that looks for character patterns in a post, and replaces those with links to the smiley images. Here's an article that might help on how you could implement this in a simple manner: http://blog.sachinkraj.com/how-to-add-smilies-in-comments-with-php/ This is not a javascript question however. If you're talking about a rich text editor with some built-in support for smilies, then take a look at tinymce http://www.tinymce.com/ which can include smiley markup. Installing the infrastructure needed for these types of things is non-trivial.
  21. You should seek support from the ad network on how to integrate it into your site.
  22. This is the nature of email-- all the fields can be spoofed. With that said, spoofing the from address will earn you points against from spam detection engines, and may cause you to end up on an RBL. It also is the type of feature that can be exploited by spammers.
  23. I wonder what college course is giving out this question, because we had essentially the same question posed here about 6 months back. This is an excellent summary of Footrule distance computation: http://people.revoledu.com/kardi/tutorial/Similarity/FootruleDistance.html You will probably have better luck searching for "Spearman footrule distance".
  24. You can solicit help by posting an ad on the Freelance board.
  25. I personally would lean toward the notification approach. If you have a solid generic design for you notification table, this will work fine, and also can be sharded effectively, since the SELECT needs to find activity for the user in question, and there doesn't sound like much of any need for searching across shards.
×
×
  • 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.