php - How to call the php code from an action in the same file
问题描述
<form action="??" method="post">
<input type="text" id="name" />
<button type="submit">Submit</button>
</form>
<?php
//php
?>
Now, how Can I run a php in the same file? Because If I want to call it from another file for example 'something.php' I'll put in the form action="something.php'
and it will work.
I am new in php and my english is not good so it is difficult for me to explain you. I was looking for this answer on this page but there is nothing what Can I understand.
I don't want to send the code because most of it is in Polish so it wouldn't make sense. This form will be used to send an email.
解决方案
如果您action
完全省略该属性,表单将发布到同一页面:
<form method="post">
推荐阅读
- reactjs - 在 saga 调用效果中没有重载匹配此调用
- c++ - 如何使用 boost beast websocket 客户端收听 websocket 提要?
- linux - 在 Linux 下安装虚幻引擎的几个问题
- python - Python在内存中生成tets图像文件
- reactjs - 如何获取 Algolia 搜索结果的类型?
- flutter - 使用 Provider Package Flutter 时如何修复错误
- python - _run_module_as_main 中的文件“C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2032.0_x64__qbz5n2kfra8p0\lib\runpy.py”,第 193 行
- android - 无法找到具有路径的平台 SDK:平台;android-R
- c++ - 如何在C ++中按行的总和对矩阵进行降序排序
- php - 每次在php中调用相同的脚本时如何重复构建列表