热狗进~

灵魂征战

新手上路
注册
2009-07-15
消息
323
荣誉分数
4
声望点数
0
所在地
二次元
Create an external cascading stylesheet that all pages will link to specifying:

i. Body with the font Verdana, second choice of Arial, third choice sans serif;
ii. Body background color of your choice (or background image);
iii. Hover effect for hyperlinks.
Any presentational tags/attributes (for example, font tag and bgcolor attribute) should be replaced with
appropriate styles.

Forms and PHP
Design HTML forms for accepting user input. The forms should be database driven i.e. submitting the
forms will initiate database interaction.

i. Query form: it is used to process queries about products. The form should be linked to the
database and retrieve product information based on the criteria selected by the user. For
example, show all products which cost less than $100.00.

ii. Contact form: The form will allow the user to join the mailing list. The form should have
appropriate controls to obtain the following information:
Firstname
Last name
Email address
Male or Female
There should be an option to view all subscribers to the mailing list.


做的大概差不多了..想问下hover的设定是否应该加在css里面呢.
如果说要做一个鼠标停留时链接字体放大该怎么弄.具体不知道命令该加在哪里.

query form完全不会:(

contact form都做完了.问题是submit和reset两个命令无法达到效果.
还有最后说view all mailing list不知道该怎么上传填完的表格.

最后就是这两个form里都要有适当的java script=.=

求狗哥解答..
 
a {font-family:Verdana,Arial; font-size:large}
a:link {color:blue;}
a:visited {color: #660066;}
a:hover {text-decoration: none; color: #ff9900;font-weight:bold;} <--------改这个就好了
a:active {color: red;text-decoration: none}
 
建立2个文件
一个html叫queryform.html
一个php叫myquery.php

queryform的html内容
<html>
<head><title>my query form</title></head>
<body>
<form action="myquery.php" method="post">
Show product with cost less than:<input name="cost" value="100" size="10" type="text"><br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>

php的内容
<?php
if (isset($_POST['submit'])) {
$cost = $_POST['cost'];
$conn = mysql_connect("localhost","用户名","密码");
mysql_select_db("数据库名字", $conn); //你最好事先确定一下数据库+table里头有内容
$query = "SELECT * FROM product WHERE cost < '$cost'";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { print "简单的打印里头的内容例如 Name:".$row{'product_name'}."<br />"; }
mysql_close($conn); }

?>
 
狗哥太威武了!!三楼的是query的吧.
那最后那个呢?要能够submit然后看submit的mailing list
 
Contact form的内容,你们老师没有要求用数据库的话,直接把3个内容都写在cookie里头就可以用蜡. 设置一个separator然后使用document.cookie.split(separator);来做不就好了。
要2个separator,一个给mail list里头的每一个用户,另外一个用来分隔需要的4种inputs

如果要数据库的话,把contact form跟queryform的方法结合起来就好了。

用insert数据到数据库的话
可以用这个例子

<?php
if (isset($_POST['submit'])) {
$firstname = $_POST['firstname '];
$lastname = $_POST['lastname '];
$email = $_POST['email '];
$gender = $_POST['gender '];
$conn = mysql_connect("localhost","用户名","密码");
mysql_select_db("数据库名字", $conn); //你最好事先确定一下数据库+table存在
//假设你的maillist table的结构是
//firstname text
//lastname text
//email text
//gender text
if (mysql_query("insert into maillist values('$firstname','$lastname','$email','$gender ')")) {
print "successfully inserted";
}
else {
print "Failed to insert data entry";
}
mysql_close($conn); }

?>
 
INSERT, SELECT 你们老师都讲数据库了,应该讲过吧,翻一下书吧
 
INSERT, SELECT 你们老师都讲数据库了,应该讲过吧,翻一下书吧


谢谢啦.等下再去试试.搞了两天有点晕.
lecture notes东西奇少无比,这课又没有书
所以才来问你的..:(
但愿我最后考试能过吧..
 
我五体投地, 你俩在游戏版讨论这么技术的又跟游戏无关的东西……
 
后退
顶部