我试图将页面中的变量值传递给另一页面。使用IM进入下一个页面,我使用会话来获取值,如何将页面中的值传递给PHP中的另一个页面
的链接变量不工作,但价格变量不起作用
下面的代码: 的index.php
<?php
require('connect.php');
if(!isset($_SESSION)){
session_start();
}
$query = mysqli_query($connection, "SELECT link, price FROM funnyture WHERE category ='Bed' or category = 'Chairs' or category = 'Tables'") or die("Couldn't find search");
$count = mysqli_num_rows($query);
if($count == 0) {
$output = "There was no row in array";
} else {
while($row = mysqli_fetch_array($query)) {
$link = $row['link'];
$price = $row['price'];
echo '
<form action="Orderform.php" method="post" class="formClass">
<input name="link" type="image" src="'.$link.'" value="'.$link.'" class="inputClass">
</form>';
}
}
?>
Orderform.php
<?php include 'navbar2.php' ;?>
<div class="left">
<?php
$_SESSION['link'] = $_POST['link'];
// $_SESSION['price'] = $_POST['price'];
echo '<img src="'.$_SESSION['link'] .'">';
echo '<p>'.$_GET['price'].'</p>';
?>
他lp me :)