Skip to content

Tag: php

Ajax request to php with empty POST data

I am new to javascript and I have problem with an ajax POST to php. I am trying tosend javascript variables to php via an ajax POST but it doesn’t work. The ajax post is sent but it sends empty POST. I got alert “Error occured ! 202” when trying to save data to bdd. Thanks in advance for hel…

MySQL – Join part of query to a new query?

I’ve got the following code which queries a table. Then it uses the result to make another query. That result is then used to make a third query. But how do I grab the userid field from the 2nd query in order to grab a name from a users table and join that to the result of the 3rd query?

The correct way to path files/images/links on html

It seems to be a very beginner question, but after finish my whole website, i found a “bug” on the structure of the path files/images and links. Well, first let me tell you what is the exactly structure: The website are located on: /var/www Main pages files are located on the main website folder: …

ignoring img tags while searching for urls in string

I have the following code in which I am replacing urls with hyperlinked anchor tags, But I want to ignore all img tags while searching for urls, I have no idea how can I go for it. Answer As per @Biesor and @Nigel Ren I came up with this, For the time being I am using this till some better

How do i display the NESTED JSON data using php?

I coding a whole day just to display the nested Data from JSON that i got from the Api Provider but nothings gonna change. It’s always error! what should i do? Here’s my code hope you help me in this problem. Imagine my name of json file is 05-03-21.json. and here’s the JSON Data And here&#8…

How to Set my URL pattern in my php using get method parameters only

I have 3 php files in my directory(/account): index.php login.php signup.php Accessing the folder in my localhost: http:localhost/account ==> opens the default(index.php file) I want to access the login.php and signup.php using: and respectively. Here is my code in the index.php Please help to get me a way…

php traverses the array to get the corresponding value

I have two variables, number and user, which are not fixed. When I iterate through the array below, how do I determine if the number and user criteria are met to get the appropriate ID Example: If the value of amount is 100 and the value of user is 6, then the obtained ID is 1; If the value of

How to access to node fields in drupal 8

I’m having some issues, I’m loading some nodes and i want to get some values field, this is how is my field I’m loading my nodes like this: But i dont know how to get en fr and pt fields values Could you please help me? Regards Mario Answer You can load translation for each language then get…