PDA

View Full Version : تغییر در کدها



Asad.Safari
شنبه 24 بهمن 1383, 13:53 عصر
یا سلام
من کجای این کد را چه طوری تغییر بدم که
این فرم با smtp server به ایمیلم فرستاده بشه!!!

واز jmail و cdonts استفاده نکنه!!!




config.asp



<%
'################################################# #########
'########## CONFIGURATION POWERWEB99 WEBSHOP V1.2 #########
'################################################# #########


'# Wنhlen Sie bitte die Komponente, mit der Mails verschickt werden sollen
'# choose your mailcomponent
'# jmail or cdonts

mail_component = "jmail"

'# Ihre Maildaten / Your Account

mail_host = "mail.mailserver.com"
mail_sender = "mail@mailserver.com"
mail_subject = "Bestellung"
mail_empfaenger = "mail@mailserver.com"

'# MailText: With this text a order mail starts, the rest will be added.

mailText = "So beginnt eine Bestellung, der Rest wird automatisch hinzugefügt..."

'# Wنhlen Sie die Felder, die bei einer BestellMail benutzt werden
'# choose the fields you want to use for a order-mail

m_name = true
m_country = true
m_city = true
m_street = true
m_phone = true
m_mailadress = true
m_card_type = false
m_card_number = false
m_card_expiration_date = false
m_comment = true

'# Banner URL
'# Um das Logo zu نndern, Laden Sie ein Bild in den Pics Ordner und geben Sie hier den Bildnamen ein:
'# To change the Banner, just upload another picture in the pics folder, an put the name here:

banner = "banner.gif"

'# FARBEN / COLORS

color1 = "#8c8c9c"
color2 = "#efefde"
color3 = "#848cb5"
color4 = "#ffffff"

'### NAVIGATION / MENUE

'# Produkte / Products / TOP
n_produkte = "Unsere Produkte"

'# Warenkorb / Basket / TOP
n_basket = "Warenkorb"

'# Warenkorb / Basket / SUB
n_basket1 = "Warenkorb ansehen"

'# Warenkorb leer / basket empty
n_basket2 = "Warenkorb leer"

'# Info / TOP
n_info = "Informationen"

'# Info / SUB
n_info1 = "ـber uns"

'### SHOP

'# Produkt in den Warenkorb legen / Add produkt
s_add_product = "Diesen Artikel in den Warenkorb legen"

'# Kein Produkt in dieser Rubrik / no product in this menue
s_no_product = "In dieser Rubrik gibt es leider keinen Artikel"

'### WARENKORB / ORDER SITE

'# BestellFormular ـberschrift / orderform title
l_title = "Bestellung abschicken"

'# TEXT über dem BestellMail / TEXT below the order form (HTML is allowed)
l_text = "Bitte füllen Sie alle Felder aus.<br>Mit abschicken der Bestellung akzeptieren Sie unsere AGB."

'# Felder im Warenkorb / fields in basket-list

'# Anzahl / items
l_list1 = "Stück"

'# Artikelnummer / number
l_list2 = "NR"

'# Artikelbezeichnung / productname
l_list3 = "Artikel"

'# Einzelpreis / Price (per Item)
l_list4 = "Einzelpreis"

'# Gesamtpreis / price
l_list5 = "Gesamtpreis"

'# gesamtpreis der Bestellung / All in all price
l_list6 = "Gesamtpreis der Bestellung (inkl. MWST)"

'# Wنhrung / money
l_list7 = "€"

'### Feldbeschreibungen Bestell Mail/ Fieldnames order mail
'# Name
l_name = "Vor & Nachname"

'# Land / country
l_country = "Land"

'# Stadt / city
l_city = "Stadt"

'# Strasse / street
l_street = "Strasse"

'# Telefon / phone
l_phone = "Telefon"

'# Mail
l_mailadress = "Mail"

'# Kreditkarten Art / card type
l_card_type = "Kreditkarte"

'# Kreditkarten Nummer / card Number
l_card_number = "Nummer"

'# Kreditkarte Ablaufdatum / card expiration date
l_card_expiration_date = "Ablaufdatum"

'# Kommentar / comment
l_comment = "Sonstiges"

'# Bestellung absenden Button / send order button
l_button ="Bestellung abschicken"

