2017-11-29 9 views
1

두 가지 형식이 있습니다. 나는 모바일이 세션을 통해 올 것 인 곳에서 두 번째로 mobile를 보여주고 싶다. 여기에 세션 ID가 표시되고 있지만 mobile이 보이지 않습니다.두 번째 페이지에 입력 이름 표시 양식

1 형식/페이지 : sign.php

<?php session_start(); 
<?php $r=session_id();?> 
<?php include('include/config.php');?> 
<form class="ff" action="signc.php" method="POST"> 
<a>Enter Your Mobile No.</a> 
<input type="text" id="inp" name="mobile" required> 
</br></br> 
<input type="submit" id="btn" value="continue"> 
</form> 

signc.php는

<?php session_start(); 
<?php $r=session_id();?> 
<?php include('include/config.php');?> 
$sql = mysqli_query($connection, "INSERT INTO `mobile_message` SET `mobile` = '$mobile'"); 

if($sql){ 

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

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

} 

2 양식/페이지 : sign2.php

<?php session_start(); 
<?php $r=session_id();?> 
<?php include('include/config.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'"); 
    $_t=mysqli_fetch_array($_q); 
    echo $_t['mobile']; 
    echo $r; 
    ?> 
</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> 

<!--hgfh--> 

echo $_t['mobile']; 아무것도에게

을 보여줍니다

echo $r;은 (cgvk2tla6r14h38i2v7dlhkj80

+0

당신이 $의 R에 할당 된 세션 값 ** signc.php

$cid=$_POST['mobile']; $_SESSION['cid']=$cid; 

수정 signc.php이 두 줄을 추가 보여줍니다);?> ** 그게 왜 보여줍니다 ** echo $ r; >> show'cgvk2tla6r14h38i2v7dlhkj80' ** set id = mobile도 시도해보십시오. not-mobile – Vishwa

+0

signc.php에서 sign_photo, sign2.php – kranthi

+0

을 제거하십시오. signc.php에서 session2.start()를 제거하면 $ mobile 변수 – Abhishek

답변

1

그냥

<?php session_start(); 
<?php $r=session_id();?> 
<?php include('include/config.php');?> 
$sql = mysqli_query($connection, "INSERT INTO `mobile_message` SET `mobile` = '$mobile'"); 

if($sql){ 

    $cid=$_POST['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'); 

}