<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的配置吧
试了各种方法 暂时没有找到解决办法 结贴了

tomakephpapplicationsfaster,关注台词:1)useopcodeCachingLikeLikeLikeLikeLikePachetoStorePreciledScompiledScriptbyTecode.2)MinimimiedAtabaseSqueriSegrieSqueriSegeriSybysequeryCachingandeffeftExting.3)Leveragephp7 leveragephp7 leveragephp7 leveragephpphp7功能forbettercodeefficy.4)

依赖性(di)inphpenhancesCodeFlexibility andTestability by decouplingClassesscyclasses fromtheippentencies.1)UseConstructorientoctionTopAssDopassDectiesViactructors Viactructors

推荐Pimple用于简单项目,Symfony的DependencyInjection用于复杂项目。1)Pimple适合小型项目,因其简单和灵活。2)Symfony的DependencyInjection适合大型项目,因其功能强大。选择时需考虑项目规模、性能需求和学习曲线。

依赖性注射(DI)InphpisadesignpatternwhereClassDepentenciesArepassedtotosedTosedTosedTotratherThancReateDinterally,增强codemodemodularityAndTestabily.itimprovessoftwarequalitybyby By:1)增强tosestabilityTestabilityTestabilityThroughityThroughEasyDepentyDepententymydependentymocking,2)增强Flexibilybya

依赖性(di)InphpenhancesCodemodularity,可检验性和确定性。1)itallowSeasysWappingOfComponents,AsseeninaPaymentGateWayswitch.2)dicanbeimimplementlededMermplemplemplemplemplemplemplemplemplempletallyororororerorviacontainers,withcontanersAddingComplexiteDcomplexiteDcomplexiteDcomplexitingCompleaDdingCompleAddingButaidLararArargerProprproproprys.3)

TOOPTIMIZEPHPCODEFORDUSEMEMORYUSAGEAGEAGEAGEAGEAGEANDEXECUTITIEM,关注台词:1)USEREEREFERESCENCENCINCOPYINSTEADOFCOPYINGINATATASTRUCTURESTROUCTURESTOREDUCEMORYCONSUMPTION.2)杠杆phphppphpphp'sbuilt intimpunctionslikearray_mapforfunctionslikearray_mapforfforfforfforfasterapasterexecution.3)

phpisusedforsendendemailsduetoitsignegrationwithservermailservicesand andexternalsmtpproviders,自动化notifications andMarketingCampaigns.1)设置设置yourphpenvironcormentswironmentswithaweberswithawebserverserverserverandphp,确保themailfunctionisenabled.2)useabasicscruct

发送电子邮件的最佳方法是使用PHPMailer库。1)使用mail()函数简单但不可靠,可能导致邮件进入垃圾邮件或无法送达。2)PHPMailer提供更好的控制和可靠性,支持HTML邮件、附件和SMTP认证。3)确保正确配置SMTP设置并使用加密(如STARTTLS或SSL/TLS)以增强安全性。4)对于大量邮件,考虑使用邮件队列系统来优化性能。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

适用于 Eclipse 的 SAP NetWeaver 服务器适配器
将Eclipse与SAP NetWeaver应用服务器集成。

记事本++7.3.1
好用且免费的代码编辑器

EditPlus 中文破解版
体积小,语法高亮,不支持代码提示功能

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境