Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Posts posted by spiderwell

  1. i think what you want is this:

    mypage.php is only viewable when logged in.

     

    so on that page have the session start, check if the session holds the username and/or hashed password. personally i would suggest just the presence of username in the session is enough to 'pass the test'. if that is found let the page execute, else unset/kill the session and redirect away back to the login

  2. i think you are being confused by a column that is called timestamp and one which its datatype is set as time stamp. which is not surprising since the original response has a column called timestamp.

     

    a datatype as a timestamp is somewhat different to a datatype that is date. timestamp data will auto update unless you tell it not to, whereas a date data wont.  have a look here for more info on timestamp

     

    i would suggest that you use a date as the datatype and not timestamp as the datatype. perhaps call the column expires or something else to avoid confusion?

     

  3. whats in the database is just a string with what 'looks' like a php variable, php wont recognise it, you would have to use str_replace() to put your actual $rand variable into that string. then it should echo out correctly

  4. jcbones answered your question perfectly, if you want to get ones that have expired, use less than instead of more than...

     

     

    did you even try out his example?

     

    I was a bit confused by his retrieve example because it's saying "timestamp > NOW()". I don't want to select the timestamp that's greater than now. I'm basically wanting to create a timer and I'll be checking my database every minute to check and see if any timers have expired. By using "timestamp > NOW()" isn't that going to select everything then since it would all be set 4 hours and 10 minutes into the future?

    the example given selects anything with the column called timestamp set in the future from the time the sql select is executed. you want the opposite, which is why i said use less than <, not more than >.

    there aren't any 'timers' set up really, just a single insert that at the time is 4hours 10 minutes ahead. as the clock ticks (father time is our timer if anything is) that inserted timestamp becomes less and less in the future until, hey presto, 4hours 10 minutes later it becomes present, then 1 second later it becomes the past, and at that point the 'timer' has expired.

    dont think to hard about it, just do it :P

  5. i just copied your script directly and tried it on my MAMP server and it works as expected, only echoing lolol when you enter create new.

     

    here is cut n paste of the log:

    - Nothing

    blah new - Nothing

    - Nothing

    - Nothing

    create new - LOLOLO

    make new - Nothing

    create moo - Nothing

    freferf new - Nothing

     

    so god knows why you are getting errors!!

  6. $imagebytes = $row[image];  should be

    $imagebytes = $row['image'];

     

     

    @fugix, the upload script appears to be saving the image as a massive string in the database, never seen that before, personally i do what you suggested. only i keep the path in my 'common' include, and save image name in db

×
×
  • 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.