通过 javascript 添加的输入字段不在 PHP $_POST 变量中。如何解决这个问题?

2024-02-21

我在 html 表中有一个表单。

我通过 jquery 动态地将输入字段添加到表单中。当我在提交表单时进行 var dump 时,$_POST 数组没有添加的字段。为什么会发生这种情况?

这是我的 js 的样子:

$('#add-more-del-areas').live('click',function(e){
        var del_area_count = $('[name=number_of_delivery_areas]').val();
        var new_count = (parseInt(del_area_count)+1);
        var tr_html =   '<tr>'+
                            '<td style="padding:10px 0px 0px 10px;"><strong>Delivery Area '+new_count+'</strong></td>'+
                            '<td>'+
                                '<input  name="d_area'+new_count+'" type="text"  size="50"  value=""/>'+
                                '<div class="area-display-container" id="test'+new_count+'-display"></div>'+
                                '<div>'+
                                    '<input class="auto-suggest-input" type="text" autocomplete="off" id="test'+new_count+'"/>'+
                                    '<div class="test-content" id="test'+new_count+'-content"></div>'+
                                '</div>'+
                            '</td>'+
                        '</tr>'+
                        '<tr id="del_area-'+new_count+'" bgcolor="#FF9933">'+
                            '<td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area '+new_count+'</strong></td>'+
                            '<td><input name="m_order'+new_count+'" type="text" size="50" value="0"></td>'+
                        '</tr>';
        //$('#del_area-'+del_area_count).after(tr_html);
        $(tr_html).insertAfter('#del_area-'+del_area_count);

        big_cms.auto_suggest_({id: 'test'+new_count,input_field: 'd_area'+new_count});
        $('[name=number_of_delivery_areas]').val(new_count);
        e.preventDefault();

    });

虽然 html 很可怜而且太长,但它是:

