我是新來的PHP和閱讀幾本PHP書以及去一些教程。 我似乎無法得到這個PHP驗證項目工作寫。它似乎沒有擺脫任何空間或破折號。不知道我做錯了什麼。php信用卡驗證
<html>
<body>
<h1>Validate Credit Card</h1><hr />
<form action="ValidateCreditCard.php" method="get" encytype="application/x-www-form -urlencoded">
<p><input type="text" name="ccnumber" size="20" value="<?php if(!empty($_GET['ccnumber'])) echo $_GET['ccnumber'] ?>" /></p>
<p><input type="submit" value="Validate Credit Card" />
</form><hr />
<?php
if (!isset($_GET['ccnumber']))
echo "<p>Enter your credit card number.</p>";
else{
$Payment = $_GET['ccnumber'];
$ValidPayment = str_replace("_", "", $Payment);
$ValidPayment = str_replace("_", "", $ValidPayment);
if (!is_numberic($ValidPayment))
echo "<p>You did not enter a valid credit card number!</p>";
else
echo "<p>Your credit card number is $ValidPayment.</p>";
}
?>
</body>
</html>
如果您正在構建一個從用戶處獲取信用卡號碼的應用程序,則需要確保您符合安全標準,即PCI合規性標準。 https://www.pcisecuritystandards.org/ – nickb