Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Copying from a book is risky. Replace your _autoload with function autoload($name) { require strtolower($name) . '.php'; } spl_autoload_register("autoload"); 1a. The function is supposed to have two underscores, but the whole thing is outdated to begin with.1b. Instead make a normal function and use spl_autoload_register 2. Unless the file is named "Page.php" (uppercase 'P') then you need strtolower() to lowercase the class name to get the filename.
  2. That. Very that. Not only are regular expressions the wrong tool for dealing with HTML, DOMDocument is actually better at doing what you want. getElementsByTagName
  3. You'd have to use a shell command, like dir on Windows, to get it. C:\>dir Volume in drive C has no label. Volume Serial Number is 9675-8706 ...
  4. Well, the field is called "date" so I would expect more like SELECT * FROM jobs WHERE MONTH(date) = 4If you're still not getting results, what are some of the actual values from the table?
  5. REMOTE-USER is not correct. It should be REMOTE_USER or maybe HTTP_USER.
  6. Unless you need access outside your network, a NAS is plenty. VPN would be more about you wanting access while you're not home (among other things).
  7. Could it be that the new Apache configuration isn't setting the REMOTE_USER?
  8. Nope, nothing fancy. All you need is a database to store the information and a little PHP to add stuff and to show stuff. Start by writing the admin page without any database interaction to the point where you have the information you want (title, description, and uploaded picture) into variables. Then write the "show" page to the point where you start with variables with that data (you'll get those from the database later) and outputs the page how you want it. Note that you never actually create a "new webpage". You don't make a file for every event but instead have URLs like "showevent.php?id=123"; that ID tells showevent.php what event information (from the database) to show on the page. If you want a fancier URL, like "event/example-event-123", that can happen easily later.
  9. Uh, no? $rTPattern = '<span class="label">Runtime:<\/span>.*<span class="data">(.*)<\/span>'; $starringPattern = '<span class="label">Starring:<\/span>.*<span class="data">.*<span itemprop="name">(.*)<\/span><\/a><\/span>.*'; $pattern = '/' . $sPattern . $dPattern . $gPattern . $rPattern . $rTPattern . $starringPattern . '/siU';There is no .* between the $rTPattern and the $starringPattern. You put one at the end of $starringPattern but not at the end of $rTPattern. There very likely needs to be one.
  10. You're missing a .* between the $rTPattern and your new $starringPattern. That's basically a "delimiter" between the different parts; your $starringPattern is at the end and doesn't need it, but $rTPattern is no longer the last one so it does need it.
  11. A signed BIGINT at allows values up to Or 9,223,372,036,854,775,807. If that's not enough for your currency or whatever then you really need to change the currency. Not even the Zimbabwean dollar is that bad.
  12. Any errors? What does your code look like when you var_dump() the $output and the $result, and exactly what output do you get (because you will get something).
  13. You've got more than one element in the HTML with id=search...
  14. Ah, but you left all the other fields empty, and ended up with conditions like address LIKE '%%'which will, of course, match anything and everything. Only add those conditions in when there is a value to search for.
  15. PHP has this crazy feature called variable variables. Lets you use a string value to determine the name of a variable. The syntax is basically either adding another $ or, for more complicated situations, ${}. It works in very many places, actually, and even lets you get and set otherwise invalid variables... as long as you can deal with the potential "bugs" of doing so. Given $methodProperty = "name", self::${$methodProperty} -> self::$name -> "Allan"Just try not to use it too much: in, like, damn near every possible situation where they would solve a problem, an array is a better solution. Including this situation: it's better to store the values in an array and bypass all this nonsense. Plus, you have a very convenient array of all the data instead of a bunch of variables.
  16. Copying from pairs? Any reason you can't just NS.harvest = pairs;But are you executing this from a function? Either have the function return pairs, or forget the function and just access NS.harvest (after setting it) directly.
  17. What's the raw $output you got?
  18. Try variable variables. return (isset(self::${$methodProperty}) ? self::${$methodProperty} : null);
  19. Are you sure it's not something simple like having the wrong URL or the wrong filename? Even if PHP wasn't working, going to the right URL should get you something besides a 404. You don't have readline installed, which is fine. Enter anything you want there, remembering to use <?php and ?> when you want in and out of PHP mode. Whatever you input should be like a valid .php file. When you're done hit ^D and PHP will execute whatever you entered.
  20. if ($option->textContent = $_POST['txtTitle']) {Count your equals signs. But you actually use the "value" attribute instead of the textContent since that's where the txtTitle value actually comes from.
  21. 1. print_r() is only for debugging. Not "primarily". Only. It's a string. Just output the string with an echo or print. 2. Find the appropriate (a simple loop over the select node's getElementsByTagName("option") with a check of their values) and if you find one set its "selected" attribute.
  22. If the "time" field is an integer then don't use date(). If it's a DATETIME field then you should be using "Y-m-d H:i:s" format for the date. $d=date('Y-m-d H:i:s', time() - 5 * 60);If that's still not working, what are the values of some of the rows from the navigate table you expected it to find?
  23. ...If the upload isn't successful then don't do anything with the file. Only when error=UPLOAD_ERR_OK (0), the first thing you should check, do you continue with the process and bother to check file extensions and types and whatnot. The ones that don't upload: how about a more useful error message than "something is wrong"? There are error codes you can look up to find out what happened.
  24. You're welcome No. The part I'm talking about isn't there. Not in any of the files you posted. None of them. Only that second script you found (and discarded) way back when had it. I'm sorry that you don't know anything about IPN. I'm sorry that you went out and bought something incomplete. I'm sorry that you think you have all the pieces when you don't. But I'm not sorry that you're leaving.
  25. That "final script" is still missing the part that verifies the IPN message. That was the problem. Big problem. You need to write code so that it verifies the message or else use a different script.
×
×
  • 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.