-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Might I suggest not using backslashes at all?
-
Because "John" is a reasonable example of an fname, I would think...
-
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.
-
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>
-
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>";
-
Admins really don't like it when users try to bypass restrictions.
-
If you're using PDO and SQLite then why is there calls to mysqli_query and mysqli_close in there?
-
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>';
-
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); }
-
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.
-
Not that I know of. But are you sure you want something slick? Maybe something readable would have its advantages?
-
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.
-
SoapClient::__setSoapHeaders looks relevant.
-
PREG_OFFSET_CAPTURE returns wrong offset if there is a multibyte character
requinix replied to moxol's topic in Regex Help
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... -
PREG_OFFSET_CAPTURE returns wrong offset if there is a multibyte character
requinix replied to moxol's topic in Regex Help
Bytes and characters are not the same thing. You think it's characters, PHP is telling you bytes. -
$x = 70.889661; I don't understand this thread.
-
How can I anchor to a <h1 id="title1"> tag of external url?
requinix replied to eaglehopes's topic in HTML Help
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. -
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?
-
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?
-
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...
-
Can search engines crawl content of .php files?
requinix replied to eaglehopes's topic in Application Design
Modern search engines don't care as long as the URLs can uniquely identify the content they show. -
An SVG of that image would be very small...