Mohammad Minaei
جمعه 28 اسفند 1383, 21:30 عصر
<span dir=ltr>سلام دوستان.
دارم نیوز برد می سازم. :mrgreen: اما مشکل دارم. در بخش اضافه کردن خبر جدید.
ببینید:
متن فایل addnews.asp:
<%
'Our login protection code
If Session("BlnLoggedIn") <> True Then
Response.Redirect("login.asp")
End If
response.charset="utf-8"
%>
<html dir="rtl">
<head>
<title>اضافه کردن خبر</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
</head>
<body text="#666666" background="images/back.gif" style="font-family: Tahoma; font-size: 10pt; color: #666666">
<!--#include file="admin_navigation.asp" -->
<div align='center'>
<form name="form" method="post" action="insert_news.asp">
<br>
<table width="377">
<tr>
<td width="51"> <font size="2">نام خبر: </font>
</td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsNamed" maxlength="50" size="32"></font><font size="2">
</font>
</td>
</tr>
<tr>
<td width="51"> <font size="2">توضیح کوتاه:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsDesd" size="32"></font></td>
</tr>
<tr>
<td width="51"> <font size="2">نویسنده:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsAuthord" size="32"></font></td>
</tr>
<tr>
<td width="51"> <font size="2">آدرس تصاویر:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsPicd" size="57"></font></td>
</tr>
<tr>
<td> <font size="2">متن خبر:</font></td>
<td>
<font face="Tahoma">
<textarea name="NewsTextd" cols="35" rows="7"></textarea></font><font size="2">
</font>
</td>
</tr>
<tr>
<td height="32" colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit" dir="rtl" style="font-family: Tahoma; font-size: 10pt; color: #666666"><font size="2">
</font>
<input type="reset" name="reset" value="از نو" dir="rtl" style="font-family: Tahoma; font-size: 10pt; color: #666666"><font size="2">
</font>
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
متن فایل insert_news.asp:
<%@ Language="VBScript" %>
<% Option Explicit %>
<%
'Our login protection code
If Session("BlnLoggedIn") <> True Then
Response.Redirect("login.asp")
End If
response.charset="utf-8"
%>
<html dir="rtl">
<head><title>News Management System - News Added</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
</head>
<body>
<!--#include file="admin_navigation.asp" -->
<%
Dim Connection, sConnString
Dim headline, news, thedate, SQL
Dim NewsDate
Dim NewsPic
Dim NewsText
Dim NewsAuthor
Dim NewsDes
Dim NewsName
NewsName=request.form("NewsNamed")
NewsDes=request.form("NewsDesd")
NewsAuthor=request.form("NewsAuthord")
NewsText=request.form("NewsTextd")
NewsPic=request.form("NewsPicd")
NewsDate=Date()
SQL = "INSERT INTO News(Name,Des,Text,Author,Pic_location) Values " & _
"( '" & NewsName & "', '" & NewsDes & "', '" & NewsText & "' , '" & NewsAuthor & "', '" & NewsPic & "')"
Set Connection = Server.CreateObject("ADODB.Connection")
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("databases\maindata.mdb")
Connection.Open(sConnString)
Connection.execute(SQL)
connection.Close
Set connection = Nothing
response.write "<br><div align='center'>خبر جدید اضافه شد.</div>"
%>
</body>
</html></span>
ارور:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/so/insert_news.asp, line 44
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Page:
POST 89 bytes to /so/insert_news.asp
POST Data:
NewsNamed=white&NewsDesd=black&NewsAuthord=test&Ne wsPicd=tar&NewsTextd=jhdsbf&Submit=Submit
کمک کنید دیگه!!!
*** اصلاح شد ***
*** دوست عزیز به هنگام ارسال کد از تگ مربوطه استفاده کنید ***
*** مسعود ***
دارم نیوز برد می سازم. :mrgreen: اما مشکل دارم. در بخش اضافه کردن خبر جدید.
ببینید:
متن فایل addnews.asp:
<%
'Our login protection code
If Session("BlnLoggedIn") <> True Then
Response.Redirect("login.asp")
End If
response.charset="utf-8"
%>
<html dir="rtl">
<head>
<title>اضافه کردن خبر</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
</head>
<body text="#666666" background="images/back.gif" style="font-family: Tahoma; font-size: 10pt; color: #666666">
<!--#include file="admin_navigation.asp" -->
<div align='center'>
<form name="form" method="post" action="insert_news.asp">
<br>
<table width="377">
<tr>
<td width="51"> <font size="2">نام خبر: </font>
</td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsNamed" maxlength="50" size="32"></font><font size="2">
</font>
</td>
</tr>
<tr>
<td width="51"> <font size="2">توضیح کوتاه:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsDesd" size="32"></font></td>
</tr>
<tr>
<td width="51"> <font size="2">نویسنده:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsAuthord" size="32"></font></td>
</tr>
<tr>
<td width="51"> <font size="2">آدرس تصاویر:</font></td>
<td width="316">
<font face="Tahoma">
<input type="text" name="NewsPicd" size="57"></font></td>
</tr>
<tr>
<td> <font size="2">متن خبر:</font></td>
<td>
<font face="Tahoma">
<textarea name="NewsTextd" cols="35" rows="7"></textarea></font><font size="2">
</font>
</td>
</tr>
<tr>
<td height="32" colspan="2">
<div align="center">
<input type="submit" name="Submit" value="Submit" dir="rtl" style="font-family: Tahoma; font-size: 10pt; color: #666666"><font size="2">
</font>
<input type="reset" name="reset" value="از نو" dir="rtl" style="font-family: Tahoma; font-size: 10pt; color: #666666"><font size="2">
</font>
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
متن فایل insert_news.asp:
<%@ Language="VBScript" %>
<% Option Explicit %>
<%
'Our login protection code
If Session("BlnLoggedIn") <> True Then
Response.Redirect("login.asp")
End If
response.charset="utf-8"
%>
<html dir="rtl">
<head><title>News Management System - News Added</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="fa">
</head>
<body>
<!--#include file="admin_navigation.asp" -->
<%
Dim Connection, sConnString
Dim headline, news, thedate, SQL
Dim NewsDate
Dim NewsPic
Dim NewsText
Dim NewsAuthor
Dim NewsDes
Dim NewsName
NewsName=request.form("NewsNamed")
NewsDes=request.form("NewsDesd")
NewsAuthor=request.form("NewsAuthord")
NewsText=request.form("NewsTextd")
NewsPic=request.form("NewsPicd")
NewsDate=Date()
SQL = "INSERT INTO News(Name,Des,Text,Author,Pic_location) Values " & _
"( '" & NewsName & "', '" & NewsDes & "', '" & NewsText & "' , '" & NewsAuthor & "', '" & NewsPic & "')"
Set Connection = Server.CreateObject("ADODB.Connection")
sConnString="PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.MapPath("databases\maindata.mdb")
Connection.Open(sConnString)
Connection.execute(SQL)
connection.Close
Set connection = Nothing
response.write "<br><div align='center'>خبر جدید اضافه شد.</div>"
%>
</body>
</html></span>
ارور:
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/so/insert_news.asp, line 44
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)
Page:
POST 89 bytes to /so/insert_news.asp
POST Data:
NewsNamed=white&NewsDesd=black&NewsAuthord=test&Ne wsPicd=tar&NewsTextd=jhdsbf&Submit=Submit
کمک کنید دیگه!!!
*** اصلاح شد ***
*** دوست عزیز به هنگام ارسال کد از تگ مربوطه استفاده کنید ***
*** مسعود ***