<table width="840" border="0" cellpadding="0" cellspacing="0" style="border: #57414D 4px Solid; margin:auto;">
            <tr>
                <td  height="20px" bgcolor="#57414D" align="center" colspan="2"><span  style="font-family:arial; font-size:13px; color:#ffffff"><b>You can add/edit Restaurant/Management content here!!</b></span></td>
            </tr>
            <?php   
                if ($bgclass == "bgExtraLightGray")
                    $bgclass = "bgWhite";
                else
                    $bgclass = "bgExtraLightGray";      
            ?>
            <form name="frmCatPopup" method="POST" enctype="multipart/form-data" onSubmit="return ValidateContactForm();">
            <tr align="center" bgcolor="#FF9933" class="<?php echo($bgclass); ?>">
                <td colspan="2" class="note">&nbsp;<?php echo($errMsg); ?></td>
            </tr>
            <tr>
                <td width="40%" class="heading1" style="padding-left:10px"><strong>Register Name</strong></td>
                <td width="60%" style="padding-bottom:4px;"><select name="name" class="restar_txtbox" style="width:326px;">
                <?php

                    $quer_l="select * from ".$tableprefix."restaurant_sign_up";
                    $cmd_l=mysql_query($quer_l);
                    while($res_l=mysql_fetch_array($cmd_l))
                    {               
                ?>
                    <option value="<?php echo $res_l['fld_id']; ?>" <?php if($rs['signup_id']==$res_l['fld_id']) echo"selected";?>><?php echo $res_l['fld_contact_person']; ?></option>
                <?php
                    }
                ?>
                    </select>
                </td>
            </tr>

            <tr bgcolor="#FF9933">  
                <td width="40%" class="heading1" style="padding-left:10px"><strong>Restaurant Name</strong></td>
                <td><input type="text" name="rest_name" size="50" value="<?php echo $rs['fld_name'];?>"/></td>
            </tr>
            <tr>
                <td class="heading1" style="padding:4px 0 4px 10px;"><strong>Address</strong></td>
                <td style="padding:4px 0 4px 0;">
                    <textarea rows="3" cols="38" name="address"  id="address"   value="<?php echo($rs["fld_address"]); ?>" size="50">
                        <?php echo($rs["fld_address"]); ?>
                    </textarea>
                </td>
            </tr>
            <tr bgcolor="#FF9933">
                <td class="heading1" style="padding-left:10px"><strong>Location</strong></td>
                <td>
                    <select name="loc" style="width:326px;" ><!--onchange="locat(this.value)"-->
                        <option>Select Location</option> 
                        <?php
                            $quer_l="select * from ".$tableprefix."location where location_status='1'";
                            $cmd_l=mysql_query($quer_l);
                            while($res_l=mysql_fetch_array($cmd_l))
                            {               
                        ?>
                        <option value="<?php echo $res_l['location_id']; ?>" <?php if($rs['location_id']==$res_l['location_id']) echo"selected";?>><?php echo $res_l['name']; ?></option>
                        <?php
                            }
                        ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Area</strong></td>
                <td style="padding:4px 0 4px 0;">

                    <?php /*?><div id="area"><select name="area" style="width:326px;">
                        <option value="asap">Select Location First</option>
                        </select>
                        </div><?php */?>
                        <select name="area"  style="width:326px;">
                    <?php
                        $quer_a="select * from ".$tableprefix."area where status='1'";
                        $cmd_a=mysql_query($quer_a);
                        while($res_a=mysql_fetch_array($cmd_a))
                        {               
                    ?>
                            <option value="<?php echo $res_a['area_id']; ?>"  <?php if($rs['area_id']==$res_a['area_id']) echo"selected";?>><?php echo $res_a['area_name']; ?></option>
                    <?php
                        }
                    ?>
                        </select>
                </td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Opening Time</strong></td>
                <td><input name="openingtime_start" type="text"  id="openingtime_start"  value="
                <?php 
                    $q1=$rs["fld_openingtime_start"];
                    $q=strlen($rs["fld_openingtime_start"]);
                    $S=substr("$q1","-$q","-2");
                    $S4=substr("$q1","-2","2");
                    echo $S;
                ?>">
                    <select name="start">
                        <option value="am" <?php if($S4=="am"){echo "selected";}?>>am</option>
                        <option value="pm" <?php if($S4=="pm"){echo "selected";}?>>pm</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Closing Time</strong></td>
                <td style="padding:4px 0 4px 0;">
                    <input name="closingtime_start" type="text" class="restar_txtbox" id="closingtime_start"  value="
                    <?php 
                        $q6=$rs["fld_closingtime_start"];
                        $q7=strlen($rs["fld_closingtime_start"]);
                        $S3=substr("$q6","-$q7","-2");
                        $S4=substr("$q6","-2","2");
                        echo $S3;
                    ?>">
                    <select name="end">
                        <option value="am"<?php if($S4=="am"){echo "selected";}?>>am</option>
                        <option value="pm" <?php if($S4=="pm"){echo "selected";}?>>pm</option>
                    </select>
                </td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding:4px 0 4px 10px;"><strong>Opening Time</strong></td>
                <td style="padding:4px 0 4px 0;">
                    <input name="openingtime_start1" type="text" class="restar_txtbox" id="openingtime_start1"  value="
                    <?php
                        $q4=$rs["fld_openingtime_start1"];
                        $q5=strlen($rs["fld_openingtime_start1"]);
                        $S2=substr("$q4","-$q5","-2");
                        $S4=substr("$q4","-2","2");
                        echo $S2;
                    ?>">
                    <select name="start1">
                        <option value="am" <?php if($S4=="am"){echo "selected";}?>>am</option>
                        <option value="pm" <?php if($S4=="pm"){echo "selected";}?>>pm</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Closing Time</strong></td>
                <td style="padding:4px 0 4px 0;">
                    <input name="closingtime_start1" type="text" class="restar_txtbox" id="closingtime_start1"  value="
                <?php 
                    $q2=$rs["fld_closingtime_start1"];
                    $q3=strlen($rs["fld_closingtime_start1"]);
                    $S1=substr("$q2","-$q3","-2");
                    $S4=substr("$q4","-2","2");
                    echo $S1;
                ?>">
                    <select name="end1">
                        <option value="am" <?php if($S4=="am"){echo "selected";}?>>am</option>
                        <option value="pm" <?php if($S4=="pm"){echo "selected";}?>>pm</option>
                    </select>
                </td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Delivery Fee</strong></td>
                <td>
                    <input type="text"    name="delivery_fee" value="<?php echo($rs["fld_deliveryfee"]); ?>" size="50">
                </td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Cuisines</strong></td>
                <td style="padding:4px 0 4px 0;">
                    <select name="cuisines[]" id="cuisines[]"  style="width:326px;" multiple="multiple">
                    <?php
                        $quer_l="select * from ".$tableprefix."cuisines where status='1'";
                        $cmd_l=mysql_query($quer_l);
                        $allCuisines = array();
                        while($row = mysql_fetch_assoc($cmd_l))
                        {
                            $allCuisines[] = $row;
                        }                 
                        //[BIG-3] In case there are multiple cuisines selected, they were not being pulled back from DB for display at frontend. 
                        $cuisineIds = explode(',',$rs['fld_cuisines']);               // In the $cuisineIds, all the cuisines selected from DB get stored
                        foreach( $allCuisines as  $res_l)                            //Looping on all cuisines as they all need to be echoed once, as well as comparing the condition for a match to the Cuisines originally associated with restaurant
                        {
                        ?>
                            <option value="<?php echo $res_l['cuisines_id']; ?>" 
                            <?php  
                                foreach ( $cuisineIds  as $cuisId ) 
                                {
                                    if($cuisId ==$res_l['cuisines_id'])
                                        echo"selected"; 
                                }
                            ?> >
                            <?php echo $res_l['cuisines_name'];   ?></option>                
                            <?php
                        }
                    ?>
                    </select>
                </td>
            </tr>
            <tr>
                <td style="padding-left:10px"><strong>Pure Veg</strong></td>
                <td>
                    <input type="checkbox"     name="veg_flag" 
                    <?php 
                        if(isSet($rs["veg_flag"]) && $rs['veg_flag']==1) 
                            echo("checked='checked'"); 
                    ?> value="1"/>
                </td>
            </tr>
                <!--</td>   </tr> -->
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Min Order</strong></td>
                <td>
                    <input type="text"     name="min_order" value="
                    <?php echo($rs["fld_minorder"]); ?>" size="50"/>
                </td>
            </tr>
            <tr> 
                <td style="padding:4px 0 4px 10px;"><strong>Phone</strong></td>
                <td style="padding:4px 0 4px 0;"><input name="phone" type="text"  id="phone" size="50"  value="<?php echo($rs["fld_phone"]); ?>"></td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Upload 1</strong></td>
                <td><input name="photos" type="file" size="38" id="photos"  /></td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>upload 2</strong></td>
                <td style="padding:4px 0 4px 0;"><input name="videos" type="file" id="videos"  /></td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Rating</strong></td>
                <td><input name="rating" type="text" id="rating"   value="<?php echo($rs["fld_rating"]); ?>" size="50"></td>
            </tr>
                <!--</td></tr> -->
            <tr bgcolor="#fff001">
                <td class="heading1" style="padding-left:10px"><strong>Restaurent Close Day</strong></td>
                <td>
                    <select name="day" style="width:200px;" ><!--onchange="locat(this.value)"-->
                        <option value="0">Select Day</option>
                        <option  value="1">Monday</option>
                        <option  value="2">Tuesday</option>
                        <option  value="3">Wednesday</option>
                        <option  value="4">Thursday</option>
                        <option  value="5">Friday</option>
                        <option  value="6">Saturday</option>
                        <option  value="7">Sunday</option>                
                    </select>
                </td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Description</strong></td>
                <td style="padding:4px 0 4px 0;"><textarea name="desc" type="text" id="desc" cols="38" rows="3"   ><?php echo($rs["fld_desc"]); ?></textarea></td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding-left:10px"><strong>Info</strong></td>
                <td><textarea name="info" type="text" id="info" cols="38" rows="3"  > <?php echo($rs["fld_info"]); ?></textarea></td>
            </tr>
            <tr>
                <td style="padding:4px 0 4px 10px;"><strong>Specilialities</strong></td>
                <td style="padding:4px 0 4px 0;"><input type="text"   name="specialities" value="<?php echo($rs['fld_specialities']) ?>" size="50" /></td>
            </tr>
            <tr bgcolor="#FF9933" >
                <td style="padding-left:10px"><strong>Delivery Time</strong></td>
                <td><input name="delivery_time" type="text" id="delivery_time" size="50"     value="<?php echo($rs["fld_deliverytime"]); ?>"></td>
            </tr>
            <tr>      
                <td style="padding:10px 0px 0px 10px;"><strong>Tax</strong></td>
                <td><input name="tax" type="text" id="tax" size="50"  value="<?php echo($rs["fld_tax"]); ?>"></td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding:10px 0px 0px 10px;"><strong>Cost For One</strong></td>
                <td><input name="cost" type="text" id="cost" size="50" value="<?php echo($rs["fld_cost"]); ?>"></td>
            </tr>
            <tr>
                <td style="padding-left:10px"><strong>Packaging Charge</strong></td>
                <td><input name="p_charge" type="text" size="50" value="<?php echo($rs["p_charge"]); ?>"></td>
            </tr>
            <tr bgcolor="#FF9933">
                <td style="padding:10px 0px 0px 10px;"><strong>Label for Tax</strong></td>
                <td><input name="label_t" type="text" size="50" value="<?php echo($rs["label_t"]); ?>"></td>
            </tr>
            <?php 
                if(isset($_GET['fld']))
                {
                    $delivery_area_data = Task::getDeliveryAreaData($_GET['fld']);
                    $no_of_del_areas = sizeof($delivery_area_data);
                    if($no_of_del_areas > 0)
                    {
                        echo '<tr><td><input type="hidden" name="number_of_delivery_areas" value="'.$no_of_del_areas.'"/></td></tr>';
                        for($i=1;$i<=$no_of_del_areas;$i++)
                        {
                            $min_id = $i;
                            $min_order = $delivery_area_data[$i]['min_order'];
                            $area_id_str = implode(',',$delivery_area_data[$i]['area_ids']);
                            $area_name_str = '';
                            $j = 0;
                            foreach($delivery_area_data[$i]['area_names'] as $name)
                            {
                                $tmp_area_id = $delivery_area_data[$i]['area_ids'][$j];
                                $area_name_str .= '<span class="area-label" id="test'.$min_id.'-area-'.$tmp_area_id.'">
                                    '.$name.'
                                    <span class="test'.$min_id.'-delete-area delete-x" id="delete-area-'.$tmp_area_id.'">X</span>
                                </span>';
                                $j++;
                            }
                            echo '<tr>
                                    <td style="padding:10px 0px 0px 10px;"><strong>Delivery Area '.$min_id.'</strong></td>
                                    <td>
                                        <input  name="d_area'.$min_id.'" type="text"  size="50" autocomplete="off" value="'.$area_id_str.'"/>
                                        <div class="area-display-container" id="test'.$min_id.'-display">'.$area_name_str.'</div>
                                        <div>
                                            <input class="auto-suggest-input" type="text" autocomplete="off" id="test'.$min_id.'"/><br/>
                                            <div class="test-content" id="test'.$min_id.'-content"></div>
                                        </div>
                                    </td>
                                </tr>
                                <tr id="del_area-'.$min_id.'" bgcolor="#FF9933">
                                    <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area '.$min_id.'</strong></td>
                                    <td><input name="m_order'.$min_id.'" type="text" size="50" value="'.$min_order.'"></td>
                                </tr>
                                ';
                        }
                        echo '<tr>
                                    <td>
                                        <button id="add-more-del-areas">Add more</button>
                                    </td>
                                </tr>';
                    }
                    else
                    {
            ?>
                        <tr>
                            <td style="padding:10px 0px 0px 10px;"><strong>Delivery Area 1</strong></td>
                            <td>

                                <input  name="d_area1" type="text"  size="50" autocomplete="off" value=""/>
                                <div class="area-display-container" id="test1-display"></div>
                                <div>
                                    <input class="auto-suggest-input" type="text" autocomplete="off" id="test1"/><br/>
                                    <div class="test-content" id="test1-content"></div>
                                </div>
                            </td>
                        </tr>

                        <tr bgcolor="#FF9933">
                            <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 1</strong></td>
                            <td><input name="m_order1" type="text" size="50" value=""/></td>
                        </tr>
                        <tr>
                            <td style="padding:10px 0px 0px 10px;"><strong>Dilivery area 2</strong></td>
                            <td>
                                <input name="d_area2" type="text" size="50" value=""/>
                                <div class="area-display-container" id="test2-display"></div>
                                <div>
                                    <input class="auto-suggest-input" type="text" autocomplete="off" id="test2"/>
                                    <div class="test-content" id="test2-content"></div>
                                </div>
                            </td>
                        </tr>
                        <tr bgcolor="#FF9933">
                            <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 2</strong></td>
                            <td><input name="m_order2" type="text" size="50" value=""/></td>
                        </tr>
                        <tr >  
                            <td style="padding:10px 0px 0px 10px;"><strong>Dilivery area 3</strong></td>
                            <td>
                                <input name="d_area3" type="text" size="50" value=""/>
                                <div class="area-display-container" id="test3-display"></div>
                                <div>
                                    <input class="auto-suggest-input" type="text" autocomplete="off" id="test3"/><br/>
                                    <div class="test-content" id="test3-content"></div>
                                </div>
                            </td>
                        </tr>



                        <tr id="del_area-3" bgcolor="#FF9933">                  
                            <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 3</strong></td>
                            <td><input name="m_order3" type="text" size="50" value=""/></td>
                        </tr>
                        <tr>
                            <td>
                                <button id="add-more-del-areas">Add more</button>
                            </td>
                        </tr>
                <?php
                    }

                }
                else
                {    
                ?>
                    <tr>
                        <td style="padding:10px 0px 0px 10px;"><strong>Delivery Area 1</strong></td>
                        <td>

                            <input  name="d_area1" type="text"  size="50" autocomplete="off" value=""/>
                            <div class="area-display-container" id="test1-display"></div>
                            <div>
                                <input class="auto-suggest-input" type="text" autocomplete="off" id="test1"/><br/>
                                <div class="test-content" id="test1-content"></div>
                            </div>
                        </td>
                    </tr>

                    <tr bgcolor="#FF9933">
                        <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 1</strong></td>
                        <td><input name="m_order1" type="text" size="50" value="<?php //echo($rs["m_order1"]); ?>"></td>
                    </tr>
                    <tr>
                        <td style="padding:10px 0px 0px 10px;"><strong>Dilivery area 2</strong></td>
                        <td>
                            <input name="d_area2" type="text" size="50" value=""/>
                            <div class="area-display-container" id="test2-display"></div>
                            <div>
                                <input class="auto-suggest-input" type="text" autocomplete="off" id="test2"/>
                                <div class="test-content" id="test2-content"></div>
                            </div>
                        </td>
                    </tr>
                    <tr bgcolor="#FF9933">
                        <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 2</strong></td>
                        <td><input name="m_order2" type="text" size="50" value="<?php //echo($rs["m_order2"]); ?>"></td>
                    </tr>
                    <tr >  
                        <td style="padding:10px 0px 0px 10px;"><strong>Dilivery area 3</strong></td>
                        <td>
                            <input name="d_area3" type="text" size="50" value=""/>
                            <div class="area-display-container" id="test3-display"></div>
                            <div>
                                <input class="auto-suggest-input" type="text" autocomplete="off" id="test3"/><br/>
                                <div class="test-content" id="test3-content"></div>
                            </div>
                        </td>
                    </tr>



                    <tr id="del_area-3" bgcolor="#FF9933">                  
                        <td style="padding:10px 0px 0px 10px;"><strong>Dilivery charges for area 3</strong></td>
                        <td><input name="m_order3" type="text" size="50" value="<?php //echo($rs["m_order3"]); ?>"></td>
                    </tr>
                    <tr>
                        <td>
                            <button id="add-more-del-areas">Add more</button>
                        </td>
                    </tr>
                <?php 
                }
                ?>


            <tr>
                <td colspan="9" align="center" style="padding-top:5px">
                    <input type="submit" value="Save" name="btnSave" /> &nbsp;
                    <a href="#" onClick="window.close()"><input type="button" value="cancel"></a>
                </td>
            </tr>
        </form>
        </table>
        <div class="clr"></div>
    </div>
