
23-10-2007, 13:10
|
|
|
|
חבר מתאריך: 14.04.07
הודעות: 9
|
|
יש לי בעיה במסד נתונים עזרה בבקשה
זה הטופס:
[html]
<html dir=rtl>
<title>טופס הרשמה לחברי הגאלה</title>
<head>
<script>
var ok = 0;
function checkName()
{ var Nam = window.document.gala1.name_f.value;
if (Nam.length <2)
{ alert("חובה לכתוב שם פרטי ");
ok = 1;
}
}
function checkName1()
{ var Nam1 = window.document.gala1.name_l.value;
if (Nam1.length <2)
{ alert("חובה לכתוב שם משפחה");
ok = 1;
}
}
function checkCity()
{ var cit = window.document.gala1.city.value;
if (cit.length <2)
{ alert("חובה לרשום עיר מגורים");
ok = 1;
}
}
function checkage()
{ var ag = window.document.gala1.age.value;
if (ag.length <2)
{ alert("חובה לרשום גיל");
ok = 1;
}
// check if age not good
if (ag < 15 || ag > 18)
{ alert("אתה לא בגיל המתאים");
ok =1;
}
// check if all numbers
if (isNaN(ag))
{ ok = 1;
alert("הגיל חייב להיות במספרים");
}
}
function checknumber()
{ var num = window.document.gala1.number.value;
if (isNaN(num))
{ ok = 1;
alert("מספר חייב להכיל רק ספרות");
}
// check if 7 numbers
if (num.length !=7)
{ ok = 1;
alert("מספר הפלאפון לא תקין");
}
}
function testForm()
{ checkName();
checkName1();
checkCity();
checkage();
checknumber();
if (ok == 0)
{ alert("ברגע זה אתה חלק ממשפחת הגאלה\n נתונים מולאו כנדרש");
return (true); }
else
{ return (false); }
}
</script>
</head>
<body bgcolor="green">
<p align="center"><font size="7"> </font></p>
<table>
<tr>
<td>
<form name="gala1" action="insert_gala.asp" method="post" onSubmit="return testForm()">
שם פרטי
</td>
<td>
<input type="text" name="name_f"/>
</td>
</tr>
<tr>
<td>
שם משפחה
</td>
<td>
<input type="text" name="name_l"/>
</td>
</tr>
<tr>
<td>
עיר
</td>
<td>
<input type="text" name="city"/>
</td>
</tr>
<tr>
<td>
גיל
</td>
<td>
<input type="text" name="age"/>
</td>
</tr>
<tr>
<td>
מספר פלאפון
</td>
<td>
<input type="text" name="number"/>
<select name="numb">
<option>052</option>
<option>054</option>
<option>050</option>
<option>057</option>
</td>
</tr>
</table><br/><br/>
<input type="submit" value="שלח"/>
<input type="reset" value="נקה" />
</form>
<a href = "login.htm"> צפה במאגר הרשומים </a> </br></br>
</body>
</html>[/html]
זה האינסרט
[html]
<%
name_f=request.form ("name_f")
name_l=request.form ("name_l")
city=request.form ("city")
age=request.form ("age")
number=request.form ("number")
numb=request.form ("numb")
set con=server.createobject ("ADODB.connection")
path= server.mappath ("data/gala_team.mdb")
con.open "driver={Microsoft Access Driver (*.mdb)}; DBQ=" &path&";"
sql = "SELECT * FROM gala_f WHERE name_f='"&name_f&"'"
set rs = con.Execute(sql)
if rs.BOF and rs.EOF then
mysql="insert into gala_f(name_f, name_l, city, age, number, numb) values ('"&name_f&"','"&name_l&"','"&city&"',"&age&","&number&","&numb&")"
con.execute mysql
%>
<html>
<body bgcolor="#ffff66">
<p align="center">
הצטרפת למשפחת הגאלה בקרוב ישלח אלייך אימייל עם פרטים
<br/><br/><br/><br/>
<table bgcolor="#a9a9a9" align="center">
<tr>
<td>
<a href="'www.walla.co.il"> <font size="5"><b>חזרה</b></font></a>
</td>
</tr>
</table>
</p>
</body>
</html>
<%
else
%>
<html>
<body bgcolor="#ffff66">
<p align="center">
השם כבר קיים במערכת
<br/><br/><br/><br/>
<table bgcolor="#a9a9a9" align="center">
<tr>
<td>
<a href="tofes.htm"> <font size="5"><b>חזרה</b></font></a>
</td>
</tr>
</table>
</p>
</body>
</html>
<%
con.close
set con=nothing
end if
%>[/html]
בבקשה עזרו לי
|