Jump to content

requinix

Administrators
  • Posts

    15,232
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. That won't work. The \\ becomes \ inside the string and the pattern is/^(C:\)[[:print:]]$/resulting in an unmatched (. '\\\\' will turn into \\ and a literal backslash.
  2. Anecdotally, the rules for finding pathless files with include() has varied over time and PHP versions: sometimes it might search the directory of the parent file, sometimes it only looks at the working directory. The best thing to do is be very explicit with your filenames by using absolute paths. For something relative to the directory of the parent file you can include __DIR__ . '/firstfile.inc.php'; // PHP 5.3+ include dirname(__FILE__) . '/firstfile.inc.php'; and for something relative to the root of your website, include $_SERVER['DOCUMENT_ROOT'] . '/includes/firstfile.inc.php';
  3. Compile your own version of PHP. Have you considered trying to, oh I don't know, fix the problem? Assuming there is one in the first place?
  4. Your backslashes aren't paired up properly. $pattern = '/^(C:\\\\)[A-Za-z0-9\040\.\-\\/]$/';
  5. Then try having two of those date comparisons, one in each place. The innermost query will then find duplicate names within your time period while the outermost query will find matching records with those names... within your time period.
  6. Besides the $POST['cancel'] typo, the buttons have to be in a form. $id = 776; print '$id ' . "$id\n"; if(isset($POST['cancel'])){ print "Exiting"; exit(); } if(isset($_POST['submitted'])){ print '$id ' . "$id"; } print " </pre> <form method='\"post\"'> </form> <br>";<br [edit] Oookay, indentation doesn't want to work for me.
  7. If neither of those do what you want (I thought you might have a syntax error) then what do you want? The couple options I can think of should be answered by one of those queries.
  8. What query did you try?
  9. It's probably malicious, trying to send all of your visitors to that other site instead. You wouldn't notice because you're not getting to your site via Google.
  10. Outside of a character set ^ means the beginning of the string (or in multiline mode the beginning of the line). As the first character inside a character set ^ means "none of the following characters". As anything after the first character inside a character set ^ means literally a ^. That's all. If you don't want something to match then use a negative assertion, but you then have to specify something that can match. \[\[start:(?!$keep\])[^\]]+\]\]... The added \] after $keep is so that $keep=123 will not prevent [[start:1234]] from matching.
  11. Had you looked at the manual before blindly trying random things you would have seen a note about piped logs. Related, here is the manual page for rotatelogs which demonstrates how you can have a daily log file; I think it will append to existing files so you could write the filename to be per-month and use a per-hour interval (to handle DST changes).
  12. I'll take that as a "no" then. define( "DOWNLOAD_ROOT", __DIR__ . "/" ); __DIR__ is for PHP 5.3+ only. For define( "DOWNLOAD_ROOT", dirname(__FILE__) . "/" ); You should install PHP 5.2 on your machine at home so there aren't any more of these problems.
  13. Your website is not running PHP 5.3. Can you upgrade it?
  14. date_default_timezone_set
  15. $weekPay = (($hourly * 40) + (1.5 * hourly) * otHours); Find your php.ini, set display_errors = on error_reporting = -1 then restart your web server and find out what error messages PHP has for that line.
  16. You can't header redirect and trigger a download at the same time. You could redirect to the page which then redirects to the download (and thus won't take the user away from that page). Other options depend on the purpose of the pages and the download.
  17. How does that work?
  18. As long as you're not talking about the client's computer and scanner, a command-line program is probably your best bet.
  19. Not working how? Error messages? The site is still showing the __DIR__ version.
  20. You don't. include_once(dirname(__FILE__) . "/../admin/config.php");
  21. Well that's certainly not normal. Okay, DOCUMENT_ROOT won't work. Next best thing is a relative path. Assuming you have PHP 5.3 or later, include_once(__DIR__ . "/admin/config.php"); Looks the same, huh? The DOCUMENT_ROOT version works by starting at the root of your website and going to the admin/config.php file from there. Using __DIR__ is relative to the file you put the code in, which could be the root or could be someplace else. Say you have a file include/config.php and want to include the admin/config.php stuff. The two methods together then look like // start at the website root, go to admin/config.php include_once($_SERVER["DOCUMENT_ROOT"] . "/admin/config.php"); // start in this directory, go up a directory, then go to admin/config.php include_once(__DIR__ . "/../admin/config.php");
  22. That leading slash means to look in the root of the drive. It's akin to saying C:\admin\root.php. Naturally that's not where your file lives. It actually lives in /home/username/public_html/admin/root.php. So that's what you need to say. Easiest method is include_once($_SERVER["DOCUMENT_ROOT"] . "/admin/root.php");
  23. A correction to what you've said in a couple places: You are not using the "W3C geolocation API". It is not provided by the W3C. You aren't getting data from them. They made a standard for how one can write Javascript to try to get geolocation information, but that information is actually coming from the browser. The browser will do whatever it wants to try to get a location: maybe the user set it beforehand, maybe it does an IP address-based lookup, maybe it ties into GPS information available on the device, or maybe it says no and returns nothing.
×
×
  • 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.