我正在尝试将值从一个页面传递到另一个页面...在页面vendor-profile.php中,当我刷新页面时,来自seller-ride.php的所有传递数据都是未定义的,所以我必须得到回到卖家骑然后点击按钮然后所有数据显示,我怎样才能避免这种情况?请建议我更好的解决方案!
卖方ride.php
<form method="post" action="seller-profile.php">
<td><input type="text" value="<?php echo $row['company_name']; ?>" name="c_name" readonly> </td>
<td><input type="text" value="<?php echo $row['mobile']; ?>" name="mob" readonly></td>
<td><input type="text" value="<?php echo $row['count_free']; ?>" name="cf" readonly></td>
<td> <input type="text" value="<?php echo $row['count_travel']; ?>" name="ct" readonly></td>
<td><input type="text" value="<?php echo $row['price']; ?>" name="p" readonly>
<td><input type="submit" class="btn btn-flat btn-primary btn-sm" value="View-Profile" name="submit"></button></td>
</form>
卖方profile.php
<?php
include 'seller-profile-config.php';
?>
<?php echo $company_name; ?>
<?php echo $mobile; ?>
<?php echo $count_free; ?>
<?php echo $count_travel; ?>
<?php echo $price; ?>
卖方轮廓的config.php
<?php
if(isset($_POST['submit'])){
$company_name=$_POST['c_name'];
$mobile=$_POST['mob'];
$total_income=$_POST['p'];
$count_free=$_POST['cf'];
$count_travel=$_POST['ct'];
}
?>