<html><head><title>Register</title></head><body> <?php if (!isset($_POST['register1']) || ( $_POST['register1'] != 'Register')) { #echo "test1"; ?> <h1 id="Registration">Registration</h1> <form method = "post" action = "register.php"> <table> <tr><td>E-mail address:</td> <td><input type='text' name = 'email'/></td> </tr> <tr><td>First Name:</td> <td><input type = 'text' name = 'first_name'/></td> </tr> <tr><td>Last Name:</td> <td><input type = 'text' name = 'last_name'/></td> </tr> <tr><td>PassWord:</td> <td><input type = 'password' name = 'password'/></td> </tr> <tr> <td colspan = '2'> <input type = 'submit' name = 'register1' value = 'Register'/> </td> </tr> </table> </form> <?php } else { ?> E-mail: <?php echo $_POST['email']; ?> <br /> Name: <?php echo $_POST['last_name']; ?> <br /> Password: <?php echo $_POST['password']; ?> <?php } ?></body></html>
初学 PHP 问个问题 在这里 获取
E-mail:
echo $_POST['email'];
?>
Name:
Password:
这些信息时 只输出一个没问题
当我输出多个的时候像这个样子的
E-mail:
echo $_POST['email'];
?>
Name:
echo $_POST['last_name'];
?>
Password:
echo $_POST['password'];
?>
他就出错了 - -!!!
总是出现
An error occurred.
Sorry, the page you are looking for is currently unavailable.
Please try again later.
If you are the system administrator of this resource then you should check the error log for details.
Faithfully yours, nginx.
这个东西 只输出一个时就可以
各位大神请指教
回复讨论(解决方案)
SF 不留
<html><head><title>Register</title></head><body> <?php if (!isset($_POST['register1']) || ( $_POST['register1'] != 'Register')) { #echo "test1"; ?> <h1 id="Registration">Registration</h1> <form method = "post" action = ""> <table> <tr><td>E-mail address:</td> <td><input type='text' name = 'email'/></td> </tr> <tr><td>First Name:</td> <td><input type = 'text' name = 'first_name'/></td> </tr> <tr><td>Last Name:</td> <td><input type = 'text' name = 'last_name'/></td> </tr> <tr><td>PassWord:</td> <td><input type = 'password' name = 'password'/></td> </tr> <tr> <td colspan = '2'> <input type = 'submit' name = 'register1' value = 'Register'/> </td> </tr> </table> </form> <?php } else { ?> E-mail: <?php echo $_POST['email']; ?> <br /> Name: <?php echo $_POST['first_name'].$_POST['last_name']; ?> <br /> Password: <?php echo $_POST['password']; ?> <?php } ?></body></html>
我给你调成这样本地测试时可以了。
<html><head><title>Register</title></head><body> <?php if (!isset($_POST['register1']) || ( $_POST['register1'] != 'Register')) { #echo "test1"; ?> <h1 id="Registration">Registration</h1> <form method = "post" action = ""> <table> <tr><td>E-mail address:</td> <td><input type='text' name = 'email'/></td> </tr> <tr><td>First Name:</td> <td><input type = 'text' name = 'first_name'/></td> </tr> <tr><td>Last Name:</td> <td><input type = 'text' name = 'last_name'/></td> </tr> <tr><td>PassWord:</td> <td><input type = 'password' name = 'password'/></td> </tr> <tr> <td colspan = '2'> <input type = 'submit' name = 'register1' value = 'Register'/> </td> </tr> </table> </form> <?php } else { ?> E-mail: <?php echo $_POST['email']; ?> <br /> Name: <?php echo $_POST['first_name'].$_POST['last_name']; ?> <br /> Password: <?php echo $_POST['password']; ?> <?php } ?></body></html>
我给你调成这样本地测试时可以了。
弱弱的问下 改了下哪里 我把你这个代码复制下来 还是不可以 ,是不是有什么的放需要配置或者其他的呢?
我给你调成这样本地测试时可以了。
看到你改的了 不过我改一下 还是不行 只输出一个时可以 输出多个时就不行了
<form method = "post" action = "">
给自己提交不写都可以。
<form method = "post" action = "">
给自己提交不写都可以。
也是不行 ,获取一个post值可以只要获取多个就不行了 ,我现在用的是阿里云的服务 配置的lnmp环境
在想是不是跟那个配置有关系啊?
print_r($_POST);
看看是什么
print_r($_POST);
看看是什么
输入
输出的是
Array ( [email] => test@qq.com [first_name] => test_first [last_name] => test-last [password] => test_password [register1] => Register )
看这个输出应该是对的 - -!
???,?有??。
你既然能print_r出?。表示可以?取到的。
???,?有??。
你既然能print_r出?。表示可以?取到的。
是的 现在怀疑是不是哪里配置出问题了 又或者其他的 单独取一个是可以的 取多个的时候 就不干活了
你这个应该是服务器的问题吧,代码获取没有什么问题。
检查一下错误日志看报什么错误。PHP的错误提示功能也打开试试。
你这个应该是服务器的问题吧,代码获取没有什么问题。
检查一下错误日志看报什么错误。PHP的错误提示功能也打开试试。
是的 应该是哪里配置的问题 等回去了再看吧
错误级别 的问题~你的错误级别的什么?
错误级别 的问题~你的错误级别的什么?
没有配置错误级别 ,使用的默认的错误级别?
从nginx中找到这个日志
2014/07/18 20:37:33 [error] 9397#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 118.199.7.180, server: localhost, request: "POST /zp/chapter5/register.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "http://localhost/zp/chapter5/register.php"
大神给分析下 是什么问题
从nginx中找到这个日志
2014/07/18 20:37:33 [error] 9397#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 118.199.7.180, server: localhost, request: "POST /zp/chapter5/register.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "http://localhost/zp/chapter5/register.php"
大神给分析下 是什么问题
这个报错可以看这里
http://www.php100.com/html/program/nginx/2013/0905/5522.html
测试你的代码是没问题的,看下ngnix的配置吧
试了各种方法 暂时没有找到解决办法 结贴了

Python中的文件扩展名是附加在文件名末尾的后缀,用于表示文件的格式或类型。它通常由三个或四个字符组成,文件名后跟一个句点,例如“.txt”或“.py”。操作系统和程序利用文件扩展名来确定文件的类型以及应如何处理它。被识别为纯文本文件。Python中的文件扩展名在读取或写入文件时至关重要,因为它建立了文件格式以及读取和写入数据的最佳方法。例如,“.csv”文件扩展名是读取CSV文件时使用的扩展名,而csv模块则用于处理该文件。Python中获取文件扩展名的算法在Python中操作文件名字符串来

传递优化是帮助Windows更新和Windows应用商店更快地运行和交付更新的功能。传递优化中的缓存文件应该在一段时间后删除,但对于我们的一些读者来说,它们不断堆积并占用不必要的空间。删除传递优化文件是否安全?是的,删除传递优化文件是安全的,在本文中,您会发现在Windows11中这样做非常容易。尽管不建议手动删除传递优化文件,但可以自动执行此操作。如何删除Windows11上的传递优化文件?单击搜索栏,键入磁盘清理,然后从结果中打开该工具。如果您有多个驱动器,请选择带有系统的驱动器(通常是C:

使用math.Max函数获取一组数中的最大值在数学和编程中,经常需要找出一组数中的最大值。在Go语言中,我们可以使用math包中的Max函数来实现这个功能。本文将介绍如何使用math.Max函数来获取一组数中的最大值,并提供相应的代码示例。首先,我们需要导入math包。在Go语言中,导入包可以使用import关键字,如下所示:import"mat

从Java中的LinkedHashSet中检索最后一个元素意味着检索其集合中的最后一个元素。尽管Java没有内置方法来帮助检索LinkedHashSets中的最后一个项,但存在多种有效的技术,可以提供灵活性和便利性,有效地检索此最后一个元素而不破坏插入顺序-这是Java开发人员必须在其应用程序中有效处理的问题。通过将这些策略有效地应用于他们的软件项目中,他们可以实现满足此要求的最佳解决方案LinkedHashSetLinkedHashSet是Java中的一种高效数据结构,它结合了HashSet和

文件的大小是特定文件在特定存储设备(例如硬盘驱动器)上占用的存储空间量。文件的大小以字节为单位来衡量。在本节中,我们将讨论如何实现一个java程序来获取给定文件的大小(以字节、千字节和兆字节为单位)。字节是数字信息的最小单位。一个字节等于八位。1千字节(KB)=1,024字节1兆字节(MB)=1,024KB千兆字节(GB)=1,024MB和1太字节(TB)=1,024GB。文件的大小通常取决于文件的类型及其包含的数据量。以文本文档为例,文件的大小可能只有几千字节,而高分辨率图像或视频文件的大小可

JavaScript教程:如何获取HTTP状态码,需要具体代码示例前言:在Web开发中,经常会涉及到与服务器进行数据交互的场景。在与服务器进行通信时,我们经常需要获取返回的HTTP状态码来判断操作是否成功,根据不同的状态码来进行相应的处理。本篇文章将教你如何使用JavaScript获取HTTP状态码,并提供一些实用的代码示例。使用XMLHttpRequest

如果“最新更新可用后立即获取最新更新”选项缺失或灰显,则你可能正在运行开发人员频道Windows11版本,这是正常的。对于其他人,安装KB5026446(22621.1778)更新后会出现问题。您可以采取以下措施来取回“在最新更新可用时立即获取更新”选项。如何取回“在最新更新可用时立即获取更新”选项?在开始以下任何解决方案之前,请确保检查最新的Windows11更新并安装它们。1.使用ViVeTool转到“Microsoft更新目录”页面并查找KB5026446更新。在您的PC上下载并重新安装更

Go语言中的context包是用来在程序中传递请求的上下文信息的,它可以在跨多个Goroutine的函数之间传递参数、截取请求和取消操作。在Go中使用context包,我们首先需要导入"context"包。下面是一个示例,演示了如何使用context包实现请求参数传递。packagemainimport("context"


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1
Easy-to-use and free code editor

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
