Jump to content

Ben Phelps

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Ben Phelps's Achievements

Member

Member (2/5)

0

Reputation

  1. Here is an example. 135874 246884 13579 24680 2568 2668 35 46 i need to round every number in a string up to its next highest even number. is there a way to do this, performance is not an issue, the main script takes about 45 cpu seconds to run.
  2. This is a new site, still in development, but I wont people thought about it. It is a domain stock trading game. Kinda like alexadex or urladex.com, but web 2.0 version. The quote feature works now, but the shares available will change every second. So its not that good et. Tell me what you think. Check it out here: http://sitestocks.net/
  3. I need a good method to generate a random number based on a different number. Here is the code i have now, but it doesn't work. <?php $i = 35648; if ($i <= 100) { $s = rand(100,299); } else if ($i <= 1000 & > 100) { $s = rand(300,399); } else if ($i <= 5000 & > 1001) { $s = rand(400,499) } else if ($i <= 10000 & > 5001) { $s = rand(500,749); } else if ($i <= 15000 & > 10001) { $s = rand(750,999); } else if ($i <= 20000 & > 15001) { $s = rand(1000,1499); } else if ($i <= 50000 & > 20001) { $s = rand(1500,2499); } else if ($i <= 100000 & > 50001) { $s = rand(2500,2999); } else if ($i <= 150000 & > 100001) { $s = rand(3000,3499); } else if ($i <= 200000 & > 150001) { $s = rand(3500,3999); } else if ($i <= 300000 & > 200001) { $s = rand(4000,4499); } else if ($i <= 400000 & > 300001) { $s = rand(4500,4999); } else if ($i <= 500000 & > 400001) { $s = rand(5000,5999) } else if ($i <= 750000 & > 500001) { $s = rand(6000,7499) } else if ($i <= 1000000 & > 750001) { $s = rand(7500,9999); } else if ($i <= 2000000 & > 1000001) { $s = rand(10000,14999); } else if ($i <= 5000000 & > 2000001) { $s = rand(15000,17499); } else if ($i <= 10000000 & > 5000001) { $s = rand(17500,19999); } else if ($i <= 50000000 & > 10000001) { $s = rand(20000,19999); } else if ($i <= 100000000 & > 50000001) { $s = rand(25000,29999); } else($i >= 100000001) { $s = rand(30000,39999); } echo $s; ?>
  4. i think i figured it out. each data set will have its own table i will use a unix timestamp to make the time and i will update it every hour then all i have to do is a loop to get the data for a graph and whatnot is there a better way to do this ?
  5. I would be storing hundreds of thousands of entry's that would each be updated every day, so it would need to be MySQL, but i need a simple way to store that in MySQL. I just don't know how to store that data so it can be accessed to create a graph or plot a chart.
  6. I need a good way to store data for each day, but it needs to be accessed easily. data 1 - 125478 data 2 - 123549 Those numbers would change each day, and i need to store that value for each day. It would be kinda like a stats archive. I would need to refer back as far as one year from the first date. Is there an easy way to do this?
  7. I have seen this before, but I can think of what it is called. a:7:{i:0;a:2:{s:6:"visits";a:5:{i:0;a:1:{i:0;a:2:{s:5:"total";i:148;s:6:"unique";i:46;}} thats what it looks like, and i know its a way of storing data in php. What is that method called?
  8. I know it can be done, my method just don't work. And I cannot change my allocated memory amount. <?php $file = file_get_contents('http://www.thepchs.com/file1.zip'); $fileh = fopen('file1.zip', 'w+'); fwrite($fileh, $file); fclose($fileh); ?> I get Fatal error: Out of memory (allocated 35913728) (tried to allocate 35651584 bytes) in /homepages/0/d179649980/htdocs/sites/inlineproduction.com/zonew.net/vid/download.php on line 2 How can I do this where it does not put the file in memory.
  9. I have fixed the xss problems. But If the filename has special characters or already exists, the download link should work. http://primaryupload.com/a▒ª∟╨²u→ù╨I╖.bat and if you upload a file with the same name it will add a random 3 digit number to the file name. Thanks for the help so far.
  10. The site is just starting out, and I hope it will continue to get bigger. I am just worried about the level of security. Please try to hack, exploit, inject, and anything else you can think of. Just don't crash the site completely, it's live. If you do find some holes please tell me how you did it so I can fix them. http://primaryupload.com/
  11. Thanks for the fast answers, they both helped.
  12. function newFunction($var1, $var2, $optVar1, $optVar2) { echo $var1; echo $var2; if (isset($optVar1)) { echo $optVar1; } if (isset($optVar2)) { echo $optVar2; } } I get: Warning: Missing argument 3 for newFunction() Warning: Missing argument 4 for newFunction() and i understand why, but how can I have those optional variables and not get that error.
×
×
  • 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.