Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. What is the purpose of object interfaces? I don't really see why you would want to set which methods a class must implement. Why would/should people use them?
  2. Just use: <?php echo "<link rel='stylesheet' href='{$path_to_stylesheet}' type='text/css' />"; ?> or <?php echo "<style type='text/css'>\n"; echo file_get_contents($path_to_stylesheet); echo "\n</style>"; ?>
  3. When running phpinfo(), the first section has a field called "Configuration File (php.ini) Path". The file mentioned there is the one you need to change. Safe mode might have effect on this too.
  4. You should change the fonts of the menu bar. It is not particularly easy to read compared to a "normal" font.
  5. I don't like the moving text. The only thing it does is to annoy IMO. Why are the "Adds [sic] by Google" box in the middle of everything?
  6. <input type='text' name='time' onkeyup="document.getElementById('link').value=this.value"> <a href="#" id="link">time</a>
  7. <input type="text" id="the_field" /> <button type="button" onclick="location.href='http://example.com/page.php?q='+document.getElementById('the_field').value">Go</button>
  8. It needs to be $_GET['userName'] unless you have register_globals on (which you shouldn't).
  9. allow_url_include needs to be on. allow_url_fopen is for fopen(), but allow_url_include is for include()/require()/include_once()/require_once().
  10. <div style='overflow: auto;'>long stuff here</div> It might need a width before it works. I can't remember. auto will only show the scrollbar if necessary, scroll will always show it. http://www.w3schools.com/css/pr_pos_overflow.asp
  11. Just figure out what the darker color and the even darker color is. You could use a color picker for that.
  12. No, but you could try looking at the source of already built systems to see how they do. Such as SMF which is being used here.
  13. I think a method needs to be defined as static in order to call it using the scope resolution operator.
  14. Ok. You have a table like this: user_sessions ============= sid <-- unique id s_last_activity <-- integer holding a UNIX timestamp s_user <-- could be the user id or username Now each time a user goes to a new page on your site you could run this: mysql_query("UPDATE user_sessions SET s_last_activity='".time()."' WHERE s_user='{$user_id}' LIMIT 1"); Then to check if a user has been active in the last 15 minutes you'd do this: <?php $result = mysql_query("SELECT * user_sessions WHERE s_user='{$user_id}' LIMIT 1"); if(mysql_num_rows($result) <= 0) { echo "No session exists. Not logged in"; } else { $session_info = mysql_fetch_assoc($result); if($session_info['s_last_activity'] >= strtotime("-15 minutes")) { echo "Has been active within the last 15 minutes. Is logged in."; } else { echo "Has not been active within the last 15 minutes. Not logged in."; } } ?> If the user logs out then delete its session in the database.
  15. Technically you cannot have a 100% secure password. It is just a matter of time and computational power before it can be cracked. You could start with a basic score, then add points to the score based the the following things: - length - contains a-z? - contains A-Z? - contains 0-9? - contains special characters (all other than a-zA-Z0-9)? - contains words in a dictionary (deduct points)? - contains reversed words in a dictionary (deduct points)? - contains patterns on keyboard - e.g. qwerty (deduct points)?
  16. Use mysql_query().
  17. Have a table storing the sessions. Then each time a user go to a new page you update a timestamp. In that way you can check if they have been active in the last X minutes.
  18. I think objects work great anywhere... It's just a matter of personal preference.
  19. Just try margin: 5px 0px 5px 5px; instead (if right is 0px since it is not specified in your code).
  20. We'll need the code.
  21. It doesn't send contents of the form to the page. It only opens a connection to the page. To send the contents of inputbox it would be something like this: <script type="text/javascript"> function no_more_popup() { var httpRequest; var input = document.getElementById("inputbox"); if(window.XMLHttpRequest) { httpRequest = new XMLHttpRequest(); if(httpRequest.overrideMimeType) { httpRequest.overrideMimeType("text/xml"); } } else if(window.ActiveXObject) { try { httpRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { httpRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { } } } if(!httpRequest) { alert("Could not save setting..."); return false; } httpRequest.onreadystatechange = function() { alertResults(httpRequest); }; httpRequest.open("GET", "http://www.example.com/no_more_popup.php?input="+input.value, true); // <------ change this url httpRequest.send(null); } function alertResults(httpRequest) { if(httpRequest.readyState == 4) { if(httpRequest.status == 200) { alert("Setting saved. You will no longer see this popup..."); } else { alert("Could not save setting..."); } } } </script> <form name="myform"> Enter something in the box: <br /> <input type="text" name="inputbox" id="inputbox" /> <input type="button" name="button" value="Click" onclick="no_more_popup()" /> </form> Note: I haven't tested any of the posted code, so it might not work. What you are using is popularly called AJAX, but it is really just taking use of XmlHttpRequest in Javascript.
  22. There isn't really any need for it and it is in no way more secure.
  23. If I remember correctly, then the GPL (and LGPL as well) says that you are free to redistribute it as long as it is distributed under the same license again (ie GPL/LGPL). I think that means you can only use it if you do not encrypt it and you may only distribute it with your product if your product is released under LGPL.
  24. I don't quite understand. Supplying some code might clarify your problem.
  25. I'd probably remove the reflection of the "beta"-badge. Maybe even the entire badge as I hate the idea of those never-ending beta products. It seems to be quite popular to have your site/service in an infinite state of beta. Looks quite good though. Maybe add some padding to the copyright notice and a brighter color as well.
×
×
  • 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.