Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. The reason for this is to make sure they fill in both their first- and lastname and not just their firstname. It all depends on your business requirements if first- and last name is important for your requirements than it's best to ask them separatly
  2. Like I said: www.sektioneins.de www.scanit.be
  3. You can hire a proffesional hacker they give you a detailed report afterwards. I know a few companies but these are based in Belgium and in Germany: www.sektioneins.de www.scanit.be
  4. Please post your code as the above command's should work you probably used them wrong
  5. No don't use client side cookies to auto-login a user many do something like: $_COOKIE['username'] = $username; $_COOKIE['password'] = $password; And then one of your users logs in on a public computer and his data is readable by any competent hacker that uses that computer after him Try any of the below options: session_cache_expire session_set_cookie_params
  6. make your database field datetime and use: $sqlDate = date('Y-m-d', strtotime($date));
  7. Or in other words: directory traversal
  8. Maybe it's because of that new firewall your company uses that prohibits all it's personnel to upload irrelevant and useless stuff on to the internet
  9. Take a look at my post http://www.phpfreaks.com/forums/index.php/topic,281823.msg1335964.html#msg1335964 It features tweets and people following people You can write that even shorter: $rows = array_map('mysql_fetch_assoc', array_fill(0, mysql_num_rows($result), $result));
  10. What's this for bullshit? Are we now storing a session expiration date on an expiring session? Just use: ini_set('session.save_path', SESSION_SAVE_PATH); ini_set('session.gc_probability', 100);// not recommended but will make sure the session is removed immediatly after expiration session_set_cookie_params(3600);//cookie expires 3600 seconds after initialization session_start(); Another method is using a database as it allows for more control as: SELECT * FROM sessions WHERE id = $id AND last_modified + lifetime > now() This will effectively expire the session when last_modified + lifetime <= now() altough the deletion of the record may well be a few minutes later. It has also other advantages like a session will be re-used instead of creating a new one whenever the user logs-in before the session expires by which the last_modified time is modified and the expiration is delayed
  11. http://reader.google.com
  12. I highly disadvice against the use of integer as an indicator for a user level it's just not readable. Any programmer that will have to maintain your work will have to write down which number stands for which role. A much easier approach is: class User { const ROLE_VISITOR = 1; const ROLE_MEMBER = 2; const ROLE_ADMINISTRATOR = 4; private $data = array(); public function __construct($data) { $this->data = $data; } public function isVisitor() { return $this->_getRole() & self::ROLE_VISITOR; } public function isMember() { return $this->_getRole() & self::ROLE_MEMBER; } public function isAdministrator() { return $this->_getRole() & self::ROLE_ADMINISTRATOR; } private function _getRole() { return (isset($data['role']) && is_integer($data['role'])) ? $data['role'] : self::ROLE_VISITOR; } } // in your script if ($user->isAdministrator()) { Something like that is readable
  13. Then provide some more information or an example of what you want to achieve because I agree with ohdang888 from what I read from you.
  14. Here's a list of a few good forums around http://webtecker.com/2008/05/02/8-popular-open-source-forums/ I highly recommend Vanilla or SMF (which PHPFreaks uses)
  15. Your code should have been: foreach ($array as $key => $value) { unset($array[$key]); } But this is equal to the faster: $array = array();
  16. You were right it is simple look at the below code see something strange? <input type="submit" name="button" id="button" value="Submit" /> if (isset($_POST['submit'])) {
  17. $query = "SELECT data_id, resolution FROM data WHERE tdate = '$date' AND resolution IN ('Resolved', 'Dispatch') ORDER BY resolution"; $result = mysql_query($query); if ($result) { $resolved = array(); $dispatch = array(); while ($row = mysql_fetch_assoc($result)) { if ($row['resolution'] === 'Resolved') { $resolved[] = $row; } else if ($row['resolution'] === 'Dispatch') { $dispatch[] = $row; } } //use $resolved, $dispatch }
  18. Use the BaseUrl view helper <link href="<?php print $this->baseUrl('styles/screen.css'); ?>" .. />
  19. Instead of keeping track of hits manually use Google Analytics instead it provides you with much more information and allows you to set-up funnels and goals http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55580
  20. If you go for one table like jl5501 suggested you need to make sure that whenever a user adds a product it's listed under a subcategory because if the use is able to place it under a category then your product may well never be shown
  21. Post your database structure
  22. Well if you don't store it in a database then why don't you just create 2 files: summer.inc.php and winter.inc.php $time = time(); if ($time >= mktime(0, 0, 0, 5, 1) && $time <= mktime(0, 0, 0, 31, 10)) { include('summer.inc.php'); } else { include('winter.inc.php'); }
  23. Would someting like Gears work? http://gears.google.com/
  24. create table opening_hours ( id integer not null auto_increment, valid_from date, valid_until date, monday varchar(32), tuesday varchar(32), wednesday varchar(32), thursday varchar(32), friday varchar(32), primary key (id)); $query = 'SELECT monday, tuesday, wednesday, thursday, friday FROM opening_hours WHERE now() BETWEEN valid_from AND valid_until'; $result = mysql_query($query); list($monday, $tuesday, $wednesday, $thursday, $friday) = myql_fetch_array($result, MYSQL_NUM)) { //echo '<td>', $monday, '</td><td>', $tuesday, '</td><td>', $wednesday, '</td><td>', // $thursday, '</td><td>', $friday, '</td><td>'; The fields monday till friday would hold the opening hours like 17:00-24:00
  25. Well I still can get that degree and start working for IBM some day, so you are only spared a few years before cataclysm starts Besides if I won't kill you, time will, or the Sun, or a war between US and China, or Iran, or climate change, or terrorists, or .. 6 million ways to die, choose one!
×
×
  • 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.