【问题标题】:How to get color value with asp如何用asp获取颜色值
【发布时间】:2014-03-26 04:25:05
【问题描述】:

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_color 上有一个演示文件,在源代码中有一个“demo_form.asp”文件。

谁能告诉我这个asp文件的源代码是什么?如果有可能还有这个 asp 文件的 php 版本。

【问题讨论】:

  • 在这个 asp 文件中看起来没什么重要的。您甚至可以提交空表单或任何值的表单。是的,大多数来自 ASP 的都可以转换为 PHP。
  • @Lankymart 我只是想学习如何使用 html5 的“颜色”输入类型获取颜色的值..
  • @WhoCares 就像任何其他表单请求一样,您将获得任何输入类型。在 asp 中它是Request("name of the input")(检查GETPOST)如果你使用GET 使用Request.QueryString("name of your input")POST 使用Request.Form("name of your input")

标签: html input asp-classic colors


【解决方案1】:

如果我猜的话,我会说是这样的;

<html>
<body>
<h3>Input was received as:</h3>
<h3>
favcolor=<%= Request.QueryString("favcolor") %>
</h3>

<p>This page was returned to you from the server. The server has processed your input and returned this answer.</p>
<p>It is not a part of the HTML5 tutorial to teach you how the server is processing this input. If you want to learn more about processing form input, please read our 
PHP or ASP tutorial.</p>   
<p>Use the back button in the browser to return to the example.</p>

</body>
</html>

你可以用代替

favcolor=<?php $_GET['favcolor'] ?>

【讨论】:

  • 我不是 php 专家,但据我所知,这是等效的语法。
  • @WhoCares 您的 input type="color" 在您的呼叫页面中被命名为“favcolor”吗?我的答案基于您链接的 w3schools 页面。
  • @WhoCares 你的网络服务器上是否配置了php
  • 我使用完全相同的 html 文件来调用这个 php 文件。是的,我在 localhost 上安装了 apache,所以我必须有这个 asp 文件的 .php 文件。实际上 asp 部分就足够了,但我和你想的一样,但它没有用。
  • @WhoCares 你有没有设法输出一些简单的 php 来测试你的 apache 服务器是否配置正确?试试&lt;?php phpinfo(); ?&gt; 之类的简单方法,这行得通吗?这也可能有帮助 - PHP site keeps opening to blank page, no errors
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-07-15
  • 2019-11-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-09-07
  • 2021-11-07
相关资源
最近更新 更多