首页 \ 问答 \ $ _POST - 结果将通过电子邮件发送($_POST - results to be sent in a email)

$ _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 a print_pr into a PHP form.
Any help would be great!


原文:https://stackoverflow.com/questions/18625521
更新时间:2022-03-10 14:03

最满意答案

当您运行python foo.pyfoo.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 the example module. Create __main__.py to run the relevant part of foo.py (it shouldn’t run any code at the top level, generally), change to the parent directory, and try python -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 ...
  • 当你使用PyCharm时,它会自动生成当前模块的main,所以相关的语句就像from . import from . 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
  • 实际上,你的任何一个例子都不应该开箱即用。 让我们稍微修改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, in from stuff im ...
  • 您必须将目录添加到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 ...
  • 您可以使用 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 ...
  • 问题是因为Foo没有__init__.py ,因此它不被视为包。 相对导入中的每个句点都指包。 当你这样做 from ..src.output import * 在bar.py ,第一个句点指的是当前包, modules 。 第二个时期是指上面的包, Foo 。 由于Foo实际上不是一个包,因此会出错。 PS Wildcard的进口令人不悦。 特别是当您从这样一个远程相关的包导入时,我会尝试将其重构为显式导入。 The problem is because Foo has no __init__.py, ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)