简体   繁体   English

如何在WordPress中添加.php和.js文件?

[英]How can I add .php and .js files in WordPress?

I am new to WordPress and I want ask that how I can add .php files in the WordPress through Visual Editor. 我是WordPress的新手,我想问一下如何通过可视化编辑器在WordPress中添加.php文件。 I won't be using those files directly but I need to validate some HTML form by calling that php script through Ajax. 我不会直接使用这些文件,但需要通过Ajax调用该php脚本来验证一些HTML表单。 I am very good at PHP and many other web programming languages but I have never use WordPress. 我非常擅长PHP和许多其他网络编程语言,但是我从未使用过WordPress。 I would be highly grateful if you could help me with that. 如果您能帮助我,我将不胜感激。 I can have more than 20 php files so I think it would pretty absurd to add all these files by adding new pages in the WordPress. 我可以拥有20多个php文件,因此我认为通过在WordPress中添加新页面来添加所有这些文件将是非常荒谬的。

由于您无权访问FTP服务器,因此需要一个插件,例如https://wordpress.org/plugins/wp-file-upload/,才能将PHP脚本上传到wp-contents文件夹。

I would recommend uploading them to a /php/ subfolder in your wp-content/uploads/ folder via FTP. 我建议通过FTP将它们上传到wp-content/uploads/文件夹中的/php/子文件夹中。 Then on your form you would point to a url like action=/wp-content/uploads/php/test.php 然后在表单上,​​您将指向一个网址,例如action=/wp-content/uploads/php/test.php

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

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