Похожие чаты

In javascript: Jsv1='80'; Jsvar.innerhtml='<?php $var=Jsv1; ?>'; Jsv1 and Jsvar is variable in javascript $var

is variable in php
Correct of top code ?

4 ответов

6 просмотров

php runs on the server. JS runs in the browser. The server generates resources (html, js, css) for the browser, so php can write JS with which initializes variables to specific values. JS can send data back to the server over HTTP (fetch) or websockets. The server then has to handle those data. JS does not write code that runs on the server. If it does, you have a major security hole

Why not just move Jsv1 into PHP? <?php $jsv1 = 80; ?> Jsv1 = '<?=$jsv1?>'; <?php $var = $jsv1; ?> Jsvar.innerHTML = '<?=$var?>';

Thomas
Why not just move Jsv1 into PHP? <?php $jsv1 = 8...

My apologies for bursting your bubbles, they / them do not seem to understand which executes first, php on the server or javascript on the browser, you are going to be mansplaining how the whole stack works

Похожие вопросы

Обсуждают сегодня

Hi, I can't understand promises in JavaScript and what we should use them for (maybe the teacher didn't teach well XD). Do you have a solution for this? And are promises used...
A
29
Ещё такой вопрос. Мне необходимо хранить пароль пользователя локально. Для этого планирую использовать ini файл. Это для автозаполнения полей логин и пароль при авторизации. Е...
Евгений
19
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Xem delist ho rha hai agr naa bhechu toh kya hoga after 1 july?
ABHI
27
@ackza What is the main purpose of the Voting? It's basically to quality check and approve contents. If your post is really good quality or correct and it get downvoted or d...
Imman
1
VIP 332 Quarterly XVS Buyback, Funds Allocation and New Tokenomics Summary This VIP outlines the protocol’s Quarterly Buyback and Funds Allocation strategy as per our Tokeno...
Venus Announcements
8
Hi guys, I'm looking for a good LLM course. Is there any course to learn LLMs in advanced? I'm aiming to use them in my apps, so a perfect course in my openion, is not only a ...
Taha
14
Quick reminder regarding the first phase of the token merger⚠️ As we approach Phase 1 of the token merger, OCEAN and AGIX will migrate to FET starting July 1st! Here's a li...
Stip11
1
Did you guys see the latest tweet from TonGifts? 🚀
Mike
44
I love the passion, really do. I do think this is being blown way out of proportion. We are not deleting our Telegram or not allowing you to talk about anything you want, a...
Mike Herron
3
Карта сайта