-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Then... use it? Then... don't use it? I don't see how that can help you since it'll send everything (that doesn't exist) to index.php when you want to send those specific URLs to /products/product.php. Maybe. 1. What URLs currently work? The non-rewritten, unfriendly ones. /products/product.php?product_id=123? 2. Look at the pieces of that URL that can vary with the products. Looks like just the product_id. 3. What URL do you want to use? The rewritten, friendly ones. /products/product/123/Name? 4. Does that second URL contain the varying pieces of the first URL? It needs to. It can have other things too, like the product name, but at a minimum it needs to include the product_id somewhere.
-
Sure: keep getting the fatherid in a loop until you end up with one of the starter dog IDs. $id = 222 while $id is not of a starter dog { $id = get fatherid of $id }(or another similar loop construct)
-
Then it might be a problem with whatever you're using to manually set those values. If it's just a one-time thing (it's not like the problem keeps popping up in places where it wasn't before) then I'd say just fix the values manually. I'm not sure what this "deleting the value and adding it again" means but try just issuing an UPDATE query (or maybe DELETE and INSERT?) with the right value. Typed manually so you're sure there's nothing else in there. Could that be a degree character °? Yeah, but there's no way to "un-question mark it" to know. Would something have corrupted the entire database? No, but it didn't sound like there were widespread problems and that it was just this value (or maybe a couple others).
-
Because $orders is not an array (or other iterable object). Check that getOrdersWithInformation().
-
It would truncate the strings to 10 characters but that probably wouldn't pose a problem for you unless you're dealing with numbers in the millions. And yes, you should use either a float or a decimal type for that data (probably float). There is something there, even if you can't see it "in the database". Have you looked for it in the CSV?
-
Don't use VARCHAR for numeric data. That particular value has some character in front of it. What is it?
-
Since it seems nobody else can find anything useful, you might just have to rethink how you do this. Perhaps some combination of removing some code and rewriting other code will magically avoid this Chrome problem.
-
A1. // prints Test on the screen echo Test->getTest2(); No it doesn't. A2. Irrelevant because all three do slightly different things: first sets a value and returns it, second just sets a value, third just returns a value.
-
Hide part of directory structure in URLs?
requinix replied to JohnnyDoomo's topic in Apache HTTP Server
Rewrite "/numbers/category/title/" to "/clip/videos.php/photo/the stuff matched". That can only happen if the 503 you're rewriting is not necessary. If it is then you have to include it in the URL you want to show. To rewrite "/Game_Videos-503/" (as an example), Rewrite "/category-numbers/" (so long as it's not a real file or directory or other part of your site) to "/clip/showgallery.php/cat/numbers/category". For that "not a real file or directory" you can use RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-dbefore your RewriteRule. For the "other part of your site" all you have to do is put this RewriteRule (and the Conds) near the bottom of the list of other things being rewritten. (Don't forget to use [L]s for pretty much everything.) Give that a shot? -
Never had problems myself. What doesn't work?
-
Don't write your own CSV reading and writing code. fgetcsv fputcsv
-
Are you sure that's the actual output of your script and not, say, what your browser is interpreting? The output isn't actually
- 2 replies
-
- htmlentities
- htmlspecialchars
- (and 3 more)
-
Going through date functions is overkill if you're just outputting hours. for ($i = 8; $i <= 18; $i++) { if ($i == $_SESSION['pickuptime']) { echo "<option selected value=\"" . $i . "\">" . sprintf('%02d', $i) . ":00</option>"; } else { echo "<option value=\"" . $i . "\">" . sprintf('%02d', $i) . ":00</option>"; } }
-
Parse error: syntax error, unexpected P_LNUMBER
requinix replied to BTIconnect's topic in PHP Coding Help
The forum software is generating unusual HTML markup for that line. Try just deleting it and typing it again. -
1. One php.ini means one PHP version too. At the very least the same major+minor (eg, 5.2.x). So there's that. 2. Then figure out what the various installations need. Find a common denominator. 3. Test. And yes, you can symlink /etc/php.ini to wherever the actual file is.
-
Use a loop? Depends how you're doing things now - it's not like you've given us those kinds of details.
-
No. How's your search gone?
-
You can't delete directories with unlink() anyways so is_file() should work for it. Turns out glob() is still easier to use after all - mostly because you're looking at files in a different directory. Since I've now changed my mind a second time I'll present to you a bunch of options: If you can use GLOB_BRACE you can $menus_dir_path = "stores/".$store_name;// Path to the menus assets array_map("unlink", array_filter(glob($menus_dir_path . "/{*.*,.*}", GLOB_BRACE), "is_file"));If not you can array_merge(). $menus_dir_path = "stores/".$store_name;// Path to the menus assets array_map("unlink", array_filter(array_merge(glob($menus_dir_path . "/*.*"), glob($menus_dir_path . "/.*")), "is_file"));Or you can loop over a FilesystemIterator. foreach (new FilesystemIterator($menus_dir_path) as $file) { if ($file->isFile()) { unlink($file->getPathname()); } }Or something similar with scandir() foreach (scandir($menus_dir_path) as $file) { if (is_file($menus_dir_path . "/" . $file)) { unlink($menus_dir_path . "/" . $file); } }which you can convert to an anonymous function and pass to array_map() (something you couldn't do with the FilesystemIterator).
-
Forget what I said. Since you want all files in the directory use scandir instead of glob(). It will also include "." and ".." so you'll need to filter those out.
-
Dot/hidden files do not match against the *.* pattern. Try just *
-
That's a regular program written in C - not a "script". Check if it mentions any libraries it needs to run, and if not you can probably just compile it yourself for your machine. Also a program, also written in C. jPlayer is a jQuery plugin. Take a look at its quick start guide.
-
I haven't found a way yet. I'm basically just Googling around for inspiration.
-
Ah, I see. Hear, even. I wasn't actually listening to the audio so I couldn't see anything happening. What browser are you testing in? I think there's a bug with Chrome: I can consistently make the audio control think it's 14 or 21 seconds off (depending what I do), and seeking works fine my IE.
-
htaccess and url encoding ? Escaping + and &
requinix replied to gdfhghjdfghgfhf's topic in Apache HTTP Server
Your requirement is that it has to happen completely inside the .htaccess, right? No changes anywhere else? Then no, not that I can think of.