javascript or php

03/01/2018 13:52 ahmed1234550#1
if i wanna fetch data from api (json) should i use javascript or php? i know how to do it in both but i dont know what is the difference is php more secure?
how to protect my codes?

im so confused i wanna kill myself :D
03/01/2018 14:24 xShizoidx#2
You can just use PHP for it. If you want to update the data without having to reload the page, you can use AJAX.
03/01/2018 14:34 ahmed1234550#3
Quote:
Originally Posted by xShizoidx View Post
You can just use PHP for it. If you want to update the data without having to reload the page, you can use AJAX.
alright thank you, and what about protecting my codes so no one can use my api key
03/01/2018 15:09 type.#4
If you need to protect your api-key just do it serverside with PHP. That's fine. (:
If you still want to update the DOM without reloading the page you can just send an AJAX request to your own backend.