Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. if(!$stmt = sqlsrv_prepare( $conn, $sql)) foreach($stmt as $row)$stmt is a resource. You cannot foreach over it. You have to fetch from that resource, like while($row = sqlsrv_fetch_array($stmt))
  2. Not working how? You can't just give one-sentence posts and expect us to know what you're talking about or where your problem(s) may be.
  3. Apparently you don't mean actually duplicating a website but duplicating a particular page. The thing you need is "URL rewriting". What you do is tell your web server that requests for "/ID1234" (or anything matching that kind of pattern) instead get internally rewritten to "/index.php?R=ID1234". Nothing actually gets duplicated, you still have just the one file, and the user is none the wiser. What are these ID things and what kinds of values do they have? Do they all fit the pattern "IDnnnn..."? Do you know that your "?R=ID1234" option can work right now without any of this URL rewriting stuff?
  4. Is news.php a real file? How about news_content.php? Try this: What do you want the URL to look like and what kind of code does it have to "execute"?
  5. That second argument is about not reindexing. You want the default behavior. I could drive across the country for some ice cream, but why would I want to do that when there's a grocery store down the block?
  6. Have you checked what the second argument to array_reverse() means? Why you're passing a true there? Because as it turns out you don't want to do that, making the array_values() unnecessary.
  7. 1. You can replace most of that code with one call to glob 2. The filenames are being stored as if they were strings. Which they are. "Photo19" sorts before "Photo2" because 1 comes before 2. Try sorting the array differently. P = P h = h o = o t = t o = o 1 < 2 9
  8. If you want to put "s inside a " string then you have to escape them. Otherwise how is PHP supposed to know where the end of the string is? $txt=" Messaggio inviato da: ".$utente." ";Since you're using HTML you can also use 's instead, either for the string or for the quotes inside it. $txt=" Messaggio inviato da: ".$utente." ";$txt=' Messaggio inviato da: '.$utente." ";
  9. foreach over $result_list. while ($result_list = mysqli_fetch_array($result, MYSQL_ASSOC)) { foreach ($result_list as $column => $value) { echo $column . " = " . $value . "<br/>\n"; } }
  10. $result_list already has all the columns. See where it says "owner"? That's the column name.
  11. Because you wrote two different numbers. Ex notation is short for *10^x, so when you write 10E-8 you're actually writing 10*10^-8 = 10^-7 = 1E-7.
  12. Most good PHP IDEs will do all that. Netbeans, for example.
  13. The names. Variables, classes, functions, whatever. They're all names - they just happen to not be written using letters from a keyboard.
  14. str_replace
  15. No existing tool that I know of.
  16. What were the rewriting rules before you made the change? And exactly how does it "affect all the other links"?
  17. I'm not talking about some fancy PHP thing. I mean find and replace in Geany or Notepad++ or whatever. Like Ctrl+F. Pick a name and change it to something readable, then find the other places it's used and change them too.
  18. a) Something changed in the past and the old code you have now should be updated as the old way may be unsupported soon, b) They anticipate something changing in the near future that may adversely affect what you have now (those are mostly E_DEPRECATED though), or c) You're doing something wrong but it was supported in the past, intentionally or not, so they're warning you instead of breaking it (for the time being)
  19. PHP allows most names to use high-byte characters (ASCII >127). It's valid PHP code. You'd have to do a sort of find-and-replace for each one, keeping in mind that replacing "ABC" might also find "ABCD" even though they're two logically different names. What are you trying to do? Obfuscated code typically has restrictive licenses.
  20. Where'd you get it from? It looks like a very clever form of obfuscation.
  21. That's the end result, yes. The first part is the .+? which matches as few characters as possible. Since the next part is a simple \/* then it would match everything up to but not including any trailing slashes. It's quite inefficient though (~3x slower for me), and certainly harder to understand than the equivalent string function-based $this->upload_path = rtrim($this->upload_path, "/") . "/";
  22. Probably in the root of your website, but at the least in the same directory as the script. (Which are apparently the same.) Generally not: bigger sites tend to use more sophisticated setups than letting Apache execute individual PHP scripts directly. Like they'll have something configured that says the "/contact" URL executes through a certain OOP class - not actually a particular .php file. Think of it as URL rewriting done with PHP code instead of with mod_rewrite.
  23. Probably MultiViews. In your .htaccess, Options +MultiViewsIt allows you to omit extensions from files that Apache recognizes.
×
×
  • 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.