I’m using cakephp4. trying to add some sweetalert. Sweetalert is popping up when the delete button is clicked but when I click confirm for delete it’s not deleting the data. template/layout/Users/index.php template/layout/Users/index.php delete method is as follows in my UsersController.php UsersC…
Tag: php
How to get values from array object in PHP
I have the following array and when I do print(“<pre>”.print_r($term_arr,true).”</pre>”);, I get: I am trying to get the value of customer, so I did the following: But I have this error: PHP Notice: Trying to get property ‘customer’ of non-object in PHP Notice: …
how to set color warning when status “Waiting Confirmation”?
i want to make warning label for “waiting confirmation” status, the code as below : Answer Apologize to you first as I’m not a Laravel person, but this would be solve by just basic if-else. The code would look like this (you may encounter some syntax error but the idea is there):
I’m getting an error in the Display page of my PHP form
I am trying to make a form using PHP that after pressing the submit button, displays the data a person has entered but I’m getting an error that states Undefined array Key “ticket4” in the display page due to Drodown menu and the 4th option of the checkbox not getting displayed on the displa…
PayPal: Verify webhook notifications in PHP
PayPal’s documentation is pretty bad, but they do have a PHP notification verification sample here which mentions: PHP Currently does not support certificate chain validation, that is necessary to validate webhook directly, from received data. To resolve that, we need to use alternative, which makes a c…
PHP – preg_replace for /[[:punct:]]/ isn’t removing double quotes
I’m trying to strip punctuation in the following string “Peter !!!!!!!! MacIntyre” (including the quotes at the end of the string). I’m using this code: The output I’m getting is 34 Peter MacIntyre 34. The exclamation marks are replaced as it should be. However, the double quotes…
PHP: Line break is not working in data table using MYSQL?
Hi I have data in my MYSQL which I am trying to sort by Months and Year together and display it in new HTML table every time sort by Year and months. trying to do like this – (Months wise data) But HTML table is sorted by year only not months. see below the output. But I am trying to
PHP function to insert html tags before specific characters [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question I have …
How to cast string boolean from MySQL to real boolean in Javascript?
I built a php backend for my ReactJS frontend. My mysql users table has a checkedIn column that is stored as tinyint. I am fetching it like: And in my frontend: My log gives me: How can I modify my backend or my frontend, to have a real boolean value for checkedIn in the frontend? I expect: As a side
PHP password_hash and password_verify weird issue not verifying [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed las…