简体   繁体   English

php:如何创建包含变量定义的文件

[英]php: How to create a file containing variable definitions

So first I want to say that I'm pretty new to php & javascript. 所以首先我想说我对php和javascript很陌生。 But anyways, I want to make something like a User Interface (1) where you can write sth into certain fields which will create a string for every field and save it into a file on the server so you can get the values the fields should have from other devices. 但是无论如何,我想做一个类似用户界面(1)的事情,您可以在其中将sth写入某些字段,这将为每个字段创建一个字符串并将其保存到服务器上的文件中,以便您可以获取字段应具有的值从其他设备。

This is a little graphic to show you what I want to make: 这是一张小图,向您展示我想做的事情:

现场模式

So I'm wondering if anybody knows if it's possible and how to create the file/load the values from it. 所以我想知道是否有人知道这是可能的,以及如何创建文件/从中加载值。

我认为您可能想要一个数据库,这样一个php函数可以将这些值写入db,然后另一个函数可以随时检索这些值。

If ur using mysql then ... Create a php script that passes the parameter to database using mysqli_query function (that is saving data in database) and after that the website script can retrieve data from the database. 如果您使用mysql,则...创建一个php脚本,使用mysqli_query函数将参数传递给数据库(即将数据保存在数据库中),然后该网站脚本可以从数据库中检索数据。 .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM