Jump to content

requinix

Administrators
  • Posts

    15,266
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. Hiding the extension is only for the links and the forms and the other things that happen inside the client's browser. You haven't actually renamed the files.
  2. No. Outputting is how you return something through AJAX. Then it sounds like you have a bug: your script is doing something it's not supposed to do. Figure out where the flaw in the logic is that's causing the script to output when not being triggered through an AJAX action. You best get over those qualms soon because every user can see exactly what is sent and received over AJAX. And no, there's nothing you can do about it directly so make sure you don't need to send or receive anything you wouldn't want the user to know about.
  3. It's not. fputcsv($handle, $row, ";", chr(0));You specifically say in your code to use \0 as the quoting character. If you don't want that then don't do it and pick something else. Or let PHP go with the perfectly reasonable default value of an actual quote character.
  4. Use a different editor to look at the file. It's using a typical representation of control characters by showing them as "^" + chr(64 + code), like how you might see ^C if you hit Ctrl+C with a command-line application.
  5. Is your code missing a quote or did you not copy/paste your code here?
  6. That. Don't tell people you're sending Excel files when you're actually sending CSV files.
  7. I don't see how it would be doing that. fputcsv() adds newlines for you. What are you using to view the file?
  8. 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))
  9. 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?
  10. 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"?
  11. 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?
  12. 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.
  13. 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
  14. 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." ";
  15. foreach over $result_list. while ($result_list = mysqli_fetch_array($result, MYSQL_ASSOC)) { foreach ($result_list as $column => $value) { echo $column . " = " . $value . "<br/>\n"; } }
  16. $result_list already has all the columns. See where it says "owner"? That's the column name.
  17. 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.
  18. Most good PHP IDEs will do all that. Netbeans, for example.
  19. The names. Variables, classes, functions, whatever. They're all names - they just happen to not be written using letters from a keyboard.
  20. str_replace
  21. No existing tool that I know of.
  22. What were the rewriting rules before you made the change? And exactly how does it "affect all the other links"?
  23. 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.
×
×
  • 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.