2014-02-24 91 views
1

http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_color上有一個演示文件,在源代碼中有一個「demo_form.asp」文件。如何用asp獲取顏色值

誰能告訴我這個asp文件的源代碼是什麼?如果這個asp文件也可能是php版本。

+0

看起來在這個asp文件中沒有什麼重要。你甚至可以提交空白表格或任何值。是的,大部分來自ASP可以轉換爲PHP。 – Zam

+0

@Lankymart我只想學習如何使用html5的「顏色」輸入類型來獲取顏色的值。 –

+0

@WhoCares就像任何其他表單請求一樣,您將獲得任何輸入類型。在asp中,如果您使用'GET',則使用'Request.QueryString(「您的輸入名稱」)''或'POST '使用'Request.Form(「你的輸入名稱」)''。 – Lankymart

回答

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'] ?> 
+0

php部分不工作..它只是白色的空白頁... –

+0

我不是PHP的專家,但據我所知,這是等效的語法。 – Lankymart

+0

@WhoCares您的調用頁面中是否包含名爲「favcolor」的'input type =「color」'?我已將我的回答置於您關聯的w3schools頁面上。 – Lankymart