我有這個PHP文件的工作原理,我只是想在底部做一個按鈕,當你點擊它時,它會帶你到另一個PHP文件,顯示「購買成功!」我錯過了什麼?獲取提交按鈕在PHP文件中工作
繼承人的第一PHP:
<!DOCTYPE>
<html>
<head>
<title>Confirmation Page</title>
<style>
</style>
</head>
<body bgcolor="#E6E6FA">
<h2>Customer:</h2>
<?php
//Check whether the form has been submitted
if (array_key_exists('check_submit', $_POST)) {
//Converts the new line characters (\n) in the text area into HTML line breaks (the <br /> tag)
$_POST['Comments'] = nl2br($_POST['Comments']);
//Check whether a $_GET['Languages'] is set
if (isset($_POST['Colors'])) {
$_POST['Colors'] = implode(', ', $_POST['Colors']); //Converts an array into a single string
}
//Let's now print out the received values in the browser
echo "Your first name: {$_POST['firstName']}<br />";
echo "Your last name: {$_POST['lastName']}<br /><br />";
echo "Your address:<br />{$_POST['address']}<br /><br />";
echo "Your phone number: {$_POST['phone']}<br /><br />";
echo "Your favourite gaming console: {$_POST['console']}<br /><br />";
echo "Games you choose to purchase: {$_POST['games']}<br /><br />";
echo "Card being used: {$_POST['card']}<br />";
echo "Card Number: {$_POST['cardnumber']}<br />";
echo "Card Expiration Date: {$_POST['expdate']}<br /><br />";
} else {
echo "You can't see this page without submitting the form.";
}
?>
<form action="assign11_a.php"></form>
<input type="submit" value="Submit">
</body>
</html>
這裏的地方我想去的地方:
<!DOCTYPE>
<html>
<head>
<title>Purchase Successful!</title>
<style>
</style>
</head>
<body bgcolor="#E6E6FA">
<h2>Purchase Successful!</h2>
<?php
?>
</body>
</html>
哦,是啊,就是這樣!謝謝! – 2014-12-04 17:14:06