1、網頁設計老師安排作業了,題目是:請在Dreamweaver中創建一個用戶注冊頁面表單或其他表單,要求至少要有:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>注冊</title>
<style type="text/css">
<!--
body{margin:a auto;padding:0; text-align:center;font-size:12px;}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
</head>
<body>
<table width="500" border="0" cellspacing="1" cellpadding="0">
<form action="" method="post" enctype="multipart/form-data" name="form">
<tr>
<td width="98" height="30" align="right" valign="middle" bgcolor="#E8E8E8">賬號:</td>
<td width="402" align="left" bgcolor="#E8E8E8"><input type="text" name="textfield" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#E8E8E8">密碼:</td>
<td align="left" bgcolor="#E8E8E8"><input type="password" name="textfield2" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#E8E8E8">重復密碼:</td>
<td align="left" bgcolor="#E8E8E8"><input type="password" name="textfield22" /></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#E8E8E8">愛好:</td>
<td align="left" bgcolor="#E8E8E8"><input type="checkbox" name="checkbox" value="checkbox" />
游泳
<input type="checkbox" name="checkbox2" value="checkbox" />
看書
<input type="checkbox" name="checkbox3" value="checkbox" />
畫畫
<input type="checkbox" name="checkbox4" value="checkbox" />
游戲
<input type="checkbox" name="checkbox5" value="checkbox" />
看電影</td>
</tr>
<tr>
<td height="100" align="right" valign="middle" bgcolor="#E8E8E8">簡介:</td>
<td align="left" bgcolor="#E8E8E8"><label>
<textarea name="textarea" cols="50" rows="6"></textarea>
</label></td>
</tr>
<tr>
<td height="30" align="right" valign="middle" bgcolor="#E8E8E8"> </td>
<td align="left" bgcolor="#E8E8E8"><input name="Submit" type="submit" onclick="MM_popupMsg('歡迎注冊')" value="提交" />
<input type="reset" name="Submit2" value="重置" /></td>
</tr>
</form>
</table>
</body>
</html>
2、html網頁設計:一個簡單的登錄界面代碼!
是這樣的效果嗎?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>3</title>
<script>
function r()
{
var username=document.getElementById("username");
var pass=document.getElementById("password");
if(username.value=="")
{
alert("請輸入用戶名");
username.focus();
return;
}
if(pass.value=="")
{
alert("請輸入密碼");
return;
}
return true;
}
</script>
</head>
<body>
<form>
<table width="350" bgcolor="#ccffcc" style="border-color" border="1">
<tr align=center>
<td>用戶名</td><td><input type="text" name="username" id="username"></td>
</tr>
<tr align=center><td>密 碼</td><td><input type="password" name="password" id="password"></td></tr>
<tr align=center><td>驗證碼</td><td><input type="text" name="yanzheng"></td></tr>
<tr align=center><td colspan="2"><input type="button" value="登 錄" onclick="r();"/> <input type="reset" value="重 置"/></td></tr>
</table>
</form>
</body>
</html>
3、HTML網頁設計:一個簡單的登錄界面可以連接到資料庫記錄的代碼
如下參考:
1.首先,在您的計算機桌面上創建一個新文件夾,然後在該文件夾中創建一個新的文本文檔。
2.然後用記事本雙擊打開文本文檔,如下圖所示,然後編寫一個簡單的HTML代碼。
3.點擊「另存為」功能選項,顯示默認的「另存為」代碼為ANSI。
4.我們將把編碼和文件名更改回圖中所示的圖像並保存它。
5.然後回到新創建的文件夾,找到一個額外的HTML文件。
6.最後,使用瀏覽器打開HTML文件。結果如圖所示。
4、在網頁設計中的用戶注冊中,出生年月日是怎麼做的?急!急!!!!
用這個js:
<script language="JavaScript">
var gdCtrl = new Object();
var SynCtl = new Object();
var goSelectTag = new Array();
var overcolor="#FF6600";
var gcGray = "#999999";
var gcToggle = "#FFFF99";
var gcBG = "#FFFFF4";
var titleBG="#3399CC";
var previousObject = null;
var oPopup = window.createPopup();
var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
function shutup(){
oPopup.hide();
}
function fSetDate(iYear, iMonth, iDay){
VicPopCal.style.visibility = "hidden";
if ((iYear == 0) && (iMonth == 0) && (iDay == 0)){
gdCtrl.value = "";
}else{
iMonth = iMonth + 100 + "";
iMonth = iMonth.substring(1);
iDay = iDay + 100 + "";
iDay = iDay.substring(1);
if(gdCtrl.tagName == "INPUT"){
gdCtrl.value = iYear+"-"+iMonth+"-"+iDay;
if(SynCtl!=null)
SynCtl.value = iYear+"-"+iMonth+"-"+iDay;
}else{
gdCtrl.innerText = iYear+"-"+iMonth+"-"+iDay;
if(SynCtl!=null)
SynCtl.innerText = iYear+"-"+iMonth+"-"+iDay;
}
}
}
function fSetSelected(aCell){
var iOffset = 0;
var iYear = parseInt(tbSelYear.value);
var iMonth = parseInt(tbSelMonth.value);
aCell.bgColor = gcBG;
with (aCell.children["cellText"]){
var iDay = parseInt(innerText);
if (color==gcGray)
iOffset = (Victor<10)?-1:1;
iMonth += iOffset;
if (iMonth<1) {
iYear--;
iMonth = 12;
}else if (iMonth>12){
iYear++;
iMonth = 1;
}
}
fSetDate(iYear, iMonth, iDay);
shutup();
}
function Point(iX, iY){
this.x = iX;
this.y = iY;
}
function fBuildCal(iYear, iMonth) {
var aMonth=new Array();
for(i=1;i<7;i++)
aMonth[i]=new Array(i);
var dCalDate=new Date(iYear, iMonth-1, 1);
var iDayOfFirst=dCalDate.getDay();
var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1;
var iDate = 1;
var iNext = 1;
for (d = 0; d < 7; d++)
aMonth[1][d] = (d<iDayOfFirst)?-(iOffsetLast+d):iDate++;
for (w = 2; w < 7; w++)
for (d = 0; d < 7; d++)
aMonth[w][d] = (iDate<=iDaysInMonth)?iDate++:-(iNext++);
return aMonth;
}
function fDrawCal(iYear, iMonth, iCellHeight, sDateTextSize) {
var WeekDay = new Array("日","一","二","三","四","五","六");
var styleTD = " bgcolor='"+titleBG+"' valign='middle' align='center' height='"+iCellHeight+"' style='font:bold "+sDateTextSize+";"; //Coded by Liming Weng(Victor Won) email:[email protected]
var styleTDBG = " bgcolor='"+gcBG+"' valign='middle' align='center' height='"+iCellHeight+"' style='font:"+sDateTextSize+";";
with (document) {
write("<tr>");
for(i=0; i<7; i++){
write("<td "+styleTD+"color:#ffffff' >"+ WeekDay[i] + "</td>");
}
write("</tr>");
for (w = 1; w < 7; w++) {
write("<tr>");
for (d = 0; d < 7; d++) {
write("<td id=calCell "+styleTDBG+"cursor:hand;' onMouseOver='this.bgColor=parent.gcToggle' onMouseOut='this.bgColor=parent.gcBG' onclick='parent.fSetSelected(this)'>");
write("<font id=cellText Victor='Liming Weng'> </font>");
write("</td>")
}
write("</tr>");
}
}
}
function fUpdateCal(iYear, iMonth) {
tbSelMonth.options[iMonth-1].selected = true;
for (i = 0; i < tbSelYear.length; i++)
if (tbSelYear.options[i].value == iYear){
tbSelYear.options[i].selected = true;
}
myMonth = fBuildCal(iYear, iMonth);
var i = 0;
for (w = 0; w < 6; w++)
for (d = 0; d < 7; d++)
with (cellText[(7*w)+d]) {
Victor = i++;
if (myMonth[w+1][d]<0) {
color = gcGray;
innerText = -myMonth[w+1][d];
}else{
color = ((d==0)||(d==6))?"#FF3300":"#009900";
innerText = myMonth[w+1][d];
}
}
updatePopup(VicPopCal.innerHTML);
}
function fSetYearMon(iYear, iMon){
tbSelMonth.options[iMon-1].selected = true;
for (i = 0; i < tbSelYear.length; i++)
if (tbSelYear.options[i].value == iYear){
tbSelYear.options[i].selected = true;
}
fUpdateCal(iYear, iMon);
}
function fGetXY(aTag){
var oTmp = aTag;
var pt = new Point(0,0);
do {
pt.x += oTmp.offsetLeft;
pt.y += oTmp.offsetTop;
oTmp = oTmp.offsetParent;
} while(oTmp.tagName!="BODY");
return pt;
}
// Main: popCtrl is the widget beyond which you want this calendar to appear;
// dateCtrl is the widget into which you want to put the selected date.
// i.e.: <input type="text" name="dc" style="text-align:center" readonly><INPUT type="button" value="V" onclick="fPopCalendar(dc,dc);return false">
function fPopCalendar(popCtrl, dateCtrl,strDate){
previousObject = popCtrl;
gdCtrl = dateCtrl;
SynCtl = strDate;
fInitialDate(strDate);
fSetYearMon(giYear, giMonth);
var point = fGetXY(popCtrl);
with (VicPopCal.style) {
left = point.x;
top = point.y+popCtrl.offsetHeight;
//width = VicPopCal.offsetWidth;
width = 206; // Added by Danian Zhang/SUI
height = VicPopCal.offsetHeight;
// visibility = 'visible';
}
updatePopup(VicPopCal.innerHTML);
var popLeft=parseInt(VicPopCal.style.left);
var popTop=parseInt(VicPopCal.style.top);
var popWidth=parseInt(VicPopCal.style.width);
var popHeight=parseInt(VicPopCal.style.height);
oPopup.show(popLeft,popTop,popWidth,popHeight,document.body);
}
function fPopSimulateCalendar(popCtrlID, dateCtrlID,strDate){
var itemID;
var popCtrl,dateCtrl;
with (document.all.tags("INPUT")){
for (i=0;i<length;i++){
if(item(i).type=="text"){
itemID=item(i).id;
if(itemID.indexOf(popCtrlID)>-1){
popCtrl=item(i);
dateCtrl=item(i);
break;
}
}
}
}
previousObject = popCtrl;
gdCtrl = dateCtrl;
SynCtl = strDate;
fInitialDate(strDate);
fSetYearMon(giYear, giMonth);
var point = fGetXY(popCtrl);
with (VicPopCal.style) {
left = point.x;
top = point.y+popCtrl.offsetHeight;
//width = VicPopCal.offsetWidth;
width = 206; // Added by Danian Zhang/SUI
height = VicPopCal.offsetHeight;
// visibility = 'visible';
}
updatePopup(VicPopCal.innerHTML);
var popLeft=parseInt(VicPopCal.style.left);
var popTop=parseInt(VicPopCal.style.top);
var popWidth=parseInt(VicPopCal.style.width);
var popHeight=parseInt(VicPopCal.style.height);
oPopup.show(popLeft,popTop,popWidth,popHeight,document.body);
}
function updatePopup(innerString){
var oPopupBody = oPopup.document.body;
oPopupBody.innerHTML =innerString;
}
// Added by Danian Zhang/SUI
function fInitialDate(strDate){
if( strDate == null || strDate.length != 10 )
return false;
var sYear = strDate.substring(0,4);
var sMonth = strDate.substring(5,7);
var sDay = strDate.substring(8,10);
if( sMonth.charAt(0) == '0' ) { sMonth = sMonth.substring(1,2); }
if( sDay.charAt(0) == '0' ) { sDay = sDay.substring(1,2); }
var nYear = parseInt(sYear );
var nMonth = parseInt(sMonth);
var nDay = parseInt(sDay );
if ( isNaN(nYear ) ) return false;
if ( isNaN(nMonth) ) return false;
if ( isNaN(nDay ) ) return false;
var arrMon = new Array(12);
arrMon[ 0] = 31; arrMon[ 1] = nYear % 4 == 0 ? 29:28;
arrMon[ 2] = 31; arrMon[ 3] = 30;
arrMon[ 4] = 31; arrMon[ 5] = 30;
arrMon[ 6] = 31; arrMon[ 7] = 31;
arrMon[ 8] = 30; arrMon[ 9] = 31;
arrMon[10] = 30; arrMon[11] = 31;
if ( nYear < 1900 || nYear > 2100 ) return false;
if ( nMonth < 1 || nMonth > 12 ) return false;
if ( nDay < 1 || nDay > arrMon[nMonth - 1] ) return false;
giYear = nYear;
giMonth = nMonth;
giDay = nDay;
return true;
}
var gMonths = new Array("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月");
with (document) {
write("<Div id='VicPopCal' onblur='parent.shutup()' style='OVERFLOW:hidden;POSITION:absolute;VISIBILITY:hidden;width:180;z-index:100;'>");
write("<table width='100%' border='1' cellpadding='0' cellspacing='0' style='background-color:#EFF7FF;border-width:1px ;border-color:#3399CC;'>");
write("<TR><TD>")
write("<table width='100%' border='0' cellpadding='0' cellspacing='0' >");
write("<TR>");
write("<td valign='middle' align='center' style='font-size:9pt;background-color:#EFF7FF' HEIGHT='28'>");
write("<SELECT name='tbSelYear' onChange='parent.fUpdateCal(tbSelYear.value, tbSelMonth.value)' style='width:80' Victor='Won'>");
for(i=1900;i<2050;i++)
write("<OPTION value='"+i+"'>"+i+" 年</OPTION>");
write("</SELECT>");
write(" <select name='tbSelMonth' onChange='parent.fUpdateCal(tbSelYear.value, tbSelMonth.value)' style='width:80' Victor='Won'>");
for (i=0; i<12; i++)
write("<option value='"+(i+1)+"'>"+gMonths[i]+"</option>");
write("</SELECT>");
write("</td>");
write("</TR><TR>");
write("<td align='center'>");
write("<table width='95%' border='1' cellspacing='0' cellpadding='0' bordercolordark='#639ace' bodercolorlight='#ffffff'>");
fDrawCal(giYear, giMonth, 20, '9pt');
write("</table>");
write("</td>");
write("</TR><TR><TD align='center'>");
write("<TABLE width='98%'><TR><TD nowrap align='center' HEIGHT='25'>");
write("<span style='cursor:hand;font-size:9pt' onclick='parent.fSetDate(0,0,0)' onMouseOver='this.style.color=parent.overcolor' onMouseOut='this.style.color=0'>清空</span>");
write("</td><td algin='center' HEIGHT='25'>");
write("<span style='cursor:hand;font-size:9pt' onclick='parent.fSetDate("+giYear+","+giMonth+","+giDay+")' onMouseOver='this.style.color=parent.overcolor' onMouseOut='this.style.color=0'> 今天: "+giYear+"-"+giMonth+"-"+giDay+"</span></td>");
write("<td nowrap HEIGHT='25'><span style='cursor:hand;font-size:9pt' onMouseOver='this.style.color=parent.overcolor' onMouseOut='this.style.color=0' onclick='parent.shutup()'>關閉</span></td></tr></table>");
write("</TD></TR>");
write("</TABLE></TD></TR></TABLE></Div>");
}
</script>
添加一個按鈕:
<button onclick="fPopCalendar(invalidateDate,invalidateDate);return false" name="button" type="button">q</button>
invalidateDate為變數可任意命名
我這js都寫的這么明白了!你還不知道怎麼弄啊?
5、動態網頁設計注冊頁面
單用html語言解決不了,必須用與之相配套的語言,如javascript,asp.php,vb,java等等。。。
6、有沒有網頁設計大作業要求有div+css+js,要有注冊登錄界面?
自己這五年來做了有100多套網頁設計的學生作業,因為都是給學生定製的都符合學校或者學生考試期末作業的水平,都是div+css框架原創代碼寫的,有的有js,有的視頻音樂flash的等元素的插入,各種風格主題如風景、校園、美食、動漫、lol、咖啡、民航等等主題,我都共享在大設計師論壇,需要的可以去兔費下,裡面的每個頁面我都有截圖,像這種有注冊有登錄很基礎的表單,大部分作業都會有這一部分,你可以看一下截圖再決定下載哪一個。
7、你會做網頁設計登錄與注冊頁面嗎?
這個其實蠻簡單 也是WEB中最基礎的東西
1.就是在SQLSERVER中建立表 來保存用戶名和密碼之類的信息。
2.信息獲取的話 無非就是兩個textbox,把密碼的那個textbox的「type」屬性改為「password」
3.創建資料庫鏈接字元串 然後 sqlconnection --接著編寫SQL查詢語句--最後--sqlcommand。
4.這里我的方法是 用sqlcommand的Executereader方法來獲取一個 datatable "dt".
然後來判斷 dt的dt.rows.count屬性是否大於0 如果大於0 則證明用戶名與密碼正確的了。 (即這行記錄存在於表中)
前提是 你的SQL語句 必須這么寫
select * from "保存用戶信息的表" where textbox1.text=username and textbox2.text=password