Skip to content

Tag: php

Php file won’t load ajax request

I try query my database from javascript, using ajax request to my php file. This is my code: So I included jquery file into my folder, so that I can access it as shown above. Now my trainPassFrequency.js look like this: where trainfrequency.php only returns (echo) output of the sql query. When I run this code…

JSON.aprse() error when using php json_encode()

i know that this question asked before but i have never found anything working for my case i have 2 array which is looking like this Array ( [0] => Array ( [`19 January 2021`] => Array ( [0] => Array ( [0] => 36 [1] => 817 [2] => 67 ) ) ) ) Array ( [0] => Array

PHP Write HTML tags into file and display it

I want to make a simple comment system in PHP and my problem is when the user type ‘<‘ it disappear because it takes it to HTML code and mess my code. So what I need to do, when the user type this into the textarea: <stdio.h>, and post it, it should appear as <stdio.h>. My PHP code:…

Javascript not printing within php loop

new to php and javascript. I am trying to print an id using javascript within a php loop and nothing is turning up. Here is the code: Answer The problem is, that you want PHP to know, what printID() is and what it should do. PHP knows nothing about JavaScript functions, because JavaScript and PHP are executed…