הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   בעיה בבדיקות תקינות (https://hosts.co.il/forums/showthread.php?t=63846)

typhoonil 06-06-08 15:27

בעיה בבדיקות תקינות
 
קוד:

<%
 if session("adminCheck")<>"true" then
 response.write "כניסה למורשים בלבד!"
else
sq="select*from personal_data where (firstname='"&session ("f")&"' and passa='"&session ("p")&"')"
        path=Server.mappath("data/db1.mdb")
       
        set con= Server.createobject("ADODB.Connection")
     
        con.mode=3       
   
          con.open "Provider=Microsoft.Jet.OLEDB.4.0;data source=" &path
 
        set R=con.execute(sq)
        if R.eof then
                response.write "אירעה שגיאה"
else
%>
<html>
<head>
        <script language="javascript">

                function test(x)

                {

                        if (x.firstname.value=="")

                        {

                                alert ("חסר שם פרטי");
       
                                x.firstname.focus();

                                x.firstname.select();

                                return false;

                        }
// -------------------------------------------------

                        if (x.familyname.value=="")

                        {

                                alert ("חסר שם  משפחה");

                                x.familyname.focus();

                                x.familyname.select();

                                return false;

                        }
// -------------------------------------------------
                        if (x.namestreet.value=="")

                        {

                                alert ("חסר שם רחוב");

                                x.namestreet.focus();

                                x.namestreet.select();

                                return false;

                        }
// -------------------------------------------------
                        if (x.numhome.value=="")

                        {

                                alert ("חסר מספר בית");

                                x.numhome.focus();

                                x.numhome.select();

                                return false;

                        }
// -------------------------------------------------
                        if (onlydigits(x.numhome.value)==false)

                        {

                                alert ("מספר הבית לא תקין");

                                alert ("מספר בית צריך להכיל ספרות בלבד");
                                x.numhome.focus();

                                x.numhome.select();

                                return false;

                        }
// -------------------------------------------------


                        if (x.passa.value=="")

                        {

                                alert ("חסר סיסמה");

                                x.passa.focus();

                                x.passa.select();

                                return false;

                        }
// -------------------------------------------------

                        if (x.passa.value.length<6)

                        {

                        alert ("סיסמה חייבת להכיל שישה תווים לפחות");

                        x.passa.focus();

                        x.passa.select();
                        return false;

                        }
// -------------------------------------------------

                        if (x.passb.value=="")

                        {

                                alert ("חזור על סיסמתך פעמים");

                                x.passb.focus();

                                x.passb.select();

                                return false;

                        }
// -------------------------------------------------

                        if (x.passa.value!=x.passb.value)
                        {

                                alert ("סיסמאות לא תואמות!");
                                x.passa.focus();

                                x.passa.value="";

                                x.passb.value="";

                                return false;
                        }
// -------------------------------------------------


                        if ((x.gender[0].checked==false) && (x.gender[1].checked==false))
                        {
                                window.alert("מין לא נבחר");
                                return false;
                        }
// -------------------------------------------------
                        if (x.email.value=="")

                        {

                                alert ("חובה לכתוב כתובת אימייל");

                                x.email.focus();

                                x.email.select();

                                return false;

                        }
// -------------------------------------------------

                        if (x.email.value.indexOf("@")<1)
                        {
                                window.alert("כתובת האימייל לא תקינה");
                                x.email.focus();
                                x.email.select();
                                return false;
                        }
                        if (x.email.value.indexOf(".")<1)
                        {
                                window.alert("כתובת האימייל לא תקינה");
                                x.email.focus();
                                x.email.select();
                                return false;
                        }
// -------------------------------------------------
                        i=0;
                        asur="!$<>{}[]|*&^%";
                        flag=true;
                        a=x.email.value.indexOf(asur.charAt(i));
                        while ((i<=asur.length) && (flag==true))
                        {
                        if (a!=-1)
                                {
                                window.alert("כתובת האימייל לא תקינה");
                                x.email.focus();
                                x.email.select();
                                flag=false;
                                }

                                i++;
                        }
// -------------------------------------------------
                        if (flag==false)
                        {
                                return false;
                        }
// -------------------------------------------------
                        if  ((x.email.value.split("@").length)!=2)
                        {
                                window.alert("כתובת האימייל חייבת להכיל שטרודל אחד בלבד");
                                x.email.focus();
                                x.email.select();
                                return false;
                        }
// -------------------------------------------------
                        if (x.emaila.value=="")

                        {

                                alert ("חזור על כתובת האימייל שלך פעמיים");

                                x.emaila.focus();

                                x.emaila.select();

                                return false;

                        }
// -------------------------------------------------

                        if (x.email.value!=x.emaila.value)
                        {

                                alert ("כתובות האימייל לא תואמות!");
                                x.email.focus();

                                x.emaila.value="";

                                x.emaila.value="";

                                return false;
                        }
// -------------------------------------------------

                        return true;  // אם הבדיקה הגיעה עד כאן - סימן שהכל תקין

                    }

        </script>


 </head>
<body background="images\850.gif" dir="rtl">
<h2> עדכון פרטי משתמש </h2>
<form action="update.asp" method="post" name="myform" onsubmit="return test(myform)">
<table>
<tr>
<td> תעודת זהות: </td>
<td>
<input type="text" name="id"  readonly="readonly" value="<%=R.fields("id")%>"
</tr>
<tr>
<td> שם: </td>
<td> <input name="firstname" value="<%=r.fields("firstname")%>"> </td>
</tr>
<tr> <td> שם משפחה: </td> </td>
<td> <input name="familyname" value="<%=r.fields("familyname")%>"> </td> </tr>
<tr>
<td colspan="2">
<input type="radio" value="זכר" name="gender"
<%if r.fields("gender")="זכר" then response.write "checked"%>> זכר
<input type="radio" value="נקבה" name="gender"
<%if r.fields("gender")="נקבה" then response.write "checked"%>> נקבה
</td>
</tr>
<tr>
<td> רחוב </td>
<td> <input name="namestreet" value="<%=r.fields("namestreet") %>"> </td>
<td> מס' הבית </td>
<td> <input name="numhome" value="<%=r.fields("numhome") %>"> </td>
</tr>
<tr>
<td> סיסמא </td>
<td> <input name="passa" value="<%=r.fields("passa") %>"> </td>
<td> אימות סיסמא </td>
<td> <input name="passb" value="<%=r.fields("passb") %>"> </td>
<tr>
<td> דוא"ל </td>
<td> <input name="email" value="<%=r.fields("email") %>"> </td>
<td> אימות אימייל </td>
<td> <input name="emaila" value="<%=r.fields("emaila") %>"> </td>
</tr>
<td align="left" colspan="2">
<td align="left" colspan="2"> <input type="submit" value="עדכן">
</td>
</tr> </table> </form>
</body>
</html>
<%
 end if
end if
%>

הבעיה היא שלמרות שאני לא מכניס סיסמא או אימייל הדף עדיין יתעדכן הבעיה כאן היא בשדות האמייל והסיסמא כל השאר פועל


כל הזמנים הם GMT +2. הזמן כעת הוא 00:23.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