'# Text der nach dem Abschicken der Bestellung erscheint / oder bei einem Fehler
'# Text that will be showed after a order was sent / or if there is an error
l_sendtext = "Vielen Dank für Ihre Bestellung, wir werden uns in Kürze bei Ihnen melden."
l_nosendtext = "Leider konnte Ihre Bestellung nicht abgeschickt werden!<br>Bitte füllen Sie alle Felder aus.<br>"

'### Titel & Text der Startseite / Title and text for the front page
'# hier kِnnen Sie einen Willkommenstext, Ihre Adresse oder نhnliche Informationen einfügen. (HTML ist erlaubt!)
'# Here you can add a welcome message and other things (HTML is allowed).

start_title = "Willkommen in unserem Shop"
start_body = "Unser Shop bietet Ihnen spezielle Angebote...<br><br>Diesen Text kِnnen Sie in der language.asp anpassen<br><br>This text you can modify in the language.asp"

'### Titel & Text der Info Rubrik / Title and text for the info side
'# hier kِnnen Sie spezielle Informationen, Ihre Adresse oder نhnliche Informationen einfügen. (HTML ist erlaubt!)
'# Here you can add spezial information, your adress and other things (HTML is allowed).

info_title = "ـber uns"
info_body = "Unser Shop bietet Ihnen spezielle Angebote...<br><br>Bla Bla Bla..."

%>




send.asp



<!-- #include file="config.asp" -->
<%
dim rubriken(100,4)

set db = Server.CreateObject("ADODB.Connection")
connect="Driver={Microsoft Access Driver (*.mdb)}; DBQ="& server.mappath("pw99_shop.mdb")
db.Open connect

sql = "select rubrik, id, parent, rank from rubriken order by rank"
set rs = db.Execute(sql)
while not rs.eof
if i<100 then
rubriken(i,0) = rs("rubrik")
rubriken(i,1) = rs("parent")
rubriken(i,2) = rs("id")
rubriken(i,3) = rs("rank")
end if
i=i+1
rs.movenext
wend
arrayLaenge=i-1


Function show_search(parent1, ebene)
if parent1 <> vbNullString then
for t = 0 to arrayLaenge
if rubriken(t,1) = parent1 then

platzhalter=""
for x= 0 to ebene
platzhalter = platzhalter & "   "
next

if ebene = 0 then
zusatz = "<b>"
zusatz1 = "</b>"
end if
response.write( platzhalter & "<a class='text' href='index1.asp?r="&rubriken(t,2)&"'>" & zusatz & rubriken(t,0) & zusatz1 & "</a><br>" & chr(13))
parent2 = rubriken(t,2)
ebene1 = ebene +1
show_search parent2, ebene1
end if
next
end if
end function

function checkField(eingabe)
if len(eingabe)<1 then ok = 1
checkField = eingabe
end function

%>
<html>
<head>
<title>PW99 MiniShop</title>

<link rel=stylesheet href="style.css" type="text/css">

</head>
<body bgcolor="<%=color4%>">

<table border="0" cellpadding="0" cellspacing="0" width="100" bgcolor="#000000" align="center">
<tr>
<td width="100%">
<table border="0" cellpadding="2" cellspacing="1" width="700" class="text">
<tr>
<td width="100%" bgcolor="<%=color2%>" align="center" colspan = "2"><img src="pics/<%=banner%>"></td>
</tr>

<tr>
<td width="200" bgcolor="<%=color3%>" align="center" valign="top">

<table border="0" cellpadding="0" cellspacing="0" width="100" bgcolor="#000000" align="center">
<tr>
<td width="100%">
<table border="0" cellpadding="2" cellspacing="1" width="180" class="text">

<tr>
<td width="100%" bgcolor="<%=color1%>" align="center">
<b><%=n_produkte%></b></td>
</tr>
<tr>
<td width="100%" bgcolor="<%=color2%>" align="left" valign="top">
<%show_search 0,0%>
</td>
</tr>
<tr>
<td width="100%" bgcolor="<%=color1%>" align="center">
<b><%=n_info%></b></td>
</tr>
<tr>
<td width="100%" bgcolor="<%=color2%>" align="left">
<a class="text" href="info.asp"><%=n_info1%></a></td>
</tr>
<tr>
<td width="100%" bgcolor="<%=color2%>" align="left">
<a class="text" href="index1.asp?r=-1">Home</a></td>
</tr>
</table>





</td>
</tr>
</table>
</td>
<td width="500" bgcolor="<%=color2%>" align="center" valign="top">

