Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by Lamez

  1. I am working on timed session for my project. So they have X minuets per pages to indicate some activity before the systems logs them out. Here is how I am going about this: At the login function: set time limit, store session time in a session variable. In main.php (included on every page): check time with expiredTime() function if this returns false, then call the updateTime() function, else logout. Here are my functions: function startTime($min){ //Starts the time clock (TC), should only be used in the loginAdmin and updateTime functions. $min *= 60; if(!isset($_SESSION['~TC:Min']) || $_SESSION['~TC:Min'] != $min) $_SESSION['~TC:Min'] = $min; $_SESSION['~TC:Time'] = time() + $_SESSION['~TC:Min']; } function updateTime(){ startTime($_SESSION['~TC:Min']); //No need to do the same thing twice. Resets the clock per page. } function expriedTime(){//True if time has expired; false otherwise. return time() > $_SESSION['~TC:Time']; }
  2. like so: if( md5($pass1) === md5($pass2)) echo "Match"; //or if the pass is already hash'd if( md5($pass) === $hashPass) echo "Match";
  3. Ya, I would not trust those sites just based on the design. There are tons of HTML templates you can buy\get for free online, these will increase the credibility of your site. Take a look here: http://www.freelayouts.com/websites/html-templates
  4. I am not too sure what XSS vectors. I do know what cross-site scripting is though. How would I fix this? Also, did you take a peek at the product site. Is that secure as well? Thanks!
  5. never mind, I forgot a '$' in the increment part of the for loop header.
  6. I have no idea where the error is. Here is the compiler error: Here is line 336: for($i = 1; $i<$max; i++){ Here is the entire function: function getPageList($max){ $pageList = ""; for($i = 1; $i<$max; i++){ $pageList .= '<a href="?page='.$i.'">Page '.$i.'</a>'; if($i > 1 && $i != $max) $pageList .= ' | '; } return $pageList; }
  7. joined in '08 of May. 17 then, 19 now. 20 this year.
  8. I am working on a "product catalog", I need to make sure the login gate is secure. I also need to make sure there is no security holes. All I am going to tell you, is there is an admin with the username of james. Link to Test Site: http://www.hssz.net/sz/admin Product Site : http://www.hssz.net/sz/ Proof of Ownership: http://www.hssz.net/sz/phpfreaks.txt Post any problems! Thanks!
  9. I include it twice because when $footer = true then shows the footer. I got to thinking though, I could include it once then write a function. what it really does is call the footer include file. I think the getHomeValue pulls content from the DB, can't remember.
  10. This is how I do it: <?php $path = ""; $title = "Home"; include ($path."core/main.php"); echo "<b>".getHomeValue("title")."</b>"; echo "<HR>"; echo getHomeValue("content"); $footer = true; include ($path."core/main.php"); ?> I like it.
  11. Ya, I was about to say, it has to be the query.
  12. I could not agree more, I am curious now. I am now going to have to find out.
  13. I am a bit curious. What is the difference between using mysql and mysqli? The difference between fetch_array and fetch_assoc?
  14. I would think the compiler would have to, it has to have someway of detecting first, what kind of expression it is. Only seems logical at that point to evaluate it as a whole.
  15. you are using mysqli_query, but when you call the array, you are using mysql_fetch_array(), try mysqli_fetch_array instead.
  16. As that may be true, it still does not matter what order they are in. The expression is evaluated as a whole. true || false = true false || false = false false || true = true true || true = true I don't see why the order they are called matters.
  17. did you see my corrected post? I made a mistake.
  18. I don't think it matters since it is evaluated as a whole to single boolean.
  19. <?php $f = mysqli_fetch_array($r);//corrected $_SESSION['user_id'] = $f['user_id']; ?> EDIT: OOPS $q should be $r
  20. <?php if(empty($_GET['orgname']) || !isset($_GET['orgname'])) echo "Nothing Selected"; else echo $_GET['orgname']; ?>
  • 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.