PHP值不会发布

时间:2018-04-18 12:50:47

标签: php mysql

你好,因为某些原因,job_id不会从myjobs.php解析到payment.php,我真的看不出怎么样。有谁知道为什么会这样?类似的文件似乎有用但是出于某种原因我不会想也许是因为我还在payment.php上有html代码,我之前没有做过吗?

<?php while($row = mysqli_fetch_array($result)):?>
    <tr>

        <td><?php echo $row['job_id']; ?></td>
        <td><?php echo $row['title'];?></td>
        <td><?php echo $row['description'];?></td>

        <td><?php if($row['accepted']==1 AND $row['start_escrow']==0):?><form action = "payment.php">
        <input type="hidden" value="<?php echo $row['job_id']?>" name="job_id" />
        <input type="submit" class="btn btn-xlarge btn-block btn-primary" value ="Start Escrow"></input></input><?php endif; ?></td>

        <td><?php if($row['start_escrow']==1):?><form action = "review.php">
        <input type="hidden" value="<?php echo $row['job_id']?>" name="job_id" />
        <input type="submit" class="btn btn-xlarge btn-block btn-primary" value ="Start Escrow"></input></input><?php endif; ?></td>

    </tr>
<?php endwhile;?>
</table>

payment.php

<?php

require 'config.php';

$jobid    = $_POST['job_id'];

$query = "UPDATE job SET start_escrow = '1' WHERE  job_id = '$jobid''";
$success = $conn->query($query);
if (!$success) {
    die("Couldn't enter data: ".$conn->error);
}

echo "Thank You For Contacting Us <br>";

$conn->close();

?>

1 个答案:

答案 0 :(得分:1)

将您的方法设置为POST格式。

<form action = "payment.php" method="POST">
<form action = "review.php" method="POST">