Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 当从数据库获取的数据存储在文本字段中时,如何自动移动下一页_Php_Jquery_Mysql - Fatal编程技术网

Php 当从数据库获取的数据存储在文本字段中时,如何自动移动下一页

Php 当从数据库获取的数据存储在文本字段中时,如何自动移动下一页,php,jquery,mysql,Php,Jquery,Mysql,我有一个php页面,其中有一个输入数字的文本字段。数据存储在数据库中。我需要获取文本字段中输入的数字,以便在下一页中自动显示,并在用户无法修改的情况下将其取消。请建议如何使用php、jquery实现这一点。请告诉我怎么做。。在第二页中输入的值与我在第一页中输入的数字一致 //first page <table border="0" style="border-collapse:collapse;" align="center"> <tr> <td> <d

我有一个php页面,其中有一个输入数字的文本字段。数据存储在数据库中。我需要获取文本字段中输入的数字,以便在下一页中自动显示,并在用户无法修改的情况下将其取消。请建议如何使用php、jquery实现这一点。请告诉我怎么做。。在第二页中输入的值与我在第一页中输入的数字一致

//first page
<table border="0" style="border-collapse:collapse;" align="center">
<tr>
<td>
<div id="col1" align="center"><br />
 <form method="post" action="user.php">
<label type="text" name="name" maxlength="50" size="30" class="label">Enter the Membership Number</label><br />
<input type="text" name='id' placeholder="enter Membership Number" class="input" size="40"/><br />
<span class="field">(* Required field)</span><br /><br />
<input type="submit" name="submit" value="SUBMIT" class="button"><br /><br /><br /><br />
</form>
</body>
</html>

<?php
mysql_connect("localhost","root","");
mysql_select_db("anthonys");
if(isset($_POST['submit']))
{
$id= $_POST['id'];
if( ! ctype_alnum($id) )
  die('invalid id');


$query = "SELECT uid FROM `payment` WHERE `uid` =$id";


$run = mysql_query($query);

echo $id;
if(mysql_num_rows($run)>0){

echo "<script>window.open('member1.php','_self')</script>";

}
else {

    echo "<script>alert('Login details are incorrect!')</script>";
    }
}
?>

//second page

$(function() {
        $("#XISubmit").click(function(){

   var uid=document.forms["XIForm"]["uid"].value;
        var fathername = document.forms["XIForm"]["fathername"].value;


        if(fathername == null || fathername == "")
    {
        alert("Please Enter  Father's Name");
        return false;
    }

    document.getElementById("XIForm").submit();

        }); 
            if ($.browser.msie && $.browser.version.substr(0, 1) < 7) {
            $('li').has('ul').mouseover(function() {
                $(this).children('ul').show();
            }).mouseout(function() {
                $(this).children('ul').hide();
            })
        }
;
    }); 

</script></head>



<section id="sheet"  style="background-color: Transparent;">

<div id="content_inner">


<header id="header_inner">St. Anthony's Parish Education Fund
<br /><b style="font-size:15px;">Bangalore 560 095</b><br /><img src="images/line1.jpg" alt="" /></header>



<div id="col2">
<h2>Application for the Membership</h2><br /><br />
<table border="0px" style="border-collapse:collapse; width:810px;" align="center">
<tr>
<td>
<form name="XIForm" id="XIForm" method="POST" action="pdf/pdf1.php">
<input type="text" name="uid" />
<label type="text" name="fathername" maxlength="50" size="30" class="label">Father's Name</label><br />
<input  name="fathername" placeholder="" class="input" size="40"/><br /><br />







    <input type="hidden" name="formType" id="formType" value="reg"/>
        <input type="button" name="XISubmit" id="XISubmit" value="ADD" class="button" />        


<br /><br /><br /><br />
</form></td>
//第一页

输入成员编号

(*必填字段)







通过url传递数字,如下所示

if(mysql_num_rows($run)>0){
echo "<script>window.open('member1.php?id=".$id."','_self')</script>";
}
2) 在文本框中显示该值

<input type="text" name="id" id="id" value="<?php if(isset($_GET['id']) { echo $id; } ?>"  readonly>

请显示您的代码??我的代码不会将文本字段中输入的值提取到下一页。您可以通过anchor tag属性传递该值。实际上您的要求不太清楚。。你想在文本字段中显示传递给其他页面的文本字段值吗?我已经发布了代码。请告诉我怎么做。。在第二页中输入的值与我在第一页中输入的数字一致。
<input type="text" name="id" id="id" value="<?php if(isset($_GET['id']) { echo $id; } ?>"  readonly>
<form action="youractionpage.php" method="post">
ID <input type="text" name="id" id="id" value="<?php if(isset($_GET['id'])) { echo $id; } ?>"  readonly>
Amount <input type="text" name="amount">
Name  <input tpye="text" name="name">
<input type="submit" value="Submit">
</form>