עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

2 בעיות ב ASP

Featured Replies

פורסם

שלום אנשים,

יש לי 2 שאלות.

1) אני עובד עם בסיס נתונים של ACCESS. הגנתי עליו עם סיסמא דרך ACCESS. איך אני פותח אותו באמצעות קוד ASP (וי בי סקריפט), איך אני יוצר CONNECTION שפותח את מסד הנתונים עם הסיסמא? מה לכתוב בתוך מחרוזת ה Connection.Open "..." ?

2)

אני מבצע שמירה של 2 משתנים באמצעות COOKIES:

Response.Cookies("UserName")=Request.Form("user")

Response.Cookies("Pass")=Request.Form("pass")

אבל הם לא נשמרים במערכת =/

Request.Cookies("UserName") ו-

Request.Cookies("Pass")

הופכים למחרוזות ריקות בפעם הבאה שאני מריץ את העמוד...!

הקוד המלא של כל העמוד מצורף להלן:



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>ëðéñú îùúîùéí</title>

<!-- ENABLE CORRECT HEBREW -->
<meta http-equiv="Content-Language" content="he">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">

<!-- File for handling coding/decoding of user's passwords -->
<!--#include file="Encoding.asp"-->

<script language="javascript">

function CheckForm(form)
{
if ((form.user.length==0) &&
(form.pass.length==0))
{
alert("ãàâ ùùí äîùúîù åäñéñîà éäéå îìàéí áá÷ùä" + "\n");
}
else
{
form.submit();
}
}

</script>

<%
function Login()

dim style
style=" style='width: 150; color: #FFFFFF; font-weight: bold; border: 3px solid #FFFFFF; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px; background-color: #660099'"
%>
<h1 align="center" style="color: white;">ëðéñú îùúîù ìôåøåí</h1>
<%
Response.Write("KMO: " & Request.Cookies("UserName") & Request.Cookies("Pass"))
If Request.Form("user")<>"" Then 'A USER AND PASS ENTERED !
set objConnection = server.createobject ("ADODB.Connection")
objConnection.open "PROVIDER=Microsoft.Jet.OLEDB.4.0; DATA SOURCE=" & Server.MapPath (".") & "\db.mdb"

SQL="SELECT NickName,Pass FROM tblUsers WHERE NickName='" & Request.Form("user") & "'"

set Rs = objConnection.execute(SQL)

If not Rs.bof Then
If Rs.Fields("Pass")=Encode(Request.Form("Pass")) Then
Session("UserName")=Request.Form("user")
If Request.Form("saveCookie")="on" Then
Response.Cookies("UserName")=Request.Form("user")
Response.Cookies("Pass")=Request.Form("pass")
End If
Response.Redirect "UserPanel.asp"
Else
Response.Write("<center><font color='red'><b>ñéñîà ùâåééä</b></font></center>")
End If
Else
Response.Write("<center><font color='red'><b>ùí îùúîù ùâåé</b></font></center>")
End If
End If
%>
<form name="login" action="index.asp" method="post" onsubmit="return CheckForm(this);">
<table align="center" border='0'>
<tr>
<td align="center" valign="middle" background='userboxbg.gif' height="227" width="305">
<font color="white">
<input name="user" type="text" maxlength="12" value='<%=Request.Cookies("UserName")%>' <%=style%>> ùí îùúîù <br/>
<input name="pass" type="password" maxlength="12" value='<%=Request.Cookies("Pass")%>' <%=style%>> ñéñîà         <br/><br/>
ùîåø îùúîù åñéñîà <input type="checkbox" name="saveCookie"> <br/><br/>
<img src='send.gif' onclick='CheckForm(document.login);'>
</font>
</td>
</tr>
</table>
</form>
<%
end function
%>

</head>
<body bgcolor="#000099">

<% If Session("UserName")<>"" Then
Response.Redirect "UserPanel.asp"
Else
call Login()
End If %>

</body>
</html>


תודה לכל מי שינסה לעזור ולכל מי שיעזור :)

פורסם

אתה צריך גם להגדיר את תאריך התפוגה של העוגיות, כי אם אני לא טועה, נראה לי שהוא מוחק אותם כשאתה יוצא מהדפדפן אם אתה לא קובע תאריך(ושעה) תפוגה.

פורסם
  • מחבר

אתה צריך גם להגדיר את תאריך התפוגה של העוגיות, כי אם אני לא טועה, נראה לי שהוא מוחק אותם כשאתה יוצא מהדפדפן אם אתה לא קובע תאריך(ושעה) תפוגה.

צודק, המון תודה :-)

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.