<%
ok = 0
if m_name = true then orderPerson = OrderPerson & l_name & ": " & checkField(request.form("m_name")) & chr(10) & chr(13)
if m_city = true then orderPerson = OrderPerson & l_city & ": " & checkField(request.form("m_city")) & chr(10) & chr(13)
if m_street = true then orderPerson = OrderPerson & l_street & ": " & checkField(request.form("m_street"))& chr(10) & chr(13)
if m_country = true then orderPerson = OrderPerson & l_country & ": " & checkField(request.form("m_country"))& chr(10) & chr(13)
if m_phone = true then orderPerson = OrderPerson & l_phone & ": " & checkField(request.form("m_phone"))& chr(10) & chr(13)
if m_mailadress = true then orderPerson = OrderPerson & l_mailadress & ": " & checkField(request.form("m_mailadress"))& chr(10) & chr(13)
if m_card_type = true then orderPerson = OrderPerson & l_card_type & ": " & checkField(request.form("m_card_type"))& chr(10) & chr(13)
if m_card_number = true then orderPerson = OrderPerson & l_card_number & ": " & checkField(request.form("m_card_number"))& chr(10) & chr(13)
if m_card_expiration_date = true then orderPerson = OrderPerson & l_card_expiration_date & ": " & checkField(request.form("m_card_expiration_date"))& chr(10) & chr(13)
if m_comment = true then orderPerson = OrderPerson & l_comment & ": " & checkField(request.form("m_comment"))& chr(10) & chr(13)

if ok = 0 then
warenkorb = session("warenkorb")
if isArray(warenkorb) then
i = session("items")
mailText = mailText & chr(13) & chr(10) & chr(13) & chr(10)
mailText = mailText & orderPerson & chr(13) & chr(10)
mailtext = mailText & "----------------------------------------" & chr(13) & chr(10)
for t = o to i
if (warenkorb(t,0)) <> "" then
gesamt_artikel = + warenkorb(t,0) * warenkorb(t,2)
gesamt = FormatNumber(gesamt + gesamt_artikel,2,,-2)
mailText = mailText & l_list1 & " : " & warenkorb(t,0) & chr(13)& chr(10)
mailText = mailText & l_list2 & " : " & warenkorb(t,3) & chr(13)& chr(10)
mailText = mailText & l_list3 & " : " & warenkorb(t,4) & chr(13)& chr(10)
mailText = mailText & l_list4 & " : " & FormatNumber(warenkorb(t,2),2,,-2) & chr(13)& chr(10)
mailtext = mailtext & l_list5 & " : " & FormatNumber(gesamt_artikel,2,,-2)& chr(13) & chr(10)
mailtext = mailText & "----------------------------------------" & chr(13) & chr(10)
end if
next
mailtext = mailText & "========================================" & chr(13) & chr(10)
mailtext = mailtext & l_list6 & " : " & FormatNumber(gesamt,2,,-2)

if mail_component = "jmail" then
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = mail_host & ":25"
JMail.Sender = mail_sender
JMail.Subject = mail_subject
JMail.addrecipient mail_empfaenger
JMail.Body = mailText
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
Set JMail = nothing
session.abandon
else
Set Mailer = CreateObject("CDONTS.NewMail")
Mailer.MailFormat = 0
Mailer.BodyFormat = 1
Mailer.From = mail_sender
Mailer.To = mail_empfaenger
Mailer.Subject = mail_subject
Mailer.Body = mailText
Mailer.Send
Set Mailer= Nothing end if

end if
end if
%>

<table width="100" border="0" cellpadding="0" cellspacing = "0" bgcolor="#000000">
<tr><td>
<table border="0" cellpadding="2" cellspacing="1" width="400" class="text">
<tr bgcolor="<%=color2%>">
<td width="100%" align="center"><b>Vielen Dank!</b></td>
</tr>

<tr bgcolor="<%=color2%>">
<td width="100%" align="left">
<%if ok = 0 then %>
<%=l_sendtext%>
<%else%>
<%=l_nosendtext%>
<br><center><a class="text" href="javascript:history.go(-1);">back</a></center>
<%end if%></td>
</tr>

</table>
</td></tr></table>
</td>
</tr>
</table>
</td>
</tr>
</table>


<br>
<center><a href="http:www.takgam.com" target="_blank"><img src="http://www.takgam.com" border="0"></a></center>
<%
rs.close
db.close
set rs = nothing
set db = nothing
Erase rubriken
%>
</body>
</html>





در attachment پیام هم سورس کامل رو می ذارم!!
:موفق: