-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
If you liked using objects more and just weren't sure how to, it goes like $ua_type = $api_result->device->type; Looks a lot like the array syntax, right?
-
Guidance for what? Surely you understand what the problem was before? What's left to fix?
-
We're getting a bit out of sync now but whatever. You see "category". That means the code is trying to show the category page. You don't have anything set up for $text on the category page.
-
(sigh) Do you know what "category" means? Why you are seeing it on the page now? Where that value is coming from?
-
I can pretty conclusively tell you that the code is not running as you've portrayed. Programming isn't magical or random: computers follow a very specific set of instructions (code) as entered by a programmer. I could be missing something obvious, but assuming not then the code you've shown will not cause the problems you have. There is something going on that we can't see because we're not sitting in front of your computer, and ignoring us by saying "well that's how it is" and "it's not my code" doesn't help us and more importantly doesn't help you. How about you post the entire contents of the PHP half of this? Unedited, as it is right now.
-
find . -name .htaccess | while read L; do [ -e "$L.dev" ] || cp "$L" "$L.dev"; done Find all .htaccess files, and for each one test if there exists a .htaccess.dev and if not copy from the .htaccess.
-
Then what I said is still true...
-
Then either none of those conditional blocks are running, or you have the PT_LoadPage code in the wrong place. As a test, make sure this works: 'TEXT' => 'Test text'
-
A RecursiveDirectoryIterator (searches directories recursively) wrapped in a RecursiveCallbackFilterIterator (lets you give it a function to filter to just the files you want) wrapped in a RecursiveIteratorIterator (lets you foreach over it without having to care about the recursion) can find all the .htaccess files. If you're considering a non-PHP approach because you only need to do this once then I would probably just do it manually. Surely there aren't too many of these, right?
-
That code should work. The problem is somewhere else - either you're looking at the wrong pages or you're somehow not changing the value of those variables.
-
Previous, and next record (when NOT ordered by ID)
requinix replied to KillGorack's topic in PHP Coding Help
Given that this is historical data and so not expected to change, I would assign each record a number according to the air date. Which could be the episode number. So you could just fetch the previous and next episodes according to the episode number. -
The file is being executed through that PT_LoadPage function. Variables defined in your first PHP file will not be accessible in the second file. If you want to send a value through then do it like the other values are being sent through.
-
How is searchEquipmentTable being called? The idea is to remove IDs (unless you need them for something else), and possibly add a class or two in a couple places, so that you can find the elements you need in a generic way. For example, if you always have the whole form dedicated to this search (like you won't do two searchable tables in the same form) then you can identify the search input as being the textbox with the (eg) "table-search" class, and the table to search is the only table inside the form. element.querySelector() is the key. An alternative is to keep IDs but use data attributes so the Javascript can read them to determine what to do. Like the form or something would have a data-table-search-input="#equipmentTableSearch" and the input would have a data-table-search="#equipmentTable". The initial code knows how to find the form/something, looks up the data-table-search-input attribute and .querySelector()s it to find the input, then looks up the data-table-search attribute and .querySelectors() it too to find the table. One of those approaches might make more sense based on the rest of the page as well as how similar the other pages and their search forms are.
-
Did you restart Apache/nginx/PHP so the change takes effect?
-
"Related" how? The PHP needs to be executed before the HTML, and they must both happen during the same request (so like without any redirects).
-
Switch from IDs to classes. Or data attributes. What's the HTML for the table, including the input?
-
If "row" is the row you want to move around within the current table, then row.parent().prepend(row); // move to beginning row.parent().append(row); // move to end
-
Executed. Not inserted. PHP did not perform some sort of virtual copy-and-paste of the included file's contents into the point where the include call was. What PHP did was execute the file. You said that an include "is the same as though you cut and pasted". I'm picking at how and why that statement is factually incorrect.
-
No, it does not work like that. Consider this: <?php // one.php if (false) include "two.php"; <?php // two.php echo "first statement\n"; echo "second statement\n"; and compare with <?php if (false) echo "first statement\n"; echo "second statement:\n";
-
In other words, no: each file has to be syntactically valid in its own right. An include means to run the file, not to "insert" the code at that point.
-
Is there a way to convert Bitcoin to Satoshie and vice versa?
requinix replied to imgrooot's topic in PHP Coding Help
This is what converts. function convertToBTCFromSatoshi($value) { $BTC = $value / 100000000 ; return $BTC; } Do I need to say anything more? -
mysqli affected rows not working with INSERT
requinix replied to pcborges's topic in PHP Coding Help
#define HTTPC_ERROR_READ_TIMEOUT (-11) -
mysqli affected rows not working with INSERT
requinix replied to pcborges's topic in PHP Coding Help
What is the name of it? Where can it be viewed online? -
mysqli affected rows not working with INSERT
requinix replied to pcborges's topic in PHP Coding Help
Your HttpClient library is returning -11. Not PHP. You have to find out why. What library are you using?