I have a php script that uploads a file into a folder : This works fine, don’t mind the fact that i don’t test if the files exist or other test, it is just to see how uploading a file works. I also did a script using Ajax to avoid the php file to be loaded and then redirect to
Tag: php
Why would SQL update the date into tabel to 0000-00-00 00:00:00?
I am trying to update the field SEEN in a SQL table to the current time and date. Here is the code: It sets my SEEN field to 0000-00-00 00:00:00. If I write a specific date directly into the query, say “2021-03-10 02:30:00” it would write that date into the SEEN field. But instead of $now, it woul…
Php code to see if two lines are parallel
I want to write a PHP code to see if two lines are parallel. We have But it’s not working correct even if given two parallel lines Answer The Slope is equal to m = (y2 – y1) / (x2 – x1) I made some changes in your formula so it’s working I think. it’s just a math problem
Laravel 8: Argument 2 passed must be an instance of
I’m working with Laravel 8 to develop an Online Forum. And I made this form for updating an answer of a user: And here is the route for this: And this is also the Method of QuestionController: But now the problem is, whenever I submit the form in order to update answer, I get this as error: Argument 2 p…
php loop show current year data if not found instead of skiping
So I have a loop within a loop both have year data and I’m trying to figure out how to show current year (2021) data if years don’t match or exist on loop instead of using continue to skip the entry, any ideas or solutions are appreciated. LIVE CODE: http://sandbox.onlinephpfunctions.com/code/b7cb…
My PHP not processing input from radio buttons
EDIT: Some more searching on the wide web led me to this… Later on, in my form, I disable these radio buttons to prevent users from changing their previous answers after some time… Is it possible that the PHP is not reading the diasabled buttons? How should I then prevent the change of radio butto…
PHP – format path urls
In my PHP project, I have an url path string returned like: What I would like to accomplish is for this two paths to be without and % .. How can I format them? I know this question is already answer but I can not find right PHP fucntion for it. Code: and the problem persists. Answer Working Solution:
How to use CakePHP ORM to query belongsToMany relationship
I am working on a custom query builder piece of code that supports a CakePHP 3 based API. I recently got a request to make it search against a Task item for associated Users. The association from a Task to users is a belongsToMany, which has not been supported in the custom query functionality up to this poin…
Converting a php cryptography and hash_hmac(‘sha512’ code to c#
I am having troubles converting a cryptography code from php to c#, and i would really appreciate some help, here is the php code example data are the following: what i did so far is i am stuck in these two lines and i have no idea if i translate it them right Answer To compare both implementations, sample da…
PHP iterate every node of html string including text nodes splited by other nodes
I trying to change every readable part of given HTML code using DOMDocument and DOMXPath It gives me But strings “TEST_1” and “TEST_2” not changed, because of $xpath->evaluate(‘//[count() = 0]’) gives me only nodes without childrens. How to get all nodes with nodes like …