Jump to content

travo1992

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by travo1992

  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]
  16. Cant you just set the days to weeks*7 + days?
  17. Why do you need so many tables? You can get away with one, just add a video id column
  18. Sure. Im thinking something like <?php $aid = $_GET['aid']; // repeat for other menus switch($aid){ case 1: $menu_a = 'blah';// 1st menu text break; //etc } // repeat for other menus ?> And then display them by simply echoing the relevant variable ($menu_a, $menu_b, etc) Hope that helps
  19. Id like to suggest http://dfghosting.com/ They are small, cheap, servers are always fast, and dont overload users.
  20. For the sql error, Im thinking it could be 1 of these: 1: there should be a space between your table and your rows 2: like is a reserveed keywork, you should use quotes Try INSERT INTO lgu (`like`, `ip_address`) VALUES ('$LIKE','$IP') For the form, you dont use the same vaiable name, and you have specified post in the form. Try $LIKE = $_POST['like'];
  21. nevermind this post, you guys fixed it between when I stated posting and when I finished
  22. Use switch statements to determine what to show for each of your menus, then show as a template underneath all of your working.
  23. You need to send as a HTML email, rather than a text one. Im not sure how to do this exactly, but most mail classes (swiftmail, phpmailer, etc) have the option.
  24. Im assuming you mean Array ( [name_1] => John Doe, [name_2] => John Doe 2, [full_address_1] => 1234 test street, [full_address_2] => 1234 test street 2 ) At the moment you are replacing the array every time you go through the while loop. Try $i=0; $buildArray = array(); while ($postage =db_fetch_array($postage_query)){ $i++; $custname =$postage['delivery_name'] . '&'; $custaddress = $postage['delivery_street_address']; $buildArray["name_" . $i] = $custname; $buildArray["full_address_" . $i] = $custaddress; }
×
×
  • 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.