Search results

  1. M

    PHP: time_sleep_until()

    It's probably in joking response to the last line of your first post. Sleep functions block execution of the script/process/thread. They won't do what you need. PHP doesn't really support concurrency, which is what you're looking for. If any of the sub-process functions, such as system() or...
  2. M

    jQuery & CSS Help...

    As it says in the sig, The positioning is less important than the background, opacity, visibility & borders. If you already have positioning worked out, all you need to integrate are the other parts.
  3. M

    PHP Include- Page Titles

    An earlier post shows one way of doing it, using an array to store a whitelist. Another is to use basename() to remove all path components excepting the page.
  4. M

    PHP Include- Page Titles

    You're including head.php before you define $page, so the latter doesn't exist when the former references it. head.php should only output the page header; it shouldn't set any page configuration variables. The two are different functions, and, due to separation of concerns, should be handled by...
  5. M

    Simple onfocus command

    One very important reason to do this is to prevent an injection attack. Make sure $from_email is sanitized. There isn't much damage possible with an e-mail injection, but there is some.
  6. M

    PHP: Problem with For Loops and If Statement

    In addition to what dlukin says, that error message is a good example of why it's important to properly indent your code, preferably with an editor that auto-indents. It becomes very easy to see which braces match, and thus where you're missing a brace.
  7. M

    PHP: Problem with For Loops and If Statement

    The code you posted is all kinds of wrong, so I'm guessing it's heavily edited from your real code. It should also be properly indented to make it readable. Why 5? Were these just to show us some of the variables you're using? If not, they all hold null values. The $venue1 = $startVenue...
  8. M

    PHP Switch Functions.

    Hmm, why does that post seem so familiar? @zegnhabi: give proper credit when you quote something, otherwise it's plagiarism.
  9. M

    PHP Include- Page Titles

    Not really. Certainly not noticeably slower. Try looping over "$title" and $title millions of times. The difference will be a few milliseconds at most. The double quotes are, however, unnecessary and (slightly) less readable. Make sure you indent to make code readable. switch($page) { case...
  10. M

    PHP Switch Functions.

    The query string is best accessed via the _GET superglobal. Names and values from the query string become names and values in the array. Read the manual for more information. Just make sure to sanitize the input to prevent an injection attack.
  11. M

    Simple onfocus command

    You can use trim() to remove leading & trailing whitespace, including newlines. Make sure you validate the form server-side in addition to client side.
  12. M

    Python calling another appliction

    You should always develop on your own machine, pushing to the production server only when stable. For one thing, you have more control over your own server and can debug apps interactively.
  13. M

    PHP Switch Functions.

    Note that switch is a statement, not a function. It's an important difference because, as special forms, control structures can do things that functions can't. As for examples, the manual page has plenty. If you ever have questions about any language, check the official documentation first...
  14. M

    jQuery & CSS Help...

    According to the W3C box model (actually, § 9.9 "Layered presentation" of the visual formatting model), content is in front of the border (some illustrations have it backwards). Rather than using an <img> tag to display the images (keep the <img> for structural purposes and to shape the slide...
  15. M

    PHP Include- Page Titles

    The tag for the header element is <head>, not <header>. You neglected to include a link to a live sample page so we can see the current output, in case there is another issue causing problems with the page title. Quotes are unnecessary around variables; all "$title" will do is interpolate the...
  16. M

    .httpassword access advice

    You can use LogFormat to log the date & time, username, remote IP and URL with the %t, %u, %a and %U fields, respectively. However, the LogFormat directive can't be used in .htaccess, so you can only make use of it if you have a VPS (you might also be able to use LogFormat on paid hosting; not...
  17. M

    Site exists on two hosts.

    My libertatia.co.cc domain is hosted on Lotus (as reported in cPanel and via DNS), but the "main domain" (currently libertatia.x10hosting.com, but previously libertatia.exofire.net) is on Stoli (as reported in the X10 account panel and via DNS). The Stoli hosted site is missing many files and I...
  18. M

    Simple onfocus command

    When posting, use [php], or tags (as appropriate) to separate and format code: if (document.orderform.terms.checked== false) { alert("You must agree to our terms and conditions below an order can be processed"); return false; } The Document Object Model is the standard that...
  19. M

    LWP::Useragent request

    That's not quite enough to test. Is the posted fragment part of a function, or is it top-level code? Are you sure $_[0] holds a URL?
  20. M

    Best way to compress the HTTP?

    If you had searched the forum for your topics of interest, you would have discovered that setting php options in .htaccess isn't supported on free hosts, and that you can try the mod_gzip config options.
Top