-
Posts
15,264 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
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
-
So the line of code is $this->error[] - "The E-Mail that you provided is not valid."; Take a closer look at it.
-
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?
-
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).
-
strange problem!!!only work after a refresh!
requinix replied to joomtalk's topic in PHP Coding Help
I can't tell if you answered my earlier question so I'll ask it again: -
strange problem!!!only work after a refresh!
requinix replied to joomtalk's topic in PHP Coding Help
So does it work or does it not work? -
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.
-
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.
-
Doing it beforehand is nice and all but is not a substitute for doing it on the server.
-
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?
-
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Then for lack of a better understanding of what you're trying to say, no it's not possible. -
strange problem!!!only work after a refresh!
requinix replied to joomtalk's topic in PHP Coding Help
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? -
Are you including the jQuery library somewhere? It's not in the code you posted. Yep.
-
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Okay, so you're using MONTH()... Is there a problem? -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
I hesitate to ask but what have you tried so far? -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
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. -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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. -
Insert only date where month is not previous month
requinix replied to newphpcoder's topic in MySQL Help
For the record, please post the exact code you have right now. -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
If you don't have any variables then how do you know which three months you want? -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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.) -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Sure, you can use MONTH(). But if you don't have any variables then what are you going to use it with? -
select the first three consecutive months
requinix replied to newphpcoder's topic in PHP Coding Help
Yes. There are two. I posted an EXACT usage of one and a big hint for using the other. -
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
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) ; -
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)
-
Convert Month Number to Month Name in a Range
requinix replied to newphpcoder's topic in PHP Coding Help
echo implode(", ",monthNames(5,7)); echo monthNames($FromMonth, $ToMonth); There's a major difference between those two lines.