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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.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_Html_Mysql - Fatal编程技术网

Php 如何在下一页中显示插入数据

Php 如何在下一页中显示插入数据,php,jquery,html,mysql,Php,Jquery,Html,Mysql,我有两张表格。在第二页中,手机号码未显示 echo$_r['mobile']没有显示任何内容 我添加每个页面: <?php session_start();?> <?php include('include/config.php');?> 第二种形式/页面:sign2.php <form class="ff" action="sign2c.php" method="POST"> <a class="ase" >Enter Your Mobile

我有两张表格。在第二页中,手机号码未显示

echo$_r['mobile']没有显示任何内容

我添加每个页面:

<?php session_start();?>
<?php include('include/config.php');?>
第二种形式/页面:sign2.php

<form class="ff" action="sign2c.php" method="POST">
<a class="ase" >Enter Your Mobile No.</a>
<?php
    $cid=$_SESSION['cid'];
    $_q=mysqli_query($connection, "select * from mobile_message where mobile='$cid'");
    $_r=mysqli_fetch_array($_q);
    echo $_r['mobile'];
    ?>
</br></br>
<a class="ase" >Enter Password</a>
<input type="text" id="inp" name="otp" required>
</br>
<input type="submit" id="btn" value="continue">
</form>

输入您的手机号码。

更改行
$cid=$\u POST['mobile']而不是
$cid=$sql['mobile']
in
signc.php

$sql = mysqli_query($connection, "INSERT INTO `mobile_message`  SET `mobile` = '$mobile'");

 if($sql){

        $cid=$_POST['mobile'];   # write instead  $cid=$sql['mobile'];

        $_SESSION['cid']=$cid;

    $_SESSION['s']= "OTP sent to your mobile.";
        header('Location:sign2.php');

} else{
    $_SESSION['e']=  "Could not able to execute. ";
    header('Location:sign.php');

}
尝试使用查询“echo$cid”。它有效吗?我尝试了“echo$cid”,但没有结果。
<form class="ff" action="sign2c.php" method="POST">
<a class="ase" >Enter Your Mobile No.</a>
<?php
    $cid=$_SESSION['cid'];
    $_q=mysqli_query($connection, "select * from mobile_message where mobile='$cid'");
    $_r=mysqli_fetch_array($_q);
    echo $_r['mobile'];
    ?>
</br></br>
<a class="ase" >Enter Password</a>
<input type="text" id="inp" name="otp" required>
</br>
<input type="submit" id="btn" value="continue">
</form>
$sql = mysqli_query($connection, "INSERT INTO `mobile_message`  SET `mobile` = '$mobile'");

 if($sql){

        $cid=$_POST['mobile'];   # write instead  $cid=$sql['mobile'];

        $_SESSION['cid']=$cid;

    $_SESSION['s']= "OTP sent to your mobile.";
        header('Location:sign2.php');

} else{
    $_SESSION['e']=  "Could not able to execute. ";
    header('Location:sign.php');

}