-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
If you want to make sure $argument is an array then you need public function authorize($ability, array $arguments)If you want the default value to be an empty array then you need public function authorize($ability, $arguments = array())If you want both - which I suspect is the case - then do both.
-
The DOCUMENT_ROOT method is the best method. Remember that it starts at the root of your website (which is apparently "media"), not the current directory. Using __DIR__ is the second best method and is relative to the current directory. include(__DIR__ . "/inc/chaserData.php");
-
Don't store comments in a text file. Get a database. Even a SQLite database will do the job, if you don't have a real one available. Then all you have to do is run a query on the database to see if the BTC address (being the most reliable piece of information you have) has already been entered.
-
So how much PHP do you know?
-
Do you have access to the SMTP server logs? Or your hosting provider? Can you confirm that the server is receiving an email message as expected? Alternatively you could (maybe) set up a local sendmail that logs everything, then send your email through that and compare the messages when sent through cron and the browser. In other words, gather information. Confirm that stuff is working at it should at each step after your code. Compare what you see with and without cron.
-
failing to declare a varible from an lower positon
requinix replied to AzeS's topic in PHP Coding Help
What matters is the relationship between all that code you've posted. Yeah, sure, you have something that defines those variables, but is it executing before everything else? Are the variables defined in the global scope like your code seems to expect them to be? Post all the code at once. Whole files, not just a couple blocks from them. -
Talk to your host about whether they even have multiple versions of MySQL available.
-
It's likely done using CSS classes, and possibly a bit more HTML markup (which the plugin adds dynamically). Use your browser to "inspect" the other elements. See what the markup looks like, then replicate that with the input: add classes, wrap with spans, whatever. But know that what they use may not work with elements, in which case you'll have to do your best to get the same appearance manually.
-
That kind of markup isn't allowed. It's not how s work: they take s, not any arbitrary HTML you want. What are you trying to accomplish with it? Match the appearance?
-
For future reference, it really helps if you can explain what your problem is. Like "I included this Javascript but it's not changing the dropdowns". Follow the steps on that page: 1. Add the two 3. Copy that code they give you but change the selector (in $("select")) to match your markup. Since you have a "dropdown_box" class you can use that: $("select.dropdown_box") 4. Add the CSS. That should be all. You don't even need to change the HTML markup for your form.
-
Did I hear somebody ask for an analysis? No? TOO BAD! Demo: <html><body> <form action="" method="post" class="wpcf7-form testing-forms" novalidate="novalidate" id="test_1"> <p> <span class="wpcf7-form-control-wrap selector"> <select name="selector" class="wpcf7-form-control wpcf7-select selector" id="testing" aria-invalid="false"> <option value="first option">first option</option> <option value="option 1">option 1</option> <option value="option 2">option 2</option> <option value="option 3">option 3</option> <option value="option 4">option 4</option> <option value="option 5">option 5</option> <option value="option 6">option 6</option> <option value="option 7">option 7</option> </select> </span> </p> <p> <span class="wpcf7-form-control-wrap secondselect"> <select name="secondselect" class="wpcf7-form-control wpcf7-select" id="test_more" aria-invalid="false"> <option value="Second Option 1">Second Option 1</option> <option value="Second Option 2">Second Option 2</option> <option value="Second Option 3" selected="selected">Second Option 3</option> <option value="Second Option 4">Second Option 4</option> </select> </span> </p> <p> <span class="wpcf7-form-control-wrap checkTester"> <span class="wpcf7-form-control wpcf7-checkbox" id="checkTesterOption"> <span class="wpcf7-list-item first"> <input type="checkbox" name="checkTester[]" value="Option 1" /> <span class="wpcf7-list-item-label">Option 1</span> </span> <span class="wpcf7-list-item"> <input type="checkbox" name="checkTester[]" value="Option 2" /> <span class="wpcf7-list-item-label">Option 2</span> </span> <span class="wpcf7-list-item last"> <input type="checkbox" name="checkTester[]" value="Option 3" /> <span class="wpcf7-list-item-label">Option 3</span> </span> </span> </span> <br /> <span class="wpcf7-form-control-wrap checkTester2"> <span class="wpcf7-form-control wpcf7-checkbox" id="checkTesterOption2"> <span class="wpcf7-list-item first last"> <input type="checkbox" name="checkTester2[]" value="Option 2-1" /> <span class="wpcf7-list-item-label">Option 2-1</span> </span> </span> </span> </p> <p> <span class="wpcf7-form-control-wrap text_testing"> <input type="text" name="text_testing" value="" size="40" class="wpcf7-form-control wpcf7-text" aria-invalid="false" /> </span> </p> <p> <input type="submit" value="submit" class="wpcf7-form-control wpcf7-submit" /> </p> </form> <pre> </pre> <script type="text/javascript"> function typeofex(value) { var t = typeof(value); return t == "object" && value["constructor"] && value["constructor"]["name"] ? t + "(" + value.constructor.name + ")" : t; } var pre = document.getElementsByTagName("pre")[0]; for (var i in document.forms) { for (var j in document.forms[i].elements) { pre.innerHTML = pre.innerHTML + "forms[" + i + "].elements[" + j + "] is a " + typeofex(document.forms[i].elements[j]) + "\n" + ".name = '" + document.forms[i].elements[j].name + "'\n" + ".type = '" + document.forms[i].elements[j].type + "'\n"; } } </script> </body></html>Output from Chrome 51.0.2704.103: forms[0].elements[0] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[0].elements[1] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[0].elements[2] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[0].elements[3] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[0].elements[4] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[0].elements[5] is a object(HTMLInputElement) .name = 'checkTester2[]' .type = 'checkbox' forms[0].elements[6] is a object(HTMLInputElement) .name = 'text_testing' .type = 'text' forms[0].elements[7] is a object(HTMLInputElement) .name = '' .type = 'submit' forms[0].elements[testing] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[0].elements[selector] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[0].elements[test_more] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[0].elements[secondselect] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[0].elements[checkTester[]] is a object(RadioNodeList) .name = 'undefined' .type = 'undefined' forms[0].elements[checkTester2[]] is a object(HTMLInputElement) .name = 'checkTester2[]' .type = 'checkbox' forms[0].elements[text_testing] is a object(HTMLInputElement) .name = 'text_testing' .type = 'text' forms[0].elements[namedItem] is a function .name = 'namedItem' .type = 'undefined' forms[0].elements[length] is a number .name = 'undefined' .type = 'undefined' forms[0].elements[item] is a function .name = 'item' .type = 'undefined' forms[test_1].elements[0] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[test_1].elements[1] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[test_1].elements[2] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[test_1].elements[3] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[test_1].elements[4] is a object(HTMLInputElement) .name = 'checkTester[]' .type = 'checkbox' forms[test_1].elements[5] is a object(HTMLInputElement) .name = 'checkTester2[]' .type = 'checkbox' forms[test_1].elements[6] is a object(HTMLInputElement) .name = 'text_testing' .type = 'text' forms[test_1].elements[7] is a object(HTMLInputElement) .name = '' .type = 'submit' forms[test_1].elements[testing] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[test_1].elements[selector] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[test_1].elements[test_more] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[test_1].elements[secondselect] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[test_1].elements[checkTester[]] is a object(RadioNodeList) .name = 'undefined' .type = 'undefined' forms[test_1].elements[checkTester2[]] is a object(HTMLInputElement) .name = 'checkTester2[]' .type = 'checkbox' forms[test_1].elements[text_testing] is a object(HTMLInputElement) .name = 'text_testing' .type = 'text' forms[test_1].elements[namedItem] is a function .name = 'namedItem' .type = 'undefined' forms[test_1].elements[length] is a number .name = 'undefined' .type = 'undefined' forms[test_1].elements[item] is a function .name = 'item' .type = 'undefined'Output with Edge on Windows 10 build 10586.494: forms[test_1].elements[selector] is a object(HTMLSelectElement) .name = 'selector' .type = 'select-one' forms[test_1].elements[secondselect] is a object(HTMLSelectElement) .name = 'secondselect' .type = 'select-one' forms[test_1].elements[checkTester[]] is a object(HTMLCollection) .name = 'undefined' .type = 'undefined' forms[test_1].elements[checkTester2[]] is a object(HTMLInputElement) .name = 'checkTester2[]' .type = 'checkbox' forms[test_1].elements[text_testing] is a object(HTMLInputElement) .name = 'text_testing' .type = 'text' forms[test_1].elements[ms__id261] is a object(HTMLInputElement) .name = '' .type = 'submit' forms[test_1].elements[length] is a number .name = 'undefined' .type = 'undefined' forms[test_1].elements[item] is a function .name = 'item' .type = 'undefined' forms[test_1].elements[namedItem] is a function .name = 'namedItem' .type = 'undefined' Chrome: - elements provides iteration over its Collection numerically and associatively: by index in the collection, by id if given, and by name if given. This seems to apply to all Collections. - Accessing duplicate elements in the Collection by name gives another Collection Edge: - elements provides iteration over its Collection associatively by name, using a placeholder value if none is given - Accessing duplicate elements in the Collection by name gives another Collection - Iteration over the Collection does not expose numeric keys, however numeric keys to elements are accepted So actually the behavior you're seeing in IE/Edge is also present in Chrome, but is hidden by the fact that you still get the information you need as its provided via the numeric keys. What doesn't help this is that the HTML/DOM standards don't seem to indicate precisely how iteration should work. At this point I would offer an alternative to your for..in but you haven't said what you're trying to do with this code. Truthfully, since it surfaces all members of an object, for..in actually provides an attack surface for use with XSS and is thus generally discouraged without the developer taking proper protections.
-
Sounds like OP is using a script that polls a file('s modification time) and needs it to be polling against a database instead.
-
PHP 7.0.8 password_verify not returning a value
requinix replied to cjburkey01's topic in PHP Coding Help
Since the whole point of password_hash() is so that you don't have to think about what the defaults are, make sure you keep up to date with any changes made to the function. Case in point, PHP will likely switch the default to argon2 soon so a hardcoded bcrypt will be out of date. -
PHP 7.0.8 password_verify not returning a value
requinix replied to cjburkey01's topic in PHP Coding Help
Note that the correct hash for that password+salt is $2y$10$YOVX2MCk8KSpUuii5fEQ5.fchxgv0ZkbWxTGnOcHwgqfvspDNsYlmso you do, in fact, have the wrong password. -
This calculator thing doesn't work, help me Jacques you're my only hope
requinix replied to siby's topic in Javascript Help
Thread split -
It's virtual running on hardware owned by our owners - so essentially dedicated. I don't have any information about bandwidth.
-
Fatal error: Call to undefined function odbc_connect() in
requinix replied to kat35601's topic in Microsoft SQL - MSSQL
Then that means you don't have the ODBC extension installed. Wherever you got PHP 5.5 probably also has a php-odbc package for it. -
$status[2] lolwat
-
By learning what those \us mean and thereby understanding that they're supposed/allowed to be there? And by saving your file in UTF-8 format and getting rid of those calls to utf8_encode. And by dropping the JSON_ERROR_UTF8. If you look at the documentation you'll see it's not one of the allowed options. And really, it has "error" right there in the name: does that sound right?
-
Ooh, good call. Basically function ifx_connect($database, $userid, $password) { return new PDO("???", $userid, $password); // the DSN is probably like ifx:mydb@ol_srv1 } function ifx_query($query, $link_identifier, $cursor_type, $blobidarray) { return $link_identifier->query($query); // don't know what to do with $cursor_type or $blobidarray }
-
The informix extension was abandoned years ago. It probably doesn't work with any version of PHP after 5.2. It sucks but you'll need to rewrite the code to work with pdo_informix.
-
Field values are not updaing using AJAX and json
requinix replied to bravo14's topic in Javascript Help
First thing you have to do is get rid of those echo()s and print_r()s. They'll mess up the AJAX. Second, and more to the point, is success: function(data){ $('#hidshippingCost').val(shippingCost); $('#total').val(totalDisplay); $('#hidTotal').val(total); }The only variable you have to work with is data. There is no "shippingCost" or "totalDisplay" or "total". You have to get those values from with the data object. success: function(data){ $('#hidshippingCost').val(data.shippingCost); $('#total').val(data.totalDisplay); $('#hidTotal').val(data.total); }