Jump to content

number9dream

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

number9dream's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Why don't you just parse the htm files for PHP and leave the URLs as they are? [code]AddHandler application/x-httpd-php htm[/code] You might need to adapt this slightly depending on your server config. Remember that [url=http://www.w3.org/Provider/Style/URI]Cool URIs Don't Change[/url] ;) Or, failing that, something like the below would probably do the trick: [code]RewriteRule (.*).htm$ /$1.php[/code]
  2. Presumably, you have other pages at the root of www.domain.com that you don't want to eb re-written? The reason for my questions is that to have an effective rule, you need to identify the pattern that you want to match. At the moment, the pattern seems to be any character whatsoever, which is fine if you want to redirect [i]everything[/i] (i.e. www.domain.com/* to  www.domain.com/members/*). I'm just not sure if that's what you really want to do?
  3. It sounds like you may have multiviews enabled on your server. See http://httpd.apache.org/docs/1.3/content-negotiation.html A quick test would be to call profile.txt or some other extension that you know doesn't exist, and see what your server comes back with ;)
  4. Maybe not the most helpful advice, but [b]never trust user input[/b]! $_REQUEST is supplied directly by the user, and so it is pure madness to call files based on this input. I would suggest that you need to rethink your structure from scratch, if security is something you are concerned about. At a bare minimum,you need to analyse (and sanitise) this data in order that it can only match pages that you intend to be public.
  5. You haven't explained your problem very clearly. Perhaps you could give a real world example? The over-literal answer is RewriteRule ^USER /members/USER [R=301,L] Without knowing more details of your problem, a good answer is impossible.
  6. My blunt comments: It was only by the third version that I had any real idea what the site was about (it's maths tutoring, right? I'm still not sure). In general, I think the design suffers from 'style over content'. Presumably the client wants visitors to the site to achieve something, and the site's visitors have something in mind when they visit. I think the current design causes a number of obstacles to fulfilling either. An example: http://tutor.populateme.com/3/index.php?choice=about The page above appears to be blank to me until I scroll down (at 1024x768). I would expect some kind of prominent (I don't mean flashing text) message about the benefits of this service on this page. For every visitor who takes the time to scoll, there will be many more who just give up instead. Getting the site to look better is one thing, but making the site [i]work[/i] better would give you a truly happy client :)
  7. In general, it depends which browser you use. Both Opera and Firefox cache previous page views (mainly because it makes browsing much quicker). If you want to implement a way to force all users to cache 'back button' page views, you're in for a rocky road, since users can control their own cache.
  8. Forgot to say thanks to Barand for explaining this to me! :) (Don't bite the n00bies, though, eh ;))
  9. [quote]It's not rocket science.[/quote] OK, OK. I did say it was a simple question! ;)
  10. I don't understand why I would take 1 away from the total averages. Can you explain why I need to do this? Thanks again! :) Added: [quote]But you need the old total_averages for the first calculation:[/quote] Ah, OK - I'm not calculating the total correctly, which is why a -1 would work. Did I understand this, finally?
  11. Presumably you mean the cache in the visitor's web browser? If so, there are quite a few things you'll need to do, since different browsers give visitors different caching options. With Internet Explorer, for instance, you might also need a -1 expires header http://support.microsoft.com/kb/q234067/ The only guaranteed way I know is to send the browser to a different URL (even if that means adding a meaningless query string). There's no avoiding the fact that a visitor's cache is their own business, and if people really like a cache of pages, then they'll be able to set one within thir browser. ;)
  12. I should have mentioned that I'm already updating the total number of averages: [code=php:0] $total_averages++; $updated_average=((($current_average*$total_averages)+$new_average)/$total_averages); [/code]
  13. Hi Redarrow, Thanks for the reply. Unless I've misunderstood, the mysql query doesn't really answer my question. I'll try to explain what I'm trying to do: It takes Mr Irrelevant an average of [code=php:0]$current_average[/code] minutes to eat an apple. The time taken has been recorded [code=php:0]$total_averages[/code] times. A new time has been recorded of [code=php:0]$new_average[/code]. What is the updated average ([code=php:0]$updated_average[/code])? My answer: [code=php:0]$updated_average=((($current_average*$total_averages)+$new_average)/$total_averages);[/code]
  14. Hi, I'm having some trouble with a calculation with PHP. It would be really helpful if someone could check my code for me! It isn't anything too difficult: I just need to update an average number. I know the new number, the current average number and the total number of records. What I'm using is the below: [code=php:0] $new_average_number=((($average_number*$total_records)+$this number)/$total_records); [/code] Have I made any errors with this calculation, or should I be doing it a different way? Thanks for any help :)
  15. That's fantastic!  :) You've no idea how long I've being trying to get this to work ;) I altered the code slightly, as the output is tabular data, so a table was more appropriate than DIVs, but other than that it was exactly what I needed. Thanks again! :)
×
×
  • 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.