</div>
<div class="restar_bottom"></div>
</div>
<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>

<script type="text/javascript" src="cms.js"></script>
</body>
</html>

HTML 无效。

您不能在 a 中包含表单<table>但在外面<td> or <th>这是该表的一部分。

某些浏览器通过将表单移动到有效的位置(同时保留所有控件)来纠正错误。

Use 验证者 http://validator.w3.org/找到这种标记错误。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

通过 javascript 添加的输入字段不在 PHP $_POST 变量中。如何解决这个问题? 的相关文章

  • Apache、PHP 和 MySQL 可移植吗?

    我可以在外部硬盘上运行 Apache PHP 和 MySQL 吗 我需要这个 因为我在不同的地方工作 计算机 有时我没有安装和配置所有使用的应用程序 当然可以 XAMPP http www apachefriends org en xamp
  • 如何使用 Greasemonkey 监视静态 HTML 页面的更改?使用哈希?

    我希望我的 Greasemonkey 脚本仅在其访问的静态页面具有与以前完全相同的内容时运行 现在我可以设置一个包含该页面哈希的变量 我正在寻找一种动态散列页面的方法 以便我可以将我的散列与生成的散列进行比较 关于如何即时实现散列的任何想法
  • javascript 选择自定义光标 (svg)

    我正在动态地将光标更改为悬停时的本地 svg element on mouseover function this css cursor url svgs pointer svg 9 30 auto 工作正常 但我想选择该 svg 来操纵其
  • 如何通过单击链接来更改 div 的内容?

    这是我的网页的 修改后的 jsfiddle 它还有很多 而且定位是正确的 与此相反 http jsfiddle net ry0tec3p 1 http jsfiddle net ry0tec3p 1 a href class btn1 st
  • MVC 模式中的验证层

    验证模型将使用的数据的最佳位置在哪里 例如 考虑登记表 我们有一些来自注册表的数据 那么验证这些数据的最佳位置在哪里 我们应该通过 if 语句或特殊的验证器类来检查每个数据 这意味着大量的编码 所以我想了解在哪里可以做到这一点 在控制器中
  • 如何使用角度材料在具有可扩展行的表格中创建嵌套垫表

    我有以下数据 id c9d5ab1a subdomain wing domain aircraft part id c9d5ab1a info mimetype application json info dependent parent
  • onclick 事件中未调用函数

    我想在每个 YouTube 链接的末尾添加一些 HTML 以在 litebox 中打开播放器 到目前为止 这是我的代码 document ready function var valid url new RegExp youtube com
  • URL 中的 %2F 中断并且未引用所需的 .php 文件 [重复]

    这个问题在这里已经有答案了 我需要将 作为变量作为 URL 的一部分传递 我的结构如下所示 www domain com listings page 1 city Burnaby South type Townhome bedroom 2
  • 保存多对多关系,同步/附加不存在?

    我有以下两个多对多关系的模型 use Illuminate Database Eloquent Model class Permission extends Model The database table used by the mode
  • Laravel leftJoin 仅右表的最后一条记录

    我是 Laravel 的新手 我有两张桌子 1 产品 2 价格 products id product int p key name varchar prices id price int p key id product int
  • 主页(网格)上的缩略图现在显得模糊。如何纠正?

    我不知道这看起来是否愚蠢 但从早上开始我就无法纠正这个突然出现在我的博客网站上的错误www candidopinions in http www candidopinions in 我有一个网格视图模板 其中博客文章中的特色图像作为调整大小
  • Highcharts jQuery 渲染问题 - 所有浏览器

    我在尝试使用构建堆积柱形图时遇到了一个奇怪的问题高图表 http www highcharts com 当图表呈现时 在您调整浏览器大小之前 不会显示列无论如何 导致图表重绘 我认为 图表的其余部分显示 轴 标题等 但不显示列本身 我在 I
  • 使用 Enzyme 测试 `React.createRef` api

    我想测试下面的类 它使用React createRef api 不过 快速搜索并没有发现任何这样做的例子 有人成功过吗 我该如何嘲笑裁判 理想情况下我想使用shallow class Main extends React Component
  • 有没有办法使用 ko.observableArray 作为地图?

    有没有办法使用ko observableArray http knockoutjs com documentation observableArrays html像地图 字典一样 例如 var arr ko observableArray
  • php curl 使用 GET 发送变量 奇怪的结果

    我正在尝试调用远程站点上页面中的网址 决定使用curl 在远程站点上 url 变量显示为 REQUEST Array var1 gt val1 amp var2 gt val2 amp var3 gt val3 被调用的url是 http
  • react-native - 图像需要来自 JSON 的本地路径

    你好社区 我正在react native中开发一个测试应用程序 并尝试从本地存储位置获取图像 我实际在做什么 我将图像直接链接源提供给 var 并在渲染函数中调用此方法 react 0 14 8 react native 0 23 1 np
  • 如何从父类中获取子类名

    我试图在不需要子类上的函数的情况下完成此任务 这可能吗 我有一种感觉 但我真的很想确定
  • 滚动顶部不符合预期

    Note 由于上次忘记奖励而重新开放赏金 A Woff 大师已经给出答案 我想在用户展开某一行时到达该行 这样当最后一个可见行展开时 用户不必向下滚动即可查看内容 I used example tbody on click td green
  • 没有输入的 jQuery 日期选择器

    我有一个相当复杂的网络应用程序 我想向其中添加一些日期选择 UI 我遇到的问题是我无法从文档中弄清楚如何真正控制日期选择器的出现方式和时间 不涉及任何表单元素 不 我不会添加秘密表单字段 因此简单的开箱即用方法根本行不通 我希望有人可以提供
  • 一种无需 JavaScript 即可在 PHP 中确定浏览器宽度的方法?

    首先有吗 或者我必须使用javascript 我希望能够更改使用的 CSS 因此 frex 我可以为移动设备或其他设备加载较小的字体 不幸的是 仅使用 PHP 无法检测用户分辨率 如果您使用 Javascript 则可以在 cookie 中

随机推荐

  • ASP NET Core MVC - 如何配置进程外会话状态?

    有没有办法使用 ASP NET Core MVC 配置进程外会话状态 使用 Windows 状态服务器或 SQL Server 重要的是会话数据由缓存支持 您需要将 IDistributedCache 实现添加到您的应用程序服务中 而不是内
  • Html2Pdf -Codeigniter -图像未加载

    我正在使用 HTML2PDF 库作为 codeigniter See https github com aiwmedia HTML2PDF CI https github com aiwmedia HTML2PDF CI我的问题是我无法使用
  • 使用 Unity 新输入系统的多个控制器

    我正在尝试将新的 Unity 输入系统与多个控制器一起使用 我尝试为每个角色创建输入操作 但这不起作用 所有角色同时移动 看起来角色并不关心控制器 而是关心输入 而不管控制器如何 也许我需要等待输入系统的最终版本 但是 我真的不想使用旧系统
  • 将微调器添加到 ActionBar(而不是导航

    我使用答案中的第二个选项向我的 ActionBar 添加了一个微调器here https stackoverflow com questions 8312344 how to add a dropdown item on the actio
  • Visual Studio - 如何使用相同的源创建两个项目

    我的解决方案由 2 个可执行项目和几个 dll 组成 Project1 是智能设备项目 Project2 是 Windows 窗体项目 这两个项目都使用相同的库 原因是我想在将库部署到设备上之前在 PC 上测试它 问题是 DLL 项目类型可
  • 延迟作业和 Mandrill:未初始化常量 Mandrill::API

    我有邮件服务 用户可以上传包含电子邮件和其他一些用户相关数据的 xls 文件来发送电子邮件活动 我遇到了一些超时问题 因为它需要几秒钟的时间来处理 因为我对每封要发送的电子邮件进行了一些验证和配置 例如 将记录保存到数据库 检查过去 30
  • 文件类型的可可图标?

    如果我有一个文件 我可以通过执行以下操作来获取图标 NSImage iconImage NSWorkspace sharedWorkspace iconForFile myFile png 但如果我只是想获取特定文件类型的图标 例如与 pn
  • 在 Apple 平台的 AArch64 汇编中,如何在一行中编写多个语句?

    我正在将一些 Arm64 汇编语言移植到 M1 其中一些是由 C 预处理生成的 其中单个 define宏生成多个以分号分隔的语句 不幸的是 在 M1 上 汇编器将分号视为注释字符 例如 define DEFUN NAME globl NAM
  • 可选框架不起作用(CoreAudioKit 不在模拟器上)

    为了让 MIDI 通过蓝牙工作 我需要使用CoreAudioKit框架 这工作完美 但我无法在模拟器上编译 使框架 可选 没有帮助 错误是ld framework not found CoreAudioKit 我认为它应该按照the doc
  • Azure-Container-Service 中的安装卷不适用于 traefik.toml 和 /var/run/docker.sock

    构建从 VSTS 到 Azure container service 的 CI CD 管道 我在安装 traefik toml 和 docker sock 文件时遇到了问题 部署使用 SSH 隧道创建文件夹 Deploy 并复制 docke
  • C# 有异步函数调用同步函数或同步函数调用异步函数

    我正在编写一个 C Net 4 5 库 用于执行常见的 sql 数据库操作 备份 恢复 执行脚本等 我希望每个操作都具有同步和异步函数 因为控制台和 GUI 应用程序都将使用该库 但我不想到处重复代码 所以在我看来 我有两个选择 编写在同步
  • 使用 insertWithOnConflict 进行更新或插入

    我需要插入或更新 我找到了 SQLiteDatabase 的 insertWithOnConflict 方法 但我不知道它如何检查该条目是否已存在 理论上 我需要一个 Where 参数来检查某个 ID 是否存在 如果存在 它应该替换所有其他
  • .R中的第一个函数

    我不明白 R 中 First 函数的意义 我的原因是 Rprofile 中的任何代码都将在 R 启动时被获取并执行 this First lt function library devtools and this library devto
  • WordPress:如何按 ACF 自定义字段对内容进行排序?

    通过使用高级自定义字段插件 我创建了一个包含 6 种成员资格类型的选择下拉列表 我使用此自定义字段的所有 列表 都被分配为 6 个字段之一 我想通过以下方式显示所有 列表 终极加号最终的专业的商业的商业 Free 按照这个特定的顺序 那些支
  • 将 JavaScript 变量发送到 PHP 变量 [重复]

    这个问题在这里已经有答案了 首先我认为我必须将 JavaScript 转换为 PHP 但后来我发现我不能 因为服务器和客户端执行 所以现在我只想发送一个变量 到 PHP 变量 当我点击一个按钮时 JavaScript 中的该函数就会执行 现
  • Java 和 .Net 正则表达式

    Java 和 Net Framework 正则表达式模式之间的区别 我正在尝试转换我的 Net Framework 但模式无效 谁能指出正则表达式模式的主要区别 例如我们如何命名java中的分组结构等等 有很多差异总结在这里 http ww
  • 比较 C# 中的双精度值

    I ve a double变量称为x 在代码中 x被赋值为0 1我在 if 语句中检查它比较x and 0 1 if x 0 1 不幸的是它没有进入if陈述 我应该使用Double or double 这背后的原因是什么 您能为此建议一个解
  • Selenium - 无响应脚本错误 (Firefox)

    这个问题以前曾被问过 但给出的答案似乎对我不起作用 问题是 当使用 Selenium 打开页面时 我会收到许多 无响应脚本 弹出窗口 引用不同的脚本 当我使用不带 Selenium 的 Firefox 打开页面时 没有出现任何错误 另外 奇
  • 我可以通过编程方式设置 Mercurial 配置选项吗?

    我正在寻找一种设置方法 hgrc配置项 而无需实际编辑文本文件 我正在尝试标准化设置hgrc跨多个开发人员 我想要一个像这样的命令 hg config ui username foo 但这也将该配置更改保存到hgrc file 看起来这应该
  • 通过 javascript 添加的输入字段不在 PHP $_POST 变量中。如何解决这个问题?

    我在 html 表中有一个表单 我通过 jquery 动态地将输入字段添加到表单中 当我在提交表单时进行 var dump 时 POST 数组没有添加的字段 为什么会发生这种情况 这是我的 js 的样子 add more del areas