Jump to content

travo1992

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

About travo1992

  • Birthday 12/22/1992

Profile Information

  • Gender
    Male
  • Location
    Australia

travo1992's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I already said that you will have to use js to do it. document.body.innerHTML='' Should do it for you
  2. Dont be. Did it do the job?
  3. Installation instructions are in the documentation. Its a PHP extension (you need to be running a local server). I forgot to mention before, but you should also look at http://code.google.com/p/webgrind/ if you go ahead with xdebug. I believe its te better of the grind viewers
  4. Try if(isset($_POST['Remove'])&&$TotalFields>=0) Im assuming that TotalFields was th variable you were talking aout.
  5. Database indexes - practises such as primary keys on ids, indexing columns that will be referenced, full text searching, etc. (Take that statement loosely, I know that doing tha as I said it may result in slower data access) As for code, really just use your head and remember that there are always the right and wrong tools for the job. Eg. If there is a function built into PHP, 9 times out of 10 it will be quicker than your PHP function which does the same job. If you wish to profile your scripts and see where you are losing time, have a look at Xdebug
  6. You should be doing better than fine with 1000 users. I know of a few sites with 20,000-30,000 users which are still running sub 0.5 seconds on shared hosting, you just need to make sure your code is not sloppy, your database indexes are correct, etc. EDIT: Did you mean total users or users at once? Apache defaults to a maximum of 256 connections at once, so you dont really need to worry about much if this is what you meant...
  7. I agree with thorpe that is probably the browser being sluggish rather than PHP. As far as I know, PHP doesnt slow down as it approaches the memory limit, only creates errors once it surpasses it. Does the browser need to maintain every line outputted? If not, perhaps you could echo out some js every few thousand lines to clear the window?
  8. The OP mentioned something about the variable being available in multiple files? Create a file which declares the variable, and simply use include 'file.php'; to declare that variable in all files which require it.
  9. Looking at the print_r output, I think your array may not be right. Can you please post the code where you created it?
  10. Could you please explain a little further? Do you want to send a variable to another page, or do you want the variable available on all pages?
  11. But if your server ever goes down, everyones copies of the class stop working. If for eg. a business is using your class and your server goes down and they lose profit because of you, you could be liable for damages. It costs a bit for the software, but I generally use Ioncube. Its fairly common now, so getting it running on hosts usually isnt a problem.
  12. @ rwwd I understand your point, however this is more relevant with larger, or even medium sized chunks of text. For smaller chunks of code, such as this, it is usually quicker (just) to just echo the code, rather than having php switch in and out I just tested to make sure I wasnt going to make a fool of myself, over 100000 reps of echoing 3 variables rather than html with inline php, echoing the lot is approx 40ms quicker. Inline PHP actually peaked higher cpu usage, showing that you need to take the context into account before you apply optimisations. Saying that, for this it probably doesnt really matter too much anyway @redhairgal that'll do it to you hehe, glad you worked it out.
  13. Sorry I wasnt really thinking, week 1 = 0 days, so try (weeks-1)*7+days
  14. @rwwd that makes it harder to read the structures though. Execution time is cheap, man hours are expensive. Not to mention this is one of those microoptimisations which is almost negligible. @redhairgal just wondering why do you have <select ... /> on the first line? It should just be <select ... > Not sure if that will help...
  15. he means you might have to change item(0) to item[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.