小编era*_*s77的帖子

PHP 的方括号:什么时候加引号,什么时候不加?

<html>
<head><title></title></head>
<body>
<?php
if (isset ($_POST['posted'])) {
if ($_POST['question1'] == "Lisbon") {
  echo "You are correct, $_POST[question1] is the right answer<hr>";
}

if ($_POST['question1'] != "Lisbon") {
  echo "You are incorrect, $_POST[question1] is not. the right answer<hr>";
}
}
?>
<form method="POST" action="quiz.php">
<input type="hidden" name="posted" value="true">
What is the capital of Portugal?
<br>
<br>
<input name=''question1" type=''radio" value=''Porto''>
Porto
<br>
<input name=''question1" type="radio" value=''Lisbon''>
Lisbon
<br>
<input name="question1" type="radio" value=''Madrid''>
Madrid
<br>
<br>
<input type=''submit''>
</form>
</body>
</html> …
Run Code Online (Sandbox Code Playgroud)

php variables quotes post brackets

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

将函数参数传递给getElementById“ id”

这是一个js函数,当您从选择框中选择合适的值时,它会显示各种文本输入形式。

function arata_formular(formular) {
            document.getElementById("formular").style.visibility = "visible";
            if(document.getElementById("formular").style.display == "none" ) {
                document.getElementById("formular").style.display = "inline";
            }
            else {
                document.getElementById("formular").style.display = "visible";
            }
        }
Run Code Online (Sandbox Code Playgroud)

但是不能按预期工作。尽管它有一个参数,无论我要传递给它什么(让我们说arata_formular(entropy),它仍然会寻找“形式”的id而不是“熵”。我怎样才能使“ inline”插入?

不幸的是,我不能在此框架或其他框架上使用jquery。我必须只使用javascript。谢谢!

javascript arguments function getelementbyid

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

JSF和图书馆Unclarity

在花了一些时间用于servlet和JSP之后,我正在尝试学习一些关于JSF的东西.我已经学习了基础知识,做了几个简单的例子,有一个基本的"工作流程"概念,但我仍然无法理解javax.faces.webapp.FacesServlet的用途.

<servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
  </servlet>
<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
Run Code Online (Sandbox Code Playgroud)

我知道"Faces Servlet"它只是一个"内部"名称,仅用于XML并且它与一个类绑定,在这种情况下:javax.faces.webapp.FacesServlet.但是这个班级到底在哪里?!我正在使用Eclipse,创建了一个新的动态项目,GlassFish 4.0作为服务器,JSF 2.0作为配置(选择了没有库),我也没有导入任何jar.它怎么样?当我尝试用JBoss运行相同的东西时,我必须导入一个javax.faces-2.2.2.jar文件.

好吧,该库可能已经包含在GlassFish中,因为它可以工作但是......如果我尝试在另一台服务器上部署我的应用程序,我会遇到任何问题吗?像JBoss或Websphere.

简而言之:使用JSF技术时的先决条件是什么:)

谢谢.

java eclipse jsf

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

在C中的字符串中输出变量内容

在C++中,我执行以下操作:

cout<<"a["<<i+1<<",<<"j+1<<"]= "; cin>>a[i][j]; 
Run Code Online (Sandbox Code Playgroud)

(显示:"a [1] [1] ="并获取[0] [0]的输入;基本上i + 1只是查看器的一个技巧,因为我想使用0中的数组而不是1那不是重点).

如何使用printf和scanf在C中完成此操作?显然C不喜欢

printf("a["<<i+1<<","<<j+1<<"]= "); scanf("%d", a[i][j]);
Run Code Online (Sandbox Code Playgroud)

基本上,什么相当于

<<i+1<< 
Run Code Online (Sandbox Code Playgroud)

在C语言?

c string variables output

-4
推荐指数
1
解决办法
106
查看次数