小编inp*_*put的帖子

div中的图像不显示任何内容

我正在尝试使用css和html在div容器中插入图像,但它不显示任何图像.

HTML代码:

<div id="wrapper">
<div id="quoteContainer">
 <span class="start_img"></span>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

#quoteContainer {
    color: #898989;
    background:#F9F9F9;
    border: solid 1px #ddd; 
    border-radius:10px;
    -moz-border-radius: 10px;
    -webkit-border-radius: 10px;
    box-shadow: 0px 0px 10px #888;
    -moz-box-shadow: 0px 0px 10px #888;
    -webkit-box-shadow: 0px 0px 10px #888;
    margin:65px auto;
    padding:15px;
    width:500px;

}

    .start_img {
     background: url(image/img1.png); 
     border: dotted 2px black;
     width:200px;
     height:20px;
    }
Run Code Online (Sandbox Code Playgroud)

除了img,甚至没有边界表演.我尝试<img>在html中使用标记将图像插入div中,这也不起作用.代码有什么问题吗?

html css image

2
推荐指数
1
解决办法
8531
查看次数

$ _POST没有被阅读

我有一个表格,将书籍信息插入数据库.但是它没有读取$ _POST属性.

book.php中:

  <form action="books_manage.php" id="addbook_form" method="post">

     <div id="ab_wrapper">

         <div id="ab_leftcolumn">
                 <div id="bookinfo">
                 <fieldset>
                     <legend>Book Details</legend>
                         <div class="field">
                             <label>Book ID</label>
                             <input type="text" name="bid" id="bid"/>
                         </div>
                         <div class="field">
                             <label>Name</label>
                             <input type="text" name="bname" id="bname"/>
                         </div>
                          <div class="field">
                             <label>Author</label>
                             <input type="text" name="bauthor" id="bauthor"/>
                         </div>
                          <div class="field">
                             <label>Info</label>
                             <textarea name="binfo" id="binfo" cols="5" rows="5" ></textarea>
                         </div>
                         <div class="field">
                             <label>Date Added</label>
                             <input type="text" value="<?php echo date('D d M Y')?>" name="bdateadd" id="bdateadd"/>
                         </div>
                         <div class="field">
                             <label>Date Updated</label>
                             <input type="text" value="<?php echo date("D d M Y")?>" name="bdateupd" id="bdateupd"/> …
Run Code Online (Sandbox Code Playgroud)

html php

2
推荐指数
1
解决办法
589
查看次数

检查文件是否存在,如果不存在,则创建

我如何检查使用php dom,如果存在xml文件,如果没有创建它.

<?php
    header("Location: index.php");

    $xmldoc = new DOMDocument();
    $xmldoc->load('sample.xml');
    $newAct = $_POST['activity'];

    $root = $xmldoc->firstChild;
    $newElement = $xmldoc->createElement('activity');
    $root->appendChild($newElement);
    $newText = $xmldoc->createTextNode($newAct);
    $newElement->appendChild($newText);
    $xmldoc->save('sample.xml');

?>
Run Code Online (Sandbox Code Playgroud)

现在,因为它不存在,它给了我这个错误:

DOMDocument::load(): I/O warning : failed to load external entity 
Run Code Online (Sandbox Code Playgroud)

php xml file domdocument

2
推荐指数
1
解决办法
6114
查看次数

if xml element exists, exit or skip

how do i check in xml [with php dom] that if a particular element exists, it should not repeat it. for example, if i have an element 'activity', it should check against the xml file if this element exists, and if it does, it will not create it again.

in other words, i would like to create the element 'activity' only once in the beginning, but the other elements can be recurring.

this is the php code:

<?php
    header("Location: index.php"); …
Run Code Online (Sandbox Code Playgroud)

php xml domdocument

2
推荐指数
1
解决办法
1万
查看次数

访问xsl中的xml属性

我有这个xml代码:

<title xml:lang="ar">?????</title>
<title xml:lang="en">English</title>
Run Code Online (Sandbox Code Playgroud)

我在xsl格式化:

<div class="title">
        <xsl:value-of select="root/title"/>
</div>
Run Code Online (Sandbox Code Playgroud)

然而,这^只显示阿拉伯语标题,而不是英语标题.我试过这段代码:

