Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Use a constructor or method. If you don't know what those are then read up on object-oriented programming.
  2. This topic has been moved very early in the morning to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=359281.0
  3. array_splice lets you insert into the middle of an array (if you know the numeric offset it should go into). Can I ask why you have to insert into the array? You know that for most purposes the arrangement of the keys/values makes no difference at all?
  4. __DIR__ is the directory containing the currently-executing file (exactly like how __FILE__ is the full path to the file). So if you use require_once __DIR__ . "/header.php"; in /forum/views/*.php then it'll include /forum/views/header.php, and if you use it in /index.php then it'll include /header.php. Why's that? Are you serving the site out of a subfolder or something?
  5. No: it's relative to the directory of the first executed file. If that first file includes a file in some other directory, the include path will not "update" to reflect that other directory. Use absolute file paths to include files. // relative to the current file require_once __DIR__ . "/path/../to/../function.php"; // PHP 5.3+ require_once dirname(__FILE__) . "/path/../to/../function.php"; // relative to the web root require_once $_SERVER["DOCUMENT_ROOT"] . "/path/to/function.php";
  6. What does the marquee code look like?
  7. This topic has been abducted by aliens, probed, and dropped off in JavaScript Help http://www.phpfreaks.com/forums/index.php?topic=359251.0
  8. 1a. Viruses can't do anything unless they're executed. So to prevent viruses from doing anything, don't execute files. 1b. If you're actually worried about viruses being uploaded, install AV software on the server and manually scan files as they're uploaded. 2. Store uploads in a place that is not web accessible. Or prevent the webserver from allowing access to them. 3*. Have PHP create the upload folder: chmod 0777 the parent folder, use mkdir() to create the upload folder then chmod() 0755 it, then chmod 0755 the parent folder. 4. Use a PHP script to send (eg, show or trigger a download on) an uploaded file. Don't link to the files directly - though you could have URL rewriting make it look like you are. Don't forget access controls. * If the server configuration is altered and the PHP user changes, you'll have to do a little work. But this is pretty rare.
  9. Did you check to make sure you didn't accidentally add some emoticons in the configuration? What's in your .htaccess and how is the HTTPS site set up?
  10. No... That's kinda the point.
  11. Only use //s when you're writing the expression as an object, inline. pattern = /^handle\[\d+\]/; (that won't work, of course) If as a string then leave them out. pattern = "^" + handle + "\\[\\d+\\]";
  12. __destruct() needs to be public so PHP can call it. __construct() can be whatever you want. If public then anybody can instantiate the object; if protected then only it and its children can instantiate it (or in the case of child objects, call it in their constructors); if private then only the object can instantiate itself.
  13. What do you mean by "default main page"? Any examples? Does DirectoryIndex answer your question?
  14. What about nl2bring it, then replacing two consecutive s with a \n?
  15. Because there's something else going on. Or in other words, not enough information. Is this online somewhere we can see?
  16. I try not to link across forums but here is a fairly long list of ideas. Not all of them apply to PHP but it's a place to get some ideas.
  17. It gets you partway. It's still possible for people to exploit events like Hover over me strip_tags() won't remove attributes. Best idea I've seen is to use strip_tags() to remove the tags you don't want, then DOM (eg, DOMDocument) to remove all attributes (except any ones you want to allow).
  18. Actually it's quite good. I guess you mean to say that it won't work in your case. So why not?
  19. If by "rich text" you mean one of those JavaScript editor things then, You don't have to use it: stuff will already be entity-encoded. If you're worried about disallowed HTML tags then strip_tags is a good start.
  20. And exactly what change(s) did you make?
  21. You misspelled the function name.
  22. Its ID is "$joinId", not "SubQty".
  23. What type of field is user_id?
  24. Did you grab the SDK tools?
  25. Use absolute links like Note the leading slashes.
×
×
  • 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.