Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Might I suggest not using backslashes at all?
  2. Because "John" is a reasonable example of an fname, I would think...
  3. PSA: I will remove any further posts which tell OP how to do the task as-asked. As well-intentioned as the question and its direct answer is, using variable variables is not a good thing.
  4. 1. https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity 2. <table class="classname"> <tr> <td>This has the class</td> </tr> </table> <div class="classname"> <table> <tr> <td>So does this</td> </tr> </table> </div>
  5. What? Rather than this pattern you're starting, which I think you're saying doesn't work, consider sprintf: $domains = [ "BSCSCAN" => "https://bscscan.com/token/%s", "TRONSCAN" => "https://tronscan.org/#/token/%s", "DGB" => "https://dgb.com/token/%s", // ... ]; $url = sprintf($domains[$checkSqlRow["ADDRESS"]], $address); echo "<td><a href='$url' style='color:lime' target='_blank'>$address</a></td>";
  6. Admins really don't like it when users try to bypass restrictions.
  7. If you're using PDO and SQLite then why is there calls to mysqli_query and mysqli_close in there?
  8. That would be because the HTML is invalid. Did you notice that?
  9. Which is why I didn't say anything about it being wrong or not working. And I'm trying to tell you what you have to change with your not-working code in order to make it work.
  10. So basically it's a question of syntax. <?php tags are for entering PHP mode. this is html mode <?php this is php mode echo "this is still php mode even though you're outputting html"; ?> back to html mode So the <?php in echo '<a href="https://bscscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?></a>'; won't work because you're already in PHP mode. Compare that to <a href="https://bscscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?> "style="color:lime" target="_blank"> which starts in HTML mode, uses <?php to switch to PHP mode and output the address, then switches back to HTML mode. If you want to echo some HTML with a PHP variable in it, you can do that with echo '<a href="https://bscscan.com/token/', $checkSqlRow["ADDRESS"], '</a>';
  11. That's a lot of queries to run. Start off with a single query that gets all the replies for that post or whatever it is. All of them. Then shove them into an array based on their parent ID. $comment_parents = []; $count = 0; /* get each $row from the query { */ if (!isset($comment_parents[$row['parent']])) { $comment_parents[$row['parent']] = []; } $comment_parents[$row['parent']][] = $row; $count++; /* } */ That also gets you a count of the number of comments, which it seems you want. Now you display them. What's the markup? I don't know. But you're pretty much guaranteed take a recursive approach: show one comment, then immediately show all the comments below it, and repeat. function showComments(array $comment_parents, array $comment, int $level = 0) { /* show the $comment */ foreach ($comment_parents[$comment['id']] ?? [] as $child) { showComments($comment_parents, $child, $level + 1); } } foreach ($comment_parents[0] as $comment) { showComments($comment_parents, $comment); }
  12. The best way we can help is if you know what you want to do but don't know what the code needs to be. We're good with code. We're not good with things like "able to show ethscan website". You have to figure out what it is you need to do - like, are you talking about a <a> or an <iframe> or what - and then we can show you what code you need to do it.
  13. Not that I know of. But are you sure you want something slick? Maybe something readable would have its advantages?
  14. To get a new number every day, seed the RNG with a number that stays the same all day long - say, the date in YYYYMMDD format - then request a random number. With the same seed you'll get the same sequence of numbers.
  15. SoapClient::__setSoapHeaders looks relevant.
  16. Is that what you want to do? Find out the "character" position for a match's byte position? You're only giving out small pieces of information at a time. It's hard to give advice on broader problems or situations when we have to work with is your use of mb_strlen and substr...
  17. Bytes and characters are not the same thing. You think it's characters, PHP is telling you bytes.
  18. $x = 70.889661; I don't understand this thread.
  19. I don't see any H2s with ids on the page. You can't link to one of them until they are given ids. Why do you not have a page dedicated to showing a single article? You should be linking to that, not to some anchor buried deep on a paginated page.
  20. Variables defined outside of functions are not available inside of functions. If you need $pdo then pass it as an argument like you're already doing for $id.
  21. I was actually trying to point out that you're attempting to solve your problem the wrong way. If you have an ID and want to make sure it exists then what you do is execute a query to see if there are rows matching that ID. You do not retrieve every single one. That's terribly, terribly inefficient. SELECT 1 FROM customer_details WHERE customer_id = ? Use that as a prepared statement and put your expected ID value into it as a parameter. Then execute and see if you got any rows back. But what's more, I'm skeptical you even need this at all. What are you going to do later on? You said redirect to yet another page? Why? Why can't you check that the row exists on that page? And you know, when you do that, your edit page is going to need to retrieve the records from customer_details too, and won't that look very, very much like the above query? So not only do you not need this page, you don't even need this query because your edit page will find out if the ID doesn't exist when it tries to load up the data it needs. Does that make sense?
  22. To make sure I'm understanding what's going on so far, You have an ID in $_GET. To see if that's a valid ID, you grab every single ID from the database and then check to see if the one you want is in there?
  23. More or less. What sorts of settings are you thinking about? Files are more suited for things that you don't really ever need to change, like the name of the website or its domain name, not to mention "obvious" configuration stuff like database information and credentials. What's "most practical" really depends on what you need to do, and how often...
  24. Modern search engines don't care as long as the URLs can uniquely identify the content they show.
  25. An SVG of that image would be very small...
×
×
  • 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.