<div class="title">
        <xsl:attribute name="xml:lang"><xsl:value-of select="root/title"/> </xsl:attribute>
</div>
Run Code Online (Sandbox Code Playgroud)

但是使用这个^代码,它根本不显示标题.显示英语和阿拉伯语标题的正确方法是什么?

php xslt

2
推荐指数
1
解决办法
469
查看次数

将String month转换为整数java

如何将月份字符串转换为整数?

在点击方法中,我想显示所选的日期,但如果日期有事件,则应显示有关该事件的更多信息.检查假日事件的方法需要整数值.

这是代码:

更新:

@Override
public void onClick(View view)
    {
        int m = 0;
        int d, y;
        String date_month_year = (String) view.getTag();
        selectedDayMonthYearButton.setText("Selected: " + date_month_year);

        String [] dateAr = date_month_year.split("-");
        Log.d(tag, "Date Split: " + dateAr[0] + " " + dateAr[1] + " " + dateAr[2]);
        y = Integer.parseInt(dateAr[2]);



        try {
            Calendar c1 = Calendar.getInstance();
            c1.setTime(new SimpleDateFormat("MMM").parse(dateAr[1]));
            m = c1.get((Calendar.MONTH) + 1);
        } 
        catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        //int m = Integer.parseInt(dateAr[1]);
        d …
Run Code Online (Sandbox Code Playgroud)

java datetime android calendar date

2
推荐指数
1
解决办法
8025
查看次数

期望的对象 - jquery

由于jquery,由于某些奇怪的原因,我收到错误"对象预期",并且这不会"提交"表单或将数据输入数据库.

没有jquery,数据可以输入数据库.但现在却没有.

我使用jquery主要用于验证asp.net控件.


roosteronacid,验证工作完全正常,id属性也相同.提交只是没有执行服务器端代码,我无法弄清楚是什么问题.

编辑:

这是jquery代码:

 <script type="text/javascript">
        $(document).ready(function() {
            // add custom validation methods
            $.validator.addMethod('phone', function(value, el, params) {
                return this.optional(el) || /^[0-9,+,(), ,]{1,}(,[0-9]+){0,}$/.test(value);
            }, 'Please enter a valid phone number');

            $.validator.addMethod('numbers', function(value, el, params) {
                return this.optional(el) || /^[0-9]+$/.test(value);
            }, 'Invalid entry. Only Numeric is allowed.');


            $.validator.addMethod('domainurl', function(value, el, params) {
                return this.optional(el) || /^(http\:\/\/(?:www\.)?[a-zA-Z0-9]+(?:(?:\-|_)[a-zA-Z0-9]+)*(?:\.[a-zA-Z0-9]+(?:(?:\-|_)[a-zA-Z0-9]+)*)*\.[a-zA-Z]{2,4}(?:\/)?)$/.test(value);
            }, 'Please enter a valid domain url');


            $.validator.addMethod('selectone', function(value, element) {
                return this.optional(element) || (value.indexOf("none") == -1);
            }, 'Please select an option.');



            $("#form1").validate({ …
Run Code Online (Sandbox Code Playgroud)

database validation jquery object submit

1
推荐指数
1
解决办法
1万
查看次数

撇号在mysql/php中

我正在尝试学习php/mysql.

将数据插入mysql工作正常,但插入带有撇号的数据会产生错误.我尝试使用mysql_real_escape_string,但这不起作用.

非常感谢任何帮助.


<?php
include 'config.php';

echo "Connected <br />";



$auth = $_POST['author'];
$quo = $_POST['quote'];

$author = mysql_real_escape_string($auth); 
$quote = mysql_real_escape_string($quo); 


//**************************



//inserting data
$sql="INSERT INTO Quotes (vauthor, cquotes)
VALUES ($author, $quote)";

if (!mysql_query($sql,$conn))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
Run Code Online (Sandbox Code Playgroud)

...

我究竟做错了什么?

php mysql database mysql-real-escape-string apostrophe

1
推荐指数
1
解决办法
1923
查看次数

在下拉列表中连接两个字段

在sql表中有一个id,名字和姓氏字段.我想连接第一个和最后一个名称字段,并在下拉控件中将其显示为一个.

这是vb.net代码:

con()
    sqry = "[SELECT QUERY]"
    sqcom = New SqlCommand(sqry, sqcon)
    da.SelectCommand = sqcom

    ds.Clear()
    da.Fill(ds)
    ddl_adv.DataSource = ds
    ddl_adv.DataTextField = "emp_fname"
    ddl_adv.DataValueField = "emp_no"

    ddl_adv.DataBind()
    sqcon.Close()
Run Code Online (Sandbox Code Playgroud)

^此代码仅显示名字.我如何在asp.net中连接?

vb.net sql-server asp.net concatenation drop-down-menu

0
推荐指数
1
解决办法
5011
查看次数

变量声明问题

我有一个表单,我想在其中使用jQuery检索文本框中的值.问题是如果我声明这样的变量:

var bdmm = $("#bdmm").val();
Run Code Online (Sandbox Code Playgroud)

在document.ready事件中,但在函数外部,并在函数中引用它,文本值为null.但是,如果我在函数内声明它,它工作正常.为什么会这样?

JQUERY:

这将工作:

$(document).ready(function() {
        var bdmm = $("#bdmm").val();
        $('#submit').click(function(e){
                alert(bdmm);
                e.preventDefault();
        }); 
    });
Run Code Online (Sandbox Code Playgroud)

这将有效:

$(document).ready(function() {
            $('#submit').click(function(e){
                alert($("#bdmm").val());
                e.preventDefault();

                              //OR
                            var bdmm = $("#bdmm").val();
                            alert(bdmm);
                e.preventDefault();

            });
        });
Run Code Online (Sandbox Code Playgroud)

jquery

0
推荐指数
1
解决办法
241
查看次数

Months数组抛出ArrayIndexOutOfBoundException java

在我的Hijri日历应用程序中,如果我点击下个月按钮并到达年底(即上个月)或者如果我点击"上个月"按钮直到我到达年初(即第一个月) ,应用程序崩溃和抛出 java.lang.ArrayIndexOutOfBoundsException

    private ImageView calendarToJournalButton;
    private Button selectedDayMonthYearButton;
    private final String[] hmonths = {"Muharram", "Safar", "Rabi al-Awwal", "Rabi al-Akhir", "Jamadi al-Awwal", "Jamadi al-Akhir", "Rajab", "Shabaan", "Ramadhan", "Shawwal", "Zilqad", "Zilhajj"};
    private Button currentMonth;
    private ImageView prevMonth;
    private ImageView nextMonth;
    private GridView calendarView;
    private GridCellAdapter adapter;
    private Calendar _calendar;
    private int month, year, hmonth, hyear;
    private final DateFormat dateFormatter = new DateFormat();
    private static final String dateTemplate = "MMMM yyyy";
    private String hmonthname;
    private HijriCalendar hijri;

    /** Called when the activity …
Run Code Online (Sandbox Code Playgroud)

java android calendar indexoutofboundsexception

0
推荐指数
1
解决办法
722
查看次数

作为选项卡的单选按钮

我想将单选按钮显示为选项卡。遵循此codepen,我在我的项目中尝试了这一点。但是当我单击伪选项卡时,什么也没有发生。它没有得到checked

怎样才能达到效果呢?

input.tgl-radio-tab-child {
  position: absolute;
  left: -99999em;
  top: -99999em;
  opacity: 1;
  z-index: 1;
}

input.tgl-radio-tab-child+label {
  cursor: pointer;
  float: left;
  border: 1px solid #aaa;
  margin-right: -1px;
  padding: .5em 1em;
  position: relative;
}

input.tgl-radio-tab-child+label:hover {
  background-color: #eee;
}

[type=radio]:checked+label {
  background-color: #c30;
  z-index: 1;
}
Run Code Online (Sandbox Code Playgroud)
<label for="abc">ABC<span style="color: red;">*</span></label>
<div class="form-check">
  <div class="tgl-radio-tabs">
    <input type="radio" class="form-check-input tgl-radio-tab-child" name="abcorigin"><label class="radio-inline">ABCDEFGHIJKL</label>
    <input type="radio" class="form-check-input tgl-radio-tab-child" name="abcorigin"><label class="radio-inline">MNOPQRSTUVWXYZ</label>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

css

0
推荐指数
1
解决办法
7436
查看次数