$ _POST - 结果将通过电子邮件发送($_POST - results to be sent in a email)
<textarea rows="4" cols="70" name="filename" id="result" style="background:#B0D2D7; width:100%;overflow:auto;resize:none" readonly><?php echo $_POST['filename']; ?></textarea>
大家好,这是我正在使用的代码片段。 我正在努力的是如何使用PHP电子邮件将下一页显示的
$_POST
结果发送到电子邮件中。 结果不会显示在下一页的文本框中,而是显示为更像print_pr
到PHP表单中。
任何帮助都会很棒!<textarea rows="4" cols="70" name="filename" id="result" style="background:#B0D2D7; width:100%;overflow:auto;resize:none" readonly><?php echo $_POST['filename']; ?></textarea>
Hi all, this is a snippet of code I'm using. What I'm struggling with is how to send the
$_POST
results that get displayed on the next page into an email using PHP email. The results are not displayed in a text box as such on the next page but displayed more like aprint_pr
into a PHP form.
Any help would be great!
原文:https://stackoverflow.com/questions/18625521
最满意答案
当您运行
python foo.py
,foo.py
不是example
模块的一部分。 创建__main__.py
以运行foo.py
的相关部分(通常不应在顶层运行任何代码),更改为父目录,并尝试python -m example
。例如,
foo.py
:def hello(): print('Hello, world!')
__main__.py
:from . import foo foo.hello()
When you’re running
python foo.py
,foo.py
is not part of theexample
module. Create__main__.py
to run the relevant part offoo.py
(it shouldn’t run any code at the top level, generally), change to the parent directory, and trypython -m example
.For example,
foo.py
:def hello(): print('Hello, world!')
__main__.py
:from . import foo foo.hello()
相关问答
更多-
io是一个内置模块 。 不要将本地软件包命名为内置模块。 io is a built-in module. Don't name your local packages the same as a built-in module.
-
由于file1和file2在同一个目录中,所以甚至不需要一个__init__.py文件。 如果你要放大,那就把它留在那儿。 要在同一目录中的文件中导入东西,只需这样做 from file1 import f 即,你不需要做相对路径.file1因为它们在同一个目录中。 如果您的主要功能,脚本或任何将运行整个应用程序的功能在另一个目录中,那么您将必须将所有内容与所执行的任何内容相关联。 since file1 and file2 are in the same directory, you don't even ...
-
IIUC,这是由于一些以前由basemap提供的库,现在由geos提供,通过更新底图不适当地删除了。 要解决此问题,请打开Canopy Terminal(从Canopy工具菜单中)并键入: enpkg --remove geos enpkg geos IIUC, this is due to some libraries that were formerly supplied by basemap, and now are supplied by geos, that were inappropriate ...
-
Python 3.6中的相对导入(Relative import in Python 3.6)[2022-09-16]
当你使用PyCharm时,它会自动生成当前模块的main,所以相关的语句就像from . importfrom . import 不起作用。 在这里阅读更多 。 要解决您的问题,请将__init__.py和tools.py文件放在一个子目录中 main_directory/ run.py sub_directory/ __init__.py tools.py 在run.py文件中,将以下内容写入您的导入语句 from su ... -
当您运行python foo.py , foo.py不是example模块的一部分。 创建__main__.py以运行foo.py的相关部分(通常不应在顶层运行任何代码),更改为父目录,并尝试python -m example 。 例如, foo.py : def hello(): print('Hello, world!') __main__.py : from . import foo foo.hello() When you’re running python foo.py, foo.p ...
-
刚遇到同样的问题。 问题是由于安装了atom-0.3.5。 它可以通过安装pyatom而不是(优化的,c实现的)原子来解决 Just had the same problem. Issue was due to having atom-0.3.5 installed. It can be solved by installing pyatom instead of the (optimised, c-implemented) atom
-
python相对导入结构(python relative import structure)[2022-08-10]
实际上,你的任何一个例子都不应该开箱即用。 让我们稍微修改bin/script.py : #! /usr/bin/env python import sys print sys.path from stuff import mainfile 这应该产生类似的东西 ['.../project/bin', ...] Traceback (most recent call last): File "bin/script.py", line 6, infrom stuff im ... -
python相对导入(python relative import)[2021-10-12]
您必须将目录添加到python路径。 import sys sys.path.append("/libraries") 但我认为将库放在需要它的项目的文件夹中或者只是将它们安装到sys.path中已有的标准位置之一可能会更好。 You have to add the directory to your python path. import sys sys.path.append("/libraries") But I think it might be better to either put t ... -
导入中的python导入(python import within import)[2022-11-03]
您可以使用 import first print first.second.some_var 只有通过first导入才能自动在名称空间中出现second会导致很多冲突 这也行得通 from first import second print second.some_var 使用通配符 from first import * 不鼓励,因为如果有人首先添加额外的属性/功能,他们可能会覆盖您在本地使用的属性,如果他们碰巧选择相同的名称 You can use import first print first ... -
Python - 相对导入(Python - Relative import)[2022-06-21]
问题是因为Foo没有__init__.py ,因此它不被视为包。 相对导入中的每个句点都指包。 当你这样做 from ..src.output import * 在bar.py ,第一个句点指的是当前包, modules 。 第二个时期是指上面的包, Foo 。 由于Foo实际上不是一个包,因此会出错。 PS Wildcard的进口令人不悦。 特别是当您从这样一个远程相关的包导入时,我会尝试将其重构为显式导入。 The problem is because Foo has no __init__.py, ...