我需要帮助,这是我得到语法错误的代码。 thx guys
<?
if ($_POST['provincia']){
echo "<option value="$_POST[pronvicia]" selected="selected">$_POST[provincia]</option>";}
else{
echo "<option value="" selected="selected">seleziona</option>";};
?>
答案 0 :(得分:1)
将您的字符串与.
合并,并在需要时使用'
<?php
if ($_POST['provincia']){
echo "<option value=".$_POST['pronvicia']." selected='selected'>".$_POST['provincia']."</option>";}
else{
echo "<option value='' selected='selected'>seleziona</option>";}
?>
答案 1 :(得分:0)
或者:
app.controller('demo', ['$scope', 'ngDialog', function($scope, ngDialog) {
$scope.openDialog = function() {
ngDialog.openConfirm({
templateUrl: 'dialog-template.html',
scope: $scope
}).then(function () {
console.log('confirm');
}).catch(function () {
console.log('cancel');
})
}
}])
或者:
echo "<option value='$_POST[pronvicia]' selected='selected'>$_POST[provincia]</option>";}
答案 2 :(得分:0)
代码应如下所示
<?
if ($_POST['provincia']){
echo "<option value=".$_POST[pronvicia]." selected='selected'>".$_POST[provincia]."</option>";}
else{
echo "<option value='' selected='selected'>seleziona</option>";};
?>
答案 3 :(得分:0)
使用此
<?php
if ($_POST['provincia']){
echo '<option value="'.$_POST['pronvicia'].'" selected="selected">'.$_POST['provincia'].'</option>';
}
else{
echo '<option value="" selected="selected">seleziona</option>';
}
?>