Search results

  1. M

    GZip enabled on starka?

    See "About gzip, mod_deflat...".
  2. M

    Help with ETags and caching with PHP Includes

    If you want to know whether ETags are enabled, check. Request a page and examine the headers. To enable ETags, use the FileETag directive. For example, FileETag MTime Size ETags are only generated for static pages, since content of dynamic pages can change even if the inode, modification time...
  3. M

    JQuery sliding menu - Remember which link was clicked

    You'll need some way of differentiating the links via the URL. Since the anchors link to the same page, use a fragment identifier (add a different one to each link). Have your ready hander check the fragment (window.location.hash) to determine which menu to expand.
  4. M

    PHP parse error

    That article is outdated in that it doesn't cover prepared statements. The PDO driver offers this more modern solution, which has benefits beyond safety. For more in-depth coverage of SQL injection, read "SQL Injection Attacks by Example" and "SQL Injection Walkthrough". For a tutorial on PDO...
  5. M

    img src preg_match_all regex problem

    Take a second look at the comments for realpath() for sample functions that resolve relative URLs. It's not that nasty. RFC 3986 § 5 even gives an algorithm. Here are two more examples: function resolveURL($url, $base) { preg_match('%^([^:/]+://[^/]+)([^?]*/)%', $base, $baseParts)...
  6. M

    img src preg_match_all regex problem

    Don't set variables that are invariant inside a loop; you're just wasting cycles. You're repeating far too much code here. Convert relative URLs into absolute URLs. After that, the rest of the code is the same. ?><ol><?php foreach ($images[1] as $imageURL) { $imageURL =...
  7. M

    Java, inheritance

    Too bad. There's not much you can do when your professor forces you to follow bad practices. Depending on how open minded she is, you could see why she has that particular guideline and (once you've studied why Systems Hungarian Notation is bad but Apps Hungarian can be useful, and assuming she...
  8. M

    img src preg_match_all regex problem

    The closest I can think of is realpath(), but that only works on local files (the comments for realpath() have some functions that work on URLs). SimpleXML offers an alternate way of getting the source URLs, but won't resolve relative references. $doc = new SimpleXMLElement($url, 0, True)...
  9. M

    Java, inheritance

    The sample code printed the first and last names and PIN when I ran it (after minor modifications to make it compile; test cases should be self contained and compilable as-is). Test your sample yourself; if it works, compare it to your full code. Type sniffing is almost always the wrong thing...
  10. M

    rtsp file download script?

    File hosting, proxies and copyrighted materials aren't allowed on the X10 servers. Chances are you'll be breaking the ToS.
  11. M

    Cant open

    What's the URL for the page you're trying to access?
  12. M

    Why has my site been intermittently up and down?

    If something is wrong with the service, check the service alerts. That's what they're there for.
  13. M

    Internal Server Error

    Then you should probably do what the message says and check the error log in cPanel to see if it lists the cause, since the message you posted tells us nothing about what the error it is. Also post the contents of your .htaccess file, since a common source of server errors is misconfiguration.
  14. M

    zip command question

    It's probably in /usr/local/bin. You can find out yourself by writing a short CGI script: #!/bin/sh echo "Content-type: text/plain" echo echo `which -a zip` # or: #which -a zip >/dev/tty Make sure you set permissions to mode 0755.
  15. M

    PHP cron-job

    Search the forums and try the solutions you find. If that fails, come back here.
  16. M

    css alignment problems :(

    The link was indeed necessary to illustrate the problem, which is that there isn't enough content for the body to be larger than the viewport. The background is bottom aligned to the body, hence the gap between the bottom of the body's background and the bottom of the viewport. Try setting the...
  17. M

    The 24th Imagemagick thread (for phpBB 3)

    If you want to find out whether or not a particular PHP extension is loaded, use extension_loaded() (which has been covered for other extensions). To see all extensions, use get_loaded_extensions().
  18. M

    where to start with web design

    Functions and classes are necessary from the start; leaving them out is just encouraging bad habits. Modules and libraries come quite naturally to group the functions and classes you write. Check the recommendations linked to in "sql database" and "What should I learn?" as well as the many SO...
  19. M

    MySQL Stored Procedures

    Yes, you can create stored procedures. The MySQL stored procedure manual page has examples. How did you try to define a procedure? What was the procedure? What failed? We can't help you unless you tell us exactly what you did, what you expected to happen and what actually happened, including...
  20. M

    Perl 500 internal server error. Something wrong with my code.

    One issue is you're not printing any response headers, so the response body is treated as the response headers. Since the body isn't valid as headers, you're getting a 500 error. Try adding: use CGI ':standard'; ... if ($res->is_success) { print header(-type =>...
Top