Jump to content

Bjom

Members
  • Posts

    81
  • Joined

  • Last visited

    Never

About Bjom

  • Birthday 11/25/1972

Profile Information

  • Gender
    Male
  • Location
    Hamburg

Bjom's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. DELECT FROM myTbl WHERE DATE(myDate) < CURDATE() assuming you have a field called myDate in the table myTbl that identifies the record's "age" and it needs to be a timestamp or date type.
  2. UNION is for adding a second identical "table" to another, that means adding rows to an existing table. What you most likely want to do is adding columns and you do that by using JOIN. The syntax is like this: SELECT tblA.fld1, tblB.fld2 FROM tblA JOIN tblB ON tblA.refID = tblB.ID and the trick is to have a field in the one table that references (and thus links) the other table. have a look here at the manual too. hth Bjom
  3. This is one line of code, retrieving info that is vital for analyzing your problem. As should be obvious with either a quick glance at the code, the manual or if it is not obvious then simply from trying it, you can put it anywhere. It does not appear that you even tried this. Your comment about "echoing everything" when all you need to echo is get_magic_quotes_gpc() also points to this direction. Just read the answers, act upon them and stop whining. Bjom
  4. here and here if you don't like being "lectured" read the manual first and ask then. As for echoing "every single line". Well yes, if nothing else helps. But there are IDEs which have line by line execution functionality. And: you are very welcome. Bjom
  5. Read the php manual on sessions. It's explained pretty well imho. But as thorpe points out: it is far less secure and it is mainly useful as a workaround in cases where you a) switch servers within a session, like when moving over to a proxy (ssl over a proxy is an example), but then you should reconsider your strategy and reconfigure ASAP anyway b) it is absolutely impossible to work with cookies So while it is good to know that the possibility exists, it is not advisable to use it as a standard method. Try and google for "session fixation" and you'll find good info about the security issues at hand. Bjom
  6. did you try inserting it somewhere? if not, why not? how do you expect to learn stuff if you don't try it?
  7. the "automatic" logout can only mean: when after 60 minutes of inactivity the user does anything he will get logged out or redirected to the login page. I have written an authentication class that provides that kind of functionality. You can check it out here and use it if you like, play around with it - or simply read it. there is an example in the download that you can play around with...
  8. Check out my authentication class if you like - or use it. Can be found from this thread it's fairly easy to integrate has quite some nice features and does the actual authentication, while you define your login page's design yourself.
  9. in line xxx... in which line would that be? did you place your if (isset(... right? It needs to be right after the first preg_match...
  10. addslashes and stripslashes is not the same as mysqli_real_escape_string. With the latter all that stripping and adding is done in the background for you. You actually never should use addslashes/stripslashes for that purpose. Some literature is outright bad. (also never use or die() )
  11. You are missing that you can escape certain characters in PHP and for that the \ is used. So \' is an escaped '. This for example would not work, producing a syntax error, because a ' is missing: 'Dangerous ' Character' So to assign Dangerous ' Character to a string using single quotes you need to escape the inner single quote with backslash in front. 'Dangerous \' Character' produces 'Dangerous ' Character' if you need the backslash add another one, because the first was "used up" escaping the '
  12. should work, but will continue testing values unnecessarily, when it has already found the number. $numberArray = array(80,100, 120, 160); $inNumber = 85; foreach($numberArray as $value) { if($value > $inNumber) { $nearHighNum = $value; break; } } echo $nearHighNum;
  13. try this: echo get_magic_quotes_gpc(); if it returns "1" then this is the problem... can you use .htaccess files? then this will turn them off: php_flag magic_quotes_gpc Off if not you need to use stripslashes() also do a vardump on the variables containint the values that get sent to your db and make sure THOSE are correct - and compare again...
×
×
  • 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.