Jump to content

requinix

Administrators
  • Posts

    15,264
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. I don't see how that script could cause high load. Only if it was being used a lot - generating most of the traffic and taking most of the processing time. By the way, that script allows anyone to download any file on your server. MP3 or not. I can just change the file name to anything, like force-download.php?file=force-download.php
  2. So the line of code is $this->error[] - "The E-Mail that you provided is not valid."; Take a closer look at it.
  3. The first URL would be easy if /SS.php didn't actually exist (like it was in an include/ directory or something). RewriteEngine on # does not exist as a file RewriteCond %{REQUEST_FILENAME} !-f # does not exist as a directory RewriteCond %{REQUEST_FILENAME} !-d # rewrite any /*.php through index.php RewriteRule ^[^/]+\.php$ index.php?page=$0 [L] If it does exist then the second URL would be easier because then you could assume anything in /pages/ is supposed to go through /index.php. RewriteEngine on RewriteRule ^pages/(.*)$ index.php?page=$1 [L] And FYI, Your first try causes a loop. The first time through it will rewrite every file in the root to index.php. The next pass will rewrite index.php back onto itself. The next pass will do it again. And again. Contrary to popular belief, [L] does not stop rewriting entirely. The second one... I'm not sure what you expected it to do. The URL will still be "/page/file.html" - that won't change. Are you talking about how "/index.php?page=file.html" URL doesn't change?
  4. requinix

    SQL Join

    Can't do it as you've stated. You have to give up one of the requirements. Either a) Use multiple queries (one for the question, one for the choices of each question). This is bad so don't do it. b) Allow the question information to be repeated in the results. Have the code deal with it. c) Another option which I won't mention because it's even worse than (a).
  5. I can't tell if you answered my earlier question so I'll ask it again:
  6. So does it work or does it not work?
  7. Sessions are not for keeping things out of the URL. It's not what they're for. It's part of how they work and not why they work. Nothing in the URL? Then use a POSTed form.
  8. Simple: don't use a session variable for it. Stick in the URL. script.php?dir=foo/bar/baz Be sure to validate it before you use it blindly.
  9. Doing it beforehand is nice and all but is not a substitute for doing it on the server.
  10. No. And it wouldn't make sense for there to be one either. It'd be a nightmare to work with in the code too. How many tables are you talking about? What are they for?
  11. Then for lack of a better understanding of what you're trying to say, no it's not possible.
  12. Does this code execute sometime before the login code? If not then how does this little code snippet work with the rest of the site?
  13. Are you including the jQuery library somewhere? It's not in the code you posted. Yep.
  14. Okay, so you're using MONTH()... Is there a problem?
  15. I hesitate to ask but what have you tried so far?
  16. Not as you're describing it. But that's okay because what you're describing is not true. Maybe this will be easier: Please post the code you have now. The stuff into which you're trying to insert this query.
  17. I was looking for the more specific "one uses implode() and one doesn't" but that's close enough. implode() turns an array into a string, right? monthNames() returns an array, right? If you echo an array you just get "Array", right? (The answer to all three is "yes", by the way.) Try using implode() on the one line that doesn't seem to work. Just like how you use it on the other line that does work.
  18. For the record, please post the exact code you have right now.
  19. If you don't have any variables then how do you know which three months you want?
  20. Deep breath. Look at the two lines of code I pointed out. You see them? Good. Now, tell me: what is the difference between them? They are not identical. How are they not identical? Explain to me, in English, what both lines do in as much detail as you can. Just do something that requires you actually looking at them and reading the code. If you haven't realized, I'm trying to show you why one works and the other looks like it doesn't work. (Because it does work.)
  21. Sure, you can use MONTH(). But if you don't have any variables then what are you going to use it with?
  22. Yes. There are two. I posted an EXACT usage of one and a big hint for using the other.
  23. Are you not looking at the code? Okay... Let me try adding some spacing to it. echo implode(", ", monthNames(5 , 7 )); echo monthNames($FromMonth, $ToMonth) ;
  24. You can't put if blocks directly inside a class definition. Instead, put them inside the get_machid() function like function get_machid() { if ($this->type == RES_TYPE_ADD) { return $this->resource->get_property('machid'); } else if ($this->type == RES_TYPE_MODIFY) { return $this->machid; } } (assuming that the "type" variable is a member of the Reservation class and not, say, a function parameter you haven't mentioned)
  25. echo implode(", ",monthNames(5,7)); echo monthNames($FromMonth, $ToMonth); There's a major difference between those two lines.
×
×
  • 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.