我正在尝试创建一个简单的税务计算器,并且需要验证两个文本字段,以便它们不为空并且似乎没有任何提示?
if(isset($_GET['taxSubmit'])) {
$afterPrice = $_GET['taxPrice'];
$taxRate = $_GET['taxRate'];
$beforeTax = ($afterPrice * 100) / ($taxRate + 100);
if(!empty($_GET['taxPrice'.'taxRate'])){
echo "<h1>Price before tax = £".$beforeTax."<h1>";
} else {
echo 'All Fields Required';
}
}
有人要求标记,所以在这里:
<form method="get" action="watWk5.php">
<fieldset>
<legend>Without tax calculator</legend>
<label for="">After Tax Price</label>
<input type="text" name="taxPrice"/ value=<?php
if(isset($_GET['taxPrice'])){
echo $_GET['taxPrice'];
}
?>>
<label for="">Tax Rate</label>
<input type="text" name="taxRate"/ value=<?php
if(isset($_GET['taxRate'])){
echo $_GET['taxRate'];
}
?>>
<input type="submit" value="Submit" name="taxSubmit"/>
<button type="reset" value="Reset" name="clrButton">Clear</button>
</fieldset>
答案 0 :(得分:1)
每个变量应有自己的public async Task<bool> DoesSecretExist(string accessToken, string keyVaultBaseUrl, string secretName)
{
var kvClient = new KeyVaultClient(accessToken);
try
{
IPage<SecretItem> secretVersions = await kvClient.GetSecretVersionsAsync(keyVaultBaseUrl, secretName)
.ConfigureAwait(false);
if (!secretVersions.Any())
return false;
return true;
}
catch (Exception )
{
throw;
}
}
检查
!empty()