简体   繁体   English

第二种形式与第一种形式同时显示

[英]second form showing at same time as first form

The php file I am working on is for returning members. 我正在使用的php文件用于返回成员。 The preceding htm module has links for returning members and new members. 前面的htm模块具有用于返回成员和新成员的链接。 The returning link sends the member to the returning php module. 返回链接将成员发送到返回php模块。

The first form asks for member number and password. 第一种形式要求输入会员编号和密码。 The module finds the members row in the database (which you helped me with the other day). 该模块在数据库中找到成员行(前几天您帮助了我)。 The second form is supposed to be populated with the data from the members record and allow the member to update his record. 第二种形式应该用成员记录中的数据填充,并允许成员更新其记录。

The problem is that the second form shows up right away before the first form requested data is entered. 问题在于,第二个表单会在输入第一个表单请求的数据之前立即显示出来。

I would like to prevent the second form from showing up prematurly. 我想防止第二种形式过早出现。 I have tried to find the answer but again, I am probably not asking the right question. 我试图找到答案,但是,我可能再也不问正确的问题了。

Does anyone have a quick answer with this info or should I put my code on the question? 是否有人对此信息有快速解答,还是我应该将代码放在问题上? If I need to submit code how much should I put out here. 如果我需要提交代码,应该在这里输入多少。 It's fairly lengthy. 相当长。 I am hoping one or more of you know the common mistakes that cause this. 我希望你们中的一个或多个知道导致这种情况的常见错误。 The forms have different names. 表单具有不同的名称。 I read a lot on my searches and the previous statement is the only thing that I saw that could have been the problem. 我从搜索中学到了很多东西,而上一句话是我看到的唯一可能是问题所在。

Thanks in advance. 提前致谢。 oldmanvette 奥尔德曼维特

Name two forms submit button differently. 命名两个表单的提交按钮不同。 You can differentiate these 2 form when submitting two form 您可以在提交两种形式时区分这两种形式

Also use a session mechanism if you are authenticated user ,and then only you have to show the second form 如果您是经过身份验证的用户,也请使用会话机制,然后只需要显示第二种形式

Sample 样品

Login Form resides here <form name=login ..... </from>

When authenticated save a session with user details .See      http://php.net/manual/en/function.session-start.php

if(session set) {
  //Show the user details form 
  User details page
  <form name=deails. ..... </form>
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM