- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我第二次发帖,我被困在这里将近一周了。我有一个网站,我需要通过管理面板更改个人资料信息。现在的问题是,每当我单击“编辑”按钮并对个人资料进行更改时,例如接受更改名称或电子邮件更改,但是当我尝试更改地址(例如通过下拉列表更改国家/地区),然后我根据所选国家/地区更改城市并提交我给我的这些更改在数据库中没有任何意义,没有进行任何更改,而不是更改,我在数据库中的县、省列中什么也没有得到,它们变成空白,没有数据我希望你明白我的意思!让我向您展示代码
edit_profileoverseasadmin.php
<script>
$(document).ready(function(){
$("form").submit(function(){
var e = document.getElementById("select");
var strUser = e.options[e.selectedIndex].text;
document.getElementById("hidden20").value = strUser;
var e1 = document.getElementById("selectcity");
var strUser1 = e1.options[e1.selectedIndex].text;
document.getElementById("hidden31").value = strUser1;
var e2 = document.getElementById("selectcontinent");
var strUser2 = e2.options[e2.selectedIndex].text;
document.getElementById("hidden32").value = strUser2;
var e3 = document.getElementById("selectprovince");
var strUser3 = e3.options[e3.selectedIndex].text;
document.getElementById("hiddenprovince").value = strUser3;
});
});
</script>
<script>
function OverseasValidation() {
$("#loaderIcon").show();
var e = document.getElementById("select");
var strUser = e.options[e.selectedIndex].text;
document.getElementById("hidden20").value = strUser;
var e1 = document.getElementById("selectcity");
var strUser1 = e1.options[e1.selectedIndex].text;
document.getElementById("hidden31").value = strUser1;
var e2 = document.getElementById("selectcontinent");
var strUser2 = e2.options[e2.selectedIndex].text;
document.getElementById("hidden32").value = strUser2;
var e3 = document.getElementById("selectprovince");
var strUser3 = e3.options[e3.selectedIndex].text;
document.getElementById("hiddenprovince").value = strUser3;
var rate_value;
if (document.getElementById('male').checked) {
rate_value = document.getElementById('male').value;
}
else{
rate_value = document.getElementById('female').value;
}
document.getElementById("hidden25").value = rate_value;
jQuery.ajax({
url: "<?php echo base_url();?>check_validation.php",
data:'hidden1='+$("#hidden1").val()+'&hidden2='+$("#hidden2").val()+'&hidden3='+$("#hidden3").val()+'&hidden4='+$("#hidden4").val()+'&hidden5='+$("#hidden5").val()+'&hidden6='+$("#hidden6").val()+'&hidden15='+$("#hidden15").val()+'&hiddencardholder='+$("#hiddencardholder").val()+'&hiddenaddress='+$("#hiddenaddress").val()+'&hiddenzip='+$("#hiddenzip").val()+'&hiddencardno='+$("#hiddencardno").val()+'&hiddencardexpiry='+$("#hiddencardexpiry").val()+'&cardcvv='+$("#cardcvv").val(),
type: "POST",
success:function(data){
if(data == "Success")
{
var x = document.createElement("INPUT");
x.setAttribute("type", "submit");
x.setAttribute("value","Register");
$("#user-availability-status10").html(x);
//document.getElementById("hidden1").value = data;
$("#loaderIcon").hide();
}
else if(data == "<span class='status-not-available'>Enter correct Card CVV format.</span>"){
$("#user-availability-status11").html(data);
$("#loaderIcon").hide();
}
else{
$("#user-availability-status11").html(data);
("#loaderIcon").hide();
}
},
error:function (){}
});
}
</script>
<script type="text/javascript">
$(document).ready(function () {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>name.php",
data:'phone='+$("#phone").val(),
type: "POST",
success:function(data){
$("#countrydropdown").html(data);
$("#loaderIcon").hide();
var e1 = document.getElementById("select");
e1.options[e1.selectedIndex].text = document.getElementById("hdcountry").value;
var e2 = document.getElementById("selectcontinent");
e2.options[e2.selectedIndex].text = document.getElementById("hdcontinent").value;
},
error:function (){}
});
var city = "13";
var country = "AF";
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>editcity.php",
type: "POST",
success:function(data){
$("#citydropdown").html(data);
$("#loaderIcon").hide();
var e1 = document.getElementById("selectcity");
e1.options[e1.selectedIndex].text = document.getElementById("hdcity").value;
},
error:function (){}
});
});
</script>
<script type="text/javascript">
$(document).ready(function () {
var country_code = "AF";
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>province_state.php",
data: { country_code : country_code},
type: "POST",
success:function(data){
// alert(data);
$("#provincedropdown").html(data);
$("#loaderIcon").hide();
var e1 = document.getElementById("selectprovince");
e1.options[e1.selectedIndex].text = document.getElementById("hdprovince").value;
},
error:function (){}
});
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>district.php",
//data:'phone='+$("#phone").val(),
type: "POST",
success:function(data){
$("#districtdropdown").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>tehsil.php",
//data:'phone='+$("#phone").val(),
type: "POST",
success:function(data){
$("#tehsildropdown").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>uc.php",
//data:'phone='+$("#phone").val(),
type: "POST",
success:function(data){
$("#ucdropdown").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
});
</script>
function checkstate() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_state.php",
//data:'cnic='+$("#cnic").val(),
data:'state='+$("#state").val(),
type: "POST",
success:function(data){
$("#user-availability-status111").html(data);
document.getElementById("hiddenstate").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkAddress() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_address.php",
//data:'cnic='+$("#cnic").val(),
data:'address='+$("#address").val(),
type: "POST",
success:function(data){
$("#address-availability").html(data);
document.getElementById("hiddenaddress").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkCity() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_city.php",
//data:'cnic='+$("#cnic").val(),
data:'city='+$("#city").val(),
type: "POST",
success:function(data){
$("#city-availability").html(data);
document.getElementById("hiddencity").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkCardcvv() {
var e = document.getElementById("select");
var strUser = e.options[e.selectedIndex].text;
document.getElementById("hidden20").value = strUser;
var e1 = document.getElementById("selectcity");
var strUser1 = e1.options[e1.selectedIndex].text;
document.getElementById("hidden31").value = strUser1;
var e2 = document.getElementById("selectcontinent");
var strUser2 = e2.options[e2.selectedIndex].text;
document.getElementById("hidden32").value = strUser2;
var e3 = document.getElementById("selectprovince");
var strUser3 = e3.options[e3.selectedIndex].text;
document.getElementById("hiddenprovince").value = strUser3;
var rate_value;
if (document.getElementById('male').checked) {
rate_value = document.getElementById('male').value;
}
else{
rate_value = document.getElementById('female').value;
}
document.getElementById("hidden25").value = rate_value;
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_cardcvv.php",
//data:'cnic='+$("#cnic").val(),
data:'cardcvv='+$("#cardcvv").val(),
type: "POST",
success:function(data){
$("#cardcvv-availability").html(data);
document.getElementById("hiddencardcvv").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkSilsala() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_silsala.php",
//data:'cnic='+$("#cnic").val(),
data:'silsala='+$("#silsala").val(),
type: "POST",
success:function(data){
$("#user-availability-status7").html(data);
document.getElementById("hidden7").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkBlock() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_block.php",
//data:'cnic='+$("#cnic").val(),
data:'block='+$("#block").val(),
type: "POST",
success:function(data){
$("#user-availability-status8").html(data);
document.getElementById("hidden8").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkProvince() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_province.php",
//data:'cnic='+$("#cnic").val(),
data:'state='+$("#state").val(),
type: "POST",
success:function(data){
$("#user-availability-status9").html(data);
document.getElementById("hidden9").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
function checkContinent() {
$("#loaderIcon").show();
jQuery.ajax({
url: "<?php echo base_url();?>check_continent.php",
//data:'cnic='+$("#cnic").val(),
data:'continent='+$("#continent").val(),
type: "POST",
success:function(data){
$("#user-availability-status39").html(data);
document.getElementById("hidden39").value = data;
$("#loaderIcon").hide();
},
error:function (){}
});
}
</script>
<body>
<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah')
.attr('src', e.target.result)
.width(120)
.height(150);
};
reader.readAsDataURL(input.files[0]);
}
}
</script>
<script type="text/javascript">
$(document).ready(function() {
$(".my-activity").click(function(event) {
var total = 120;
/*var lensector=$(this).find('input[name="check_list[]"]:checked').length;
document.getElementById("hidden29").value = lensector;
var lenoffice=$(this).find('input[name="check_list1[]"]:checked').length;
document.getElementById("hidden30").value = lenoffice;*/
var countsectors = 0;
var countoffice = 0;
var countwings = parseInt(document.getElementById("wings").value);
//alert(checkedBoxes);
$(".my-activity:checked").each(function() {
if($(this).val() == "UC Member"){
countoffice += 1;
total += 5000;
}
else if($(this).val() == "Tehsil President"){
countoffice += 1;
total += 10000;
}
else if($(this).val() == "District President"){
countoffice += 1;
total += 25000;
}
else if($(this).val() == "Commerce & Trade"){
countwings += 1;
//total += 10000;
}
/*else if($(this).val() == "Commerce"){
countwings += 1;
//total += 10000;
}*/
else if($(this).val() == "Industry"){
countwings += 1;
//total += 10000;
}
else if($(this).val() == "Lawyer"){
countwings += 1;
//total += 25000;
}
else if($(this).val() == "Doctor"){
countwings += 1;
//total += 10000;
}
else if($(this).val() == "Minorities"){
countwings += 1;
//total += 25000;
}
else if($(this).val() == "Women_Development"){
countwings += 1;
//total += 10000;
}
else if($(this).val() == "Functionary"){
countwings += 1;
//total += 25000;
}
else if($(this).val() == "Other"){
countwings += 1;
var data = '<input type="text" id="otherfield" name="otherfield">';
$("#otherfield").html(data);
//total += 25000;
}
else{
countsectors += 1;
total += 120;
}
});
if (total == 120) {
$('#amount').val('120');
} else {
$('#amount').val(total);
}
document.getElementById("hidden29").value = countsectors;
document.getElementById("hidden30").value = countoffice;
document.getElementById("wings").value = countwings;
var amount = total;
document.getElementById("payment").value = total;
});
});
</script>
<script>
window.onload=function() {
document.getElementById("countrydropdown").onchange=function() {
//var period = this.value;
var e = document.getElementById("select");
var strUser = e.options[e.selectedIndex].value;
document.getElementById("hidden20").value = strUser;
//var e = document.getElementById("select");
var ctry = e.options[e.selectedIndex].text;
document.getElementById("hiddencountry").value = ctry;
jQuery.ajax({
url: "<?php echo base_url();?>province_state.php",
data: { country_code : strUser},
type: "POST",
success:function(data){
$("#provincedropdown").html(data);
$("#loaderIcon").hide();
},
error:function (){}
});
}
document.getElementById("provincedropdown").onchange=function() {
var e = document.getElementById("selectprovince");
var strUser = e.options[e.selectedIndex].value;
document.getElementById("hidden20").value = strUser;
var ctry = e.options[e.selectedIndex].text;
document.getElementById("hiddenstate").value = ctry;
var rate_value;
if (document.getElementById('male').checked) {
rate_value = document.getElementById('male').value;
}
else{
rate_value = document.getElementById('female').value;
}
document.getElementById("hidden25").value = rate_value;
var e1 = document.getElementById("select");
var strUser1 = e1.options[e1.selectedIndex].value;
jQuery.ajax({
url: "<?php echo base_url();?>city.php",
data: { country : strUser1 , city : strUser },
type: "POST",
success:function(data){
$("#citydropdown").html(data);
//document.getElementById("hiddencity").value = strUser;
$("#loaderIcon").hide();
},
error:function (){}
});
}
}
</script>
<?php $this->load->view('header'); ?>
<!--Form Start-->
<div class="row">
<div class="col-md-offset-3 col-md-9">
<h2><legend class="alignright"><u>Edit Profile</u></legend></h2>
<div class="col-lg-5">
<h3>Membership # <strong><?php echo $membershipno;?></strong></h3>
<h4><?php echo $province; ?></h4>
</div>
<?php echo form_open_multipart("admin/editprofileoverseas/".$id);?>
<div class="col-lg-4 col-lg-offset-1">
<?php if($pic_path != './profile_pics/'):?>
<img id="blah" src="<?php echo base_url().$pic_path;?>" height="150"/>
<?php else: ?>
<img id="blah" src="https://nabobil.no/assets/default_profile_pic-05d39cb795bbb98e10c104b8f4aba70677a3f9f6c13253bf94f16181e9ee5a99.gif" height="150"/>
<?php endif; ?>
<input type='file' name="myFile" onchange="readURL(this)"; />
</div>
<br>
<br>
<span class="col-md-4 col-md-offset-4" style="color:#D91E18"> <?php echo $message;?></span>
<div class="controls col-md-5">
<label class="control-label" for="username">Full Name</label> *<br>
<!--<input type="text" id="firstname" name="firstname" placeholder="" class="input-xlarge" onBlur="checkAvailability2()">-->
<?php echo "<input name='firstname' type='text' class='form-control' id='firstname' value='$first_name' />";?><span id="user-availability-status2"></span>
</div>
<input type="hidden" id="hidden2" name="hidden2" value="">
<div class="controls col-lg-5">
<label class="control-label" for="relation">Father / Husband Name</label><br>
<?php echo "<input name='relation' type='text' class='form-control' id='relation' value='$relation' />";?>
</div>
<div class="controls col-lg-5">
<label class="control-label" for="username">Date Of Birth</label><br>
<?php echo "<input name='dob' type='text' class='form-control' id='dob' value='$birth_date' />";?><span id="user-availability-status15"></span>
</div>
<!--<div class="control col-md-5">
<label class="control-label" for="email">CNIC</label><br>
<?php echo "<input name='cnic' type='text' class='form-control' id='cnic' value='$cnic' />";?><span id="user-availability-status3"></span>
</div>
<input type="hidden" id="hidden3" name="hidden3" value="">-->
<input type="hidden" id="hidden4" name="hidden4" value="">
<input type="hidden" id="hidden15" name="hidden15" value="">
<!--<div class="controls col-md-5">
<label class="control-label" for="email">E-mail</label> *
<br>
<?php echo "<input name='email' type='text' class='form-control' id='email' value='$email' />";?><span id="user-availability-status1"></span>
</div>
<input type="hidden" id="hidden1" name="hidden1" value="">
<input type="hidden" id="hidden5" name="hidden5" value="">
<div class="control col-md-5">
<label class="control-label" for="email">Gender</label><br>
<input type="radio" name="gender" value="male" id="male" checked="true"> Male
<input type="radio" name="gender" value="female" id="female"> Female<br>
</div>
<input type="hidden" id="hidden25" name="hidden25" value="">-->
<!-- <div class="control col-md-5">
<label class="control-label" for="email">Profile Picture</label><br>
<input type='file' name="myFile" onchange="readURL(this)"; />
</div>-->
<div class="control col-md-5">
<label class="control-label" for="email">Landline Number</label><br>
<?php echo "<input name='phone' type='text' class='form-control' id='phone' value='$phone' />";?>
</div>
<div class="control col-md-5">
<label class="control-label" for="email">Mobile Number</label> *<br>
<!--<input type="tel" name="mobile" id="mobile" placeholder="03012345678" onBlur="checkMobile()">-->
<?php echo "<input name='mobile' type='text' class='form-control' id='mobile' value='$mobile' />";?><span id="user-availability-status6"></span>
</div>
<input type="hidden" id="hidden6" name="hidden6" value="">
<div class="control col-md-5">
<label class="control-label" for="email">Email Address</label> *<br>
<!--<input type="tel" name="mobile" id="mobile" placeholder="03012345678" onBlur="checkMobile()">-->
<?php echo "<input name='email' type='text' class='form-control' id='email' value='$email' />";?><span id="user-availability-status1"></span>
</div>
<div class="control col-md-5">
<label class="control-label" for="email">Mailing Address</label> *<br>
<?php echo "<textarea name='mailingaddress' rows='10' cols='160' class='form-control' id='mailingaddress'>$mailingaddress</textarea>";?>
</div>
<!--<div class="control col-md-5">
<label class="control-label" for="email"></label><br>
<span id="countrydropdown"></span>
</div>-->
<div class="row Weddings">
</div>
<!--<div class="control col-md-5">
<label class="control-label" for="username">Continent</label><br>
<input type="text" id="continent" name="continent" placeholder="" class="input-xlarge" onBlur="checkContinent()"><span id="user-availability-status39"></span>
</div>
<input type="hidden" id="hidden39" name="hidden39" value="">-->
<div class="control col-md-5">
<label class="control-label" for="email">Country</label> *<br>
<span id="countrydropdown"></span>
<?php
$selected='';
$con=mysqli_connect("localhost","","","freedomorg");
$sql=mysqli_query($con,"SELECT id,name FROM countries");
if(mysqli_num_rows($sql)){
$select= '<select name="select" id="select">';
while($rs=mysqli_fetch_array($sql))
{
if($rs['name']===$country)
{
$select.='<option selected="selected" value="'.$rs['id'].'">'.$rs['name'].'</option>';
}
else
{
$select.='<option value="'.$rs['id'].'">'.$rs['name'].'</option>';
}
}
$select.='</select>';
echo $select;
}
//P}OaK[oW@s[U
?>
</div>
<input type="hidden" id="hidden20" name="hidden20" value="">
<input type="hidden" id="hiddencountry" name="hiddencountry" value="">
<div class="control col-md-5">
<label class="control-label" for="email">Continent</label> *<br>
<select id="selectcontinent">
<option value="Asia">Asia</option>
<option value="Africa">Africa</option>
<option value="North America">North America</option>
<option value="South America">South America</option>
<option value="Antarctica">Antarctica</option>
<option value="Europe">Europe</option>
<option value="Australia">Australia</option>
</select>
</div>
<input type="hidden" id="hidden32" name="hidden32" value="">
<div class="control col-md-5">
<label class="control-label" for="username">State/Province *</label><br>
<span id="provincedropdown"></span>
<?php
// $country_code = $_POST["country_code"];
$con=mysqli_connect("localhost","","","freedomorg");
$sql1=mysqli_query($con,"SELECT code FROM countries WHERE name='$country'");
$row = mysqli_fetch_assoc($sql1);
$result=$row['code'];
$sql=mysqli_query($con,"SELECT code,name FROM regions WHERE country='$result' order by name ASC");
if(mysqli_num_rows($sql)){
$select= '<select name="select" id="selectprovince">';
while($rs=mysqli_fetch_array($sql)){
if($rs['name']===$province)
{
$select.='<option selected="selected" value="'.$rs['code'].'">'.$rs['name'].'</option>';
}
else
{
$select.='<option value="'.$rs['code'].'">'.$rs['name'].'</option>';
}
}
$select.='</select>';
echo $select;
}
?>
<!-- <input type="text" id="state" name="state" placeholder="" class="input-xlarge" onBlur="checkstate()"><span id="user-availability-status111"></span><!--onBlur="OverseasValidation()"><span id="user-availability-status11"></span>-->
</div>
<input type="hidden" id="hiddenprovince" name="hiddenprovince" value="">
<input type="hidden" id="hiddenstate" name="hiddenstate" value="">
<?php echo "<input name='hdprovince' type='hidden' id='hdprovince' value='$province' />";?>
<?php echo "<input name='hdcountry' type='hidden' id='hdcountry' value='$country' />";?>
<?php echo "<input name='hdcity' type='hidden' id='hdcity' value='$city' />";?>
<?php echo "<input name='hdcontinent' type='hidden' id='hdcontinent' value='$continent' />";?>
<input type="hidden" id="hidden21" name="hidden21" value="">
<div class="control col-md-5">
<label class="control-label" for="username">City *</label><br>
<span id="citydropdown"></span>
<?php
$con=mysqli_connect("localhost","","","freedomorg");
$sql=mysqli_query($con,"SELECT id,name FROM cities WHERE name != '' order by name ASC");
if(mysqli_num_rows($sql)){
$select= '<select name="select" id="selectcity">';
while($rs=mysqli_fetch_array($sql)){
if($rs['name']===$city)
{
$select.='<option selected="selected" value="'.$rs['id'].'">'.$rs['name'].'</option>';
}
else
{
$select.='<option value="'.$rs['id'].'">'.$rs['name'].'</option>';
}
}
$select.='</select>';
echo $select;
}
?>
<!--<input type="text" id="city" name="city" placeholder="" class="input-xlarge" onBlur="OverseasValidation()"><span id="user-availability-status11"></span>-->
</div>
<input type="hidden" id="hiddencity" name="hiddencity" value="">
<input type="hidden" id="hidden31" name="hidden31" value="">
<div class="row">
<div class="col-md-offset-3 col-md-9 col-lg-offset-4 col-lg-8">
<?php echo form_submit('submit', 'Submit');?> <?php echo form_close();?>
</div>
</div>
<br>
<br>
</div>
</div>
</div>
<!-- Tehsil Council wali bakwas-->
<br>
<br>
<!--Form End-->
<!-- Footer Start -->
<?php $this->load->view('footer'); ?>
</body>
</html>
最佳答案
请尝试mvc结构,我希望这段代码能帮助您正确找到问题您应该将数据库详细信息添加到database.php
文件
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => 'root',
'database' => 'db_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
这是我的 Controller 文件
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Welcome extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('sitemodel');
}
public function index()
{
$data['countries'] = $this->sitemodel->get_country();
$this->load->view('welcome_message',$data);
}
}
然后Sitemodel.php
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Sitemodel extends CI_Model {
function __construct() {
// Call the Model constructor
parent::__construct();
}
function get_country() {
$this->db->select('id,name');
$this->db->from('countries');
$data = $this->db->get()->result();
return $data;
}
}
最后我刚刚添加了带有下拉菜单的 View 文件
<select name="country" id="country">
<?php
foreach($countries as $country)
{
?>
<option value="<?= $country->id?>">"<?= $country->name?></option>
<?php
}
?>
</select>
希望这对你有帮助
关于javascript - Codeigniter:每当尝试编辑配置文件时,下拉列表都会将空值传递到数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46442404/
我添加了编辑按钮 self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButto
我试图在运行时“干净地”更改 UIBarButtonItem 文本,以便可以切换编辑/完成模式。然而,每次我在运行时更改 title 属性时,动画看起来都很笨拙。我正在寻找模拟联系人应用程序中“编辑/
这个问题不太可能帮助任何 future 的访问者;它只与一个小的地理区域、一个特定的时间点或一个非常狭窄的情况有关,这些情况并不普遍适用于互联网的全局受众。为了帮助使这个问题更广泛地适用,visit
我想更改 INI 文件中的一些值。不幸的是,我在 2 个不同的部分有键,它们共享相同的名称但需要不同的值。我的代码使用 Get-IniContent函数来自 PsIni . 示例 INI 文件: [P
是否有通知或委托(delegate)方法可用于检测表格 View 何时进入编辑状态? 我想要做的是检测表正在编辑,然后显示一个额外的行,上面写着“添加新项目”或类似的东西。 我尝试在加载 View C
例如,我试图从 svg 读取样式块,我可以获取类型但不能获取字符串。 $svgTemplate = new SimpleXMLElement($_POST['SvgTemplateImport']);
我可以使用 self.navigationItem.leftBarButtonItem = self.editButtonItem; 通过按下导航面板上的编辑按钮让 UITableViewContro
我正在使用markitup!作为 Markdown 编辑器( example )。 目前,我需要按预览按钮(绿色勾号)来显示预览面板。 我希望自动显示预览 - 我怎样才能实现这一点? 最佳答案 我没有
我的处境非常糟糕。我丢失了源代码,客户需要在应用程序中进行一些更改。想想一个编辑程序集的例子:Test.dll,然后添加代码行,最后重新编译它 所以我的问题是: -可以这样做吗? -如果可能的话,什么
我使用了一些 JavaScript 来通过按钮更改段落元素的内容。它工作正常,但我还想让按钮控制标题和附图。给我指明正确的方向吗? 这是我用来更改段落的代码 .... 谢谢! 最佳答案 尝试将 Ja
是否有任何 Emacs lisp 插件可以让我轻松地在 yaml 文件中编辑或输入数据。 例如: --- sample yaml file ---Name : Addr :City :State:Zi
新手Java问题,我确定已经解决了,但是在任何地方都找不到解决方案:( 我想使用这里包含的java程序http://sourceforge.net/projects/ant-tibco/files/
在我的网页中,我使用了 gridview。在这个 GridView 中,它显示了一组用户信息。我刚刚从智能标签菜单中添加了一个按钮。我的要求是当我点击每个用户对应的按钮时,它会重定向到另一个页面并显示
我想在没有任何框架的情况下直接在 JS 中编辑一个 SVG 文件。 基本上我有一个 SVG 主文件,其中应该包含一些子 SVG。 我已经在 Ajax 中检索了这些子项的内容,但我想将它们插入到 SVG
我有我的 ViewModel,我有我的 Controller 可以从 ViewModel 正确显示,但是我不确定如何使 ViewModel 可编辑,以便将编辑后的数据发送回模型。我只想编辑 Order
我不确定我的做法是否正确。 IplImage *dog_1 = cvCreateImage(cvGetSize(oriImg), oriImg->depth, oriImg->nChannels);
我有一个创建二维码的网络服务器。在此过程中,我得到一个 BarcodeQRCode 对象,我可以从中获取图像 (.getImage())。 我不确定如何将这张图片发回给客户。我不想将它保存在文件中,而
已编辑:我的第一个问题解决了,但又出现了另一个问题,只提供了一个用户 ID。这是修改后的代码的屏幕截图。 回到表格,用户将按下编辑按钮,这样他就可以编辑问题并给出适当的操作.. 我的上表代码是这样的:
据我了解,我无法通过重新启动服务器来清除 MySQL 查询缓存。 每次运行 sql 时,我都试图获得与第一个代码块类似的结果 1-这是在重新启动 Apache 和 MySQL 之前(第一次使用这些查询
我正在创建一个页面来搜索项目,然后能够编辑/更新它。当它只返回一个结果时我能够做到这一点,但当它给我多个结果时我只能编辑最后一项。下面是我的代码: ....... $dj =$_POST[djnum]
我是一名优秀的程序员,十分优秀!