Jump to content

RobertP

Members
  • Posts

    287
  • Joined

  • Last visited

Everything posted by RobertP

  1. my os is linux as well.. http://img855.imageshack.us/img855/9684/screenshot1la.png
  2. I have increased the wrapper size for the whole site, and increased the admin panel layout as well, although i am having an issue with height %'s on tables; but that is my fault for using them in the first place. When i get home i will re-factor the admin panel dashboard. As always, thank you to everyone that has taken a few minutes to give the site a test!
  3. After loading on my tv, i have these results.. http://img69.imagesh...19/img1814z.jpg http://img834.images...0/img1813kz.jpg What size screen are you using?
  4. This is a circumstance that i did not test, so thank you for this. If you have cookies disabled, then you receive a new session upon each visit, so i will create a solution to this. (cached hash of user agent + ip; or similar) I have been using a 15.6" laptop for most of my development, so i will have to definably load this on my 55" for further testing! Once again, thank you to you both!
  5. What browser are you using, as with the browsers i have tested, (chrome,firefox,opera & safari) i do not have this issue. I am going to request a screenshot, as i am not sure as to where this could be; and if it is an annoyance, then it should be resolved.
  6. Let me know what you think... <?php $hitDebug = false; $startMemory = memory_get_usage(); $startTime = microtime(true); print '<pre>' . PHP_EOL; $totalFiles = $bandwidth = $hits = 0; $uniqueHits = array(); $uniqueHits24h = array(); foreach (glob('/var/log/apache2/access.*') as $logFile) { if (stristr($logFile, '.gz'))//I manually extracted them.. continue; /* Array ( [0] => 127.0.0.1 [1] => - [2] => - [3] => [12/Dec/2012:00:57:29 [4] => -0500] [5] => GET /test.php HTTP/1.1 [6] => 200 [7] => 313 [8] => - [9] => Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11 ) */ $handle = fopen($logFile, 'r'); if ($handle) { $lineStartMemory = memory_get_usage(); if ($hitDebug) print "Hit #\t\tMemory\t\tMicrosecond" . PHP_EOL; while (($line = stream_get_line($handle, 1024, PHP_EOL)) !== false) { $lineStartTime = microtime(true); $results = str_getcsv($line, " ", '"', '\\'); $bandwidth += $results[7]; if (!isset($uniqueHits[$results[0]])) { $uniqueHits[$results[0]] = null; list($d, $M, $y, $h, $m, $s, $z) = sscanf($results[3] . ' ' . $results[4], '[%2d/%3s/%4d:%2d:%2d:%2d %5s]'); $time = strtotime($d . ' ' . $M . ' ' . $y . ' ' . $h . ':' . $m . ':' . $s . ' ' . $z); if ((microtime(true) - $time) < 86400) $uniqueHits24h[$results[0]] = null; } $hits++; if ($hits % 100 == 0 && $hitDebug) print 'Hit #' . $hits . "\t" . number_format(memory_get_usage() - $lineStartMemory) . "\t\t" . substr(((microtime(true) - $lineStartTime) * 1000000), 1) . PHP_EOL; } if ($hitDebug) print "\n"; if (!feof($handle)) print 'Error: unexpected fgets() fail' . PHP_EOL; fclose($handle); } print 'Log File: ' . $logFile . ' (' . number_format(filesize($logFile) / 1024, 2) . ' KB)' . PHP_EOL; $totalFiles++; } $parserTime = number_format(microtime(true) - $startTime, 4); print PHP_EOL; print 'Total Files: ' . number_format($totalFiles) . PHP_EOL; print 'Total Hits: ' . number_format($hits) . PHP_EOL; print 'Total Unique Hits: ' . number_format(count($uniqueHits)) . ' (' . number_format(count($uniqueHits24h)) . ' within the last 24 hours)' . PHP_EOL; print 'Total Bandwidth: ' . number_format($bandwidth / 1024 / 1024, 2) . ' MB (' . number_format($bandwidth) . ' B)' . PHP_EOL; print PHP_EOL; print '[PARSER]' . PHP_EOL; print 'Total Time: ' . $parserTime . PHP_EOL; print 'Total Memory: ' . (memory_get_usage() - $startMemory) . ' B' . PHP_EOL; print 'Memory Peak: ' . memory_get_peak_usage() . ' B' . PHP_EOL; print '</pre>'; ?> demo: http://auth.gludoe.com/bandwidth.php
  7. Well, this is my second time posting my project here. There have been way to many upgrades / re-factors to list. Basically it is a full functioning cms, with many features (that don't hinder the site's usability). I would like to ask for the community to take a look, and try to break the site. If you find anything that looks odd / weird; please post as well. Site: http://auth.gludoe.com/ Verification: http://auth.gludoe.com/phpfreaks.txt Test Account: Email: test1@gludoe.com Password: test PS: this is a link to my previous topic, in which i can not edit, so i decided to create a new one. PPS: If the site is offline; it is running off my laptop at home, and sometimes it gets unplugged accidentally. I will do my best to keep it online until my testing purposes are completed.
  8. RobertP

    Christmas

    I would like to wish everyone a merry christmas & happy holidays as well!
  9. I would cap it at 500 characters for example. If the post is under the cap, include the whole thing; if not then trim the tail.
  10. +1 i got a 91% accuracy with 36 wpm, although i played only 2 or 3 rounds before having to get some sleep.
  11. Something fun to kill time with (or w/e lol) http://phoboslab.org/ztype/ Notice: This is not mine, nor am i affiliated with the creator in any way.
  12. http://php.net/manual/en/function.mysql-query.php#example-1659
  13. i am up for the 'optional' type safety, as that could stand against most attacks right there.
  14. a few more tips: - never trust anything from the client. ($_GET, $_FILES, $_COOKIE, etc..) - never trust any uploaded file, assume the file does NOT match the file extension it is uploaded with. - never validate files by the extension. - keep the directory where the files are stored protected, or above the websites root directory. - log everything about each files (common sense), but if something goes wrong, you know what went wrong / can fix relatively quickly. - split up stored files in multiple directories (i use 1000 files per directory), as not to strain your ftp / server. That's all i can think of for now, if i think of more i will add for sure. ps: just recently created a full file management system for my cms.
  15. this post was more of a FYI, but my reason for testing was to count how many unique visitors i had, so i would add each unique ip to the array (does not matter if in the key, or the value of the array entry).
  16. results: 0.839771 << isset empty 2.519401 << array_key_exists empty 2.476911 << in_array empty 0.812198 << isset full 2.472904 << array_key_exists full Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/test.php on line 58 code: <?php $iterations = 1000000; $data = array(); $dataFull = array(); for ($i = 0; $i <= 1024; $i++) { $dataFull[$i] = str_repeat('1', 1024); } $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = isset($data[$i]); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << isset empty<br />'; //==== $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = array_key_exists($i, $data); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << array_key_exists empty<br />'; //==== $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = in_array($i, $data); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << in_array empty<br />'; echo '<br />'; $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = isset($dataFull[$i]); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << isset full<br />'; //==== $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = array_key_exists($i, $dataFull); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << array_key_exists full<br />'; //==== $startTime = microtime(true); for ($i = 0; $i <= $iterations; $i++) { $foo = in_array($i, $dataFull); } $totalTime = microtime(true) - $startTime; echo number_format($totalTime, 6) . ' << in_array full<br />'; ?>
  17. another ide? maybe notepad++.. or check the template layouts, maybe you can change it yourself for that program
  18. i highly recommend you use webfaction (affiliate).. 1h account activation USA, Europe, Asia locations 100GB diskspace Reserved RAM for your apps Unlimited domains, emails and databases Full shell access (ssh,sftp) Latest software
  19. I would like to note, that most *all* of the links categorized under "Design Patterns" are dead.
  20. Just wondering if anyone has used blowfish in php, not as hash, but for encryption and decryption.. like my above example (which is working, but i would like some feed back). This is used to communicate over https from my server / clients, and if my clients are using a shared / insecure server, i need to know that information can remain intact..
  21. I am just curious, is this the correct way to implement blowfish encryption? class: <?php /* * @package "Gludoe CMS" * @version 1.0.1 * @authors "Robert Pettet" * @support https://www.gludoe.com/ * @licence https://www.gludoe.com/commons/licence-1.0.0.txt */ if (!defined('_ROOT')) exit(header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found')); class Blowfish { private $key; private $iv; public function __construct($key, $iv) { $this->key = $key; $this->iv = $iv; } public function encrypt($data) { return mcrypt_encrypt(MCRYPT_BLOWFISH, $this->key, $data, MCRYPT_MODE_CBC, $this->iv); } public function decrypt($data) { return mcrypt_decrypt(MCRYPT_BLOWFISH, $this->key, $data, MCRYPT_MODE_CBC, $this->iv); } } ?> example: $blowfish = new blowfish('DfRgBWE4Y4T7UgTWEdFP1Y','85440934'); $data = $blowfish->encrypt('testString'); echo $blowfish->decrypt($data); //Output: testString
  22. you could just use the native crypt function.. blowfish implementation private function encrypt($string, $salt) { if (strlen($salt) < 21) trigger_error('Member#encrypt: Failed due to salt length less then 21.', E_USER_ERROR); return crypt($string, '$2y$10$' . $salt . '$'); }
  23. well, maybe http://php.net/manual/en/ref.json.php
  24. not sure what you are trying to do exactly here, but maybe this will help... $files = array(); for ($i = 1; $i <= $_POST['file_count']; $i++) { $files[] = array( 'name' => $_POST['file' . $i . '-name'], 'title' => $_POST['file' . $i . '-title'], 'path' => $_POST['file' . $i . '-path'], ); }
  25. This is by far the best implementation i have come across! Thank you for sharing this.
×
×
  • 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.