Перейти к содержимому

(499) 940-40-00 подключение
(499) 940-00-00 служба поддержки

Создаю сайт для GanjaWars


Сообщений в теме: 23

#1 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 21 апреля 2006 - 23:21

Собственно синдикат есть http://dp1696.hut2.ru/
Вот я начал делать элементарный сайт.
Как видете на 2 странице есть Анкета. Проф сразу поймет, что это муляж.
Код самой анкеты такой:

  <form action="spasibo.php" method="post">
	Ваше Имя:<br>
   <input type="text" size="75" name="name"><br>
	Ваш E-mail:<br>
   <input type="text" size="75" name="Seimex_millenium@mtu-net.ru"><br>
	Ваши Данные:<br>
   <textarea cols="57" rows="4" name="txt"></textarea><br><br>
   <input type="submit" value="Отослать">
  </form>

Как сделать, что б заявка писалась в отдельный фаил txt и как сделать, что бы написанное отправлялось на почту. Ну ей богу очень нужно.

#2 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 22 апреля 2006 - 13:13

Ап, помогите)

#3 Sten


  • Гости
Offline

Отправлено 22 апреля 2006 - 13:22

Пиши скрипт на пхп =)

#4 atran


  • Гости
Offline

Отправлено 22 апреля 2006 - 16:38

Просмотр сообщенияSeimex (Faust) (Apr 22 2006, 02:13 PM) писал:

Ап, помогите)
для работы с файломи смотри функции fopen(), fputs(), fclose()
для почты mail()

Удачи :)



Или ты хотел войти в воду и не замачить ноги?

Сообщение отредактировал atran: 22 апреля 2006 - 16:39


#5 Hetzer


  • Гости
Offline

Отправлено 22 апреля 2006 - 18:29

существует полно готовых скриптов на пхп - ищи в и-нете

#6 Mistel


  • Гости
Offline

Отправлено 22 апреля 2006 - 19:06

Ого! Ганджа) А ты сам глава синда? Возьмёшь меня? :)

#7 atran


  • Гости
Offline

Отправлено 22 апреля 2006 - 19:29

Просмотр сообщенияMistel (Apr 22 2006, 08:06 PM) писал:

Ого! Ганджа) А ты сам глава синда? Возьмёшь меня? :)
ты про что?

#8 Sten


  • Гости
Offline

Отправлено 22 апреля 2006 - 22:34

http://ganjawars.ru/

#9 Mistel


  • Гости
Offline

Отправлено 22 апреля 2006 - 23:32

Знающие поймут :)

#10 atran


  • Гости
Offline

Отправлено 23 апреля 2006 - 01:00

Просмотр сообщенияMistel (Apr 23 2006, 12:32 AM) писал:

Знающие поймут :)
Я не знаю, но вроде понял что это браузерная игра - регистрироватся в лом, так как скорей всгего играть не буду, а спам приходить от туда будет, но надеюсь, что не очередная копию БК

#11 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 23 апреля 2006 - 01:19

Флудерасты!! Я только просил доработать то что уже сделал!
У меня на PHP все. Ну помогите прошу.

#12 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 23 апреля 2006 - 02:00

Короче по совету нашел, сделал http://dp1696.hut2.ru/
Но я не знаю куда там вписывать Е-Маил, может хоть с этим поможите?

#13 Sten


  • Гости
Offline

Отправлено 23 апреля 2006 - 15:52

А исходники где?
ЗЫ Ты php и html не путаешь?

#14 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 23 апреля 2006 - 16:47

Хорошо, там ток формат php , а код практически весь на HTML. Сейчас исходники брошу.

<html>
<head><title>Seimex ™ сайт ©®</title>
<style type="text/css">
Body {background: F5FFF5; padding: 0px; margin: 0px; border: 0px;}
 td a {width: 100%; text-decoration: none}
 a:link {color: green}
 a:visited {color: green}
 a:active {color: red}
 a:hover {color: green; background-color: white; text-decoration: underline}
.menu {font-size: 9pt; color: #003300; font-family: verdana, geneva, arial cyr; margin-left: 20px; border: solid 1.5px;
	   border-color: 339933; width: 170px; line-height: 20px}
.text {font-size: 9pt; color: #003300; font-family: verdana, geneva, arial cyr;}
</style>
</head>					
<body>

<!-- Верхняя строка -->
<?php include("topline.php");?>

<table cellspacing="0" cellpadding="0" style="width: none">
<!-- Меню -->
<?php include("menu.php");?>

<!-- Основное тело начало -->
<td>
  <table height="100%" valign="bottom" cellspacing="0" cellpadding="0" 
		 style="width: 400px; margin-left: 20px; font-weight: bold">
  <tr><td>
<!-- Готовый код начало -->
  <form name="form1" method="post" action="spasibo.php">
<table width="760" border="0" cellspacing="0" cellpadding="0" class="text">
<tr> 
<td width="200"> 
<div align="right">Игровой ник</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="sender">
</td>
</tr>
<tr> 
<td width="200"> 
<div align="right">Боевой lvl</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="sendername">
</td>
</tr>
<tr> 
<td width="200"> 
<div align="right">Опыт игры</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="recipient">
</td>
</tr>
<tr> 
<td width="200"> 
<div align="right">Предпочительное оружие</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="recipientname">
</td>
</tr>
<tr> 
<td width="200"> 
<div align="right">Номер ICQ</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="subject">
</td>
</tr>
<tr> 
<td width="200"> 
<div align="right">Дополнительная информация</div>
</td>
<td width="15"> </td>
<td width="645"> 
<input type="text" name="message">
</td>
</tr>
<tr> 
<td width="100"> </td>
<td width="15"> </td>
<td width="645"> 
<input type="submit" name="Submit" value="Отправить">
</td>
</tr>
</table>
<input type="hidden" name="mailtype" value="text">
<input type="hidden" name="thankspage" value="">
<input type="hidden" name="whythank" value="">
<input type="hidden" name="details" value="1">
<input type="hidden" name="failure" value="">
</form>
<!-- Готовый код конец -->  
  </td></tr>
  </table>
</td>
<!-- Основное тело конец -->

</tr>
</table>
											

</body>
</html>

А это скрипт.

<%
' ..:: FORM into EMAIL ::..
' By Nick Blower, Redeggs Web Design ©
' scripts@redeggs.com | www.redeggs.com
'
' ## FORM VALUES ##
'  sendername			From (Name) (If omitted shows: sender address)
'  sender				From (required)
'  recipient			To (required)
'  recipientname		To (Name) (If omitted shows: recipeint address)
'  subject				Email Subject (If omitted shows: No subject)
'  message				User definded body text (If omitted shows: No message)
'  details				Show details about the sender (0=don't show (default); 1=show)
'  thankspage			Page to display after successful send (If omitted shows basic thanks message)
'  whythank (0 or 1)	Whether to pass the details of the message to thanks page (0=don't (default); 1=show)
'  mailtype 			Specify wheather email to be sent is in "HTML" or "PLAIN" text (must equal= "HTML" or "TEXT" (default))
'  failure				Page to show if there is a problem. Default is this script (see bottom). Must be web location of file to show


' !!! IMPORTANT !!!
' You must post to this script, otherwise you will be redirected elsewhere!
' !!! IMPORTANT !!!
'
' First prevent this file being displayed without submitting data
' +~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+
' Delete this to remove post protection
' +~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+
If LCase(Request.ServerVariables("REQUEST_METHOD")) <> "post" Then
Response.Redirect(Request.ServerVariables("URL") & "?prob=post")
End If
' +~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+
' STOP DELETING NOW!
' +~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+~+


' ## VALUES ##
' Form values
sender = Trim(request("sender"))		'From
sendername = request("sendername")		'From (Name)
recipient = Trim(request("recipient"))	'To
recipientname = request("recipientname")'To (Name)
subject = request("subject")			'Email Subject
message = request("message")			'User definded body text
thankspage = request("thankspage")		'Page to display after successful send (Required for whythank to = "1"
whythank = request("whythank")			'Whether to pass the details of the message to thanks page, if omitted = "0"
mailtype = request("mailtype")			'Specify wheather email to be sent is in "HTML" or "PLAIN" text
failure = request("failure")			'Page to show if there is a problem. Default is the refering page.


' ## REFORMAT VALUES ##
If failure = "" Then failure =  Request.ServerVariables("URL") End If ' Check for failure URL, else use submitting form
If sendername = "" Then sendername = sender End If ' Check for sendername, else use email address
If subject = "" Then subject = "No Subject" End If ' Check for subject, else say No Subject
If message = "" Then message = "No message" End If ' Check for message, else 


' ## ADDRESS CHECK ##
' Check that there is a valid email address for the "sender" and "recipient" fields
If Len(sender) = 0 Or Instr(sender, "@") = 0 Or Instr(str_sender, ".") = 0 Then
Response.Redirect(failure & "?prob=sender")
End If

If Len(recipient) = 0 Or Instr(recipient, "@") = 0 Or Instr(str_sender, ".") = 0 Then
Response.Redirect(failure & "?prob=recipient")
End If

If details = "1" Then
details = "Host: " & request.ServerVariables("REMOTE_ADDR") & vbcrlf & "Referer: " & request.ServerVariables("HTTP_REFERER") & vbcrlf & "Time/Date: " & Now
End If

' ## SENDING EMAIL ##
' Setup CDONTS Email to be sent
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = sendername & "<" & sender & ">"
objNewMail.Subject = subject
objNewMail.To = recipient
If mailtype = "HTML" Then
objMail.BodyFormat = 0
objMail.MailFormat = 0
End If
objNewMail.Body = message & vbcrlf & vbcrlf & details
objNewMail.Send ' Send it!
Set objNewMail = Nothing ' Destroy the sent email

' ## THANKS ##
' Say thank you!
If thankspage <> "" And whythank = "" Or "0" Then Response.Redirect(thankspage) End If
If thankspage <> "" And whythank = "1" Then Response.Redirect(thankspage & "?sender=" & sender & "&sendername=" & sendername & "&recipient=" & recipient & "&recipientname=" & recipientname & "&subject=" & subject & "&message=" & message) End If
If thankspage = "" Then %>

<html>
<head>
<title>Email sending details</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

<% If Request.QueryString("prob") = "" Or Len(Request.QueryString("prob")) < 1 Then %>

<table width="760" border="0" cellspacing="0" cellpadding="0" align="center">
<tr> 
<td colspan="3"><b><font face="Arial, Helvetica, sans-serif" size="5">Email sent successfully!</font></b></td>
</tr>
<tr> 
<td colspan="3" height="10"></td>
</tr>
<tr> 
<td colspan="3"><b><font face="Arial, Helvetica, sans-serif" size="4">Details of sent email:</font></b></td>
</tr>
<tr> 
<td width="100" valign="top"> 
<div align="right"><font face="Arial, Helvetica, sans-serif" size="3"><b>To:</b></font></div></td>
<td width="15"></td>
<td width="645"><%= recipientname & "<" & recipient & ">" %></td>
</tr>
<tr> 
<td width="100" valign="top"> 
<div align="right"><font face="Arial, Helvetica, sans-serif" size="3"><b>From:</b></font></div></td>
<td width="15"></td>
<td width="645"><font size="3" face="Courier New, Courier, mono"><%= sendername & "<" & sender & ">" %></font></td>
</tr>
<tr> 
<td width="100" valign="top"> 
<div align="right"><font face="Arial, Helvetica, sans-serif" size="3"><b>Subject:</b></font></div></td>
<td width="15"></td>
<td width="645"><font size="3" face="Courier New, Courier, mono"><%= subject %></font></td>
</tr>
<tr> 
<td width="100" valign="top"> 
<div align="right"><font face="Arial, Helvetica, sans-serif" size="3"><b>Sent as:</b></font></div></td>
<td width="15"></td>
<td width="645"><font size="3" face="Courier New, Courier, mono"><%= mailtype %></font></td>
</tr>
<tr> 
<td width="100" valign="top"> 
<div align="right"><font face="Arial, Helvetica, sans-serif" size="3"><b>Message:</b></font></div></td>
<td width="15"></td>
<td width="645"><font size="3" face="Courier New, Courier, mono"><%= Replace(Server.HTMLEncode(message),Chr(13),"<br>") %></font></td></tr>
</table>

<% ElseIf Request.QueryString("prob") = "Sender" Then %>
<font face="Arial, Helvetica, sans-serif" size="3"><b>There was a problem with the senders address, please go back and try again.</b></font>
<% ElseIf Request.QueryString("prob") = "Recipient" Then %>
<font face="Arial, Helvetica, sans-serif" size="3"><b>There was a problem with the recipients address, please go back and try again.</b></font>
<% ElseIf Request.QueryString("prob") = "post" Then %>
<font face="Arial, Helvetica, sans-serif" size="3"><b>You must post data to this script. To disable this delete the section marked "Delete this to remove post protection" from this script.</b></font>
<% End If %>
</body>
</html>

Сообщение отредактировал Seimex (Faust): 23 апреля 2006 - 16:48


#15 Sten


  • Гости
Offline

Отправлено 23 апреля 2006 - 18:13

Я немного забросил это дело, и могу дать неточный ответ.
Но видимо адрес содержится здесь:
recipient = Trim(request("recipient"))
Тогда попробуй сделать так (твое мыло например mail@mail.ru):
recipient = "mail@mail.ru"
Однако я не понимаю почему переменные без знака "$" если это пхп...
Ну или в форме отправь параметр с именем "recipient" и содержащий "mail@mail.ru"

ЗЫ Я тут подумал, наверно это не пхп, а что-то на него похожее.

#16 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 24 апреля 2006 - 17:35

Это asp, то что ты правил :)
Еще вопрос, а скрип этот бросать на gdi-bin, или в обычную www?

#17 Sten


  • Гости
Offline

Отправлено 24 апреля 2006 - 20:28

В cgi-bin бросаются обычно все же cgi, пхп - в обычную. Куда асп - хз. Он вроди для виндовс хостинга, по крайней мере насколько я понял.

#18 AkUs

    Прохожий


  • Пользователи
  • 211 сообщений
2
Offline

Отправлено 25 апреля 2006 - 01:07

' ## ADDRESS CHECK ##
' Check that there is a valid email address for the "sender" and "recipient" fields
If Len(sender) = 0 Or Instr(sender, "@") = 0 Or Instr(str_sender, ".") = 0 Then
Response.Redirect(failure & "?prob=sender")
End If

If Len(recipient) = 0 Or Instr(recipient, "@") = 0 Or Instr(str_sender, ".") = 0 Then
Response.Redirect(failure & "?prob=recipient")

Вот эта часть о чем говорит? Может вместо @ нужно ввести мой емаил?

#19 Dj FIX


  • Гости
Offline

Отправлено 25 апреля 2006 - 09:36

Нет сдя из камента к этому коду здесь проверяется емэйл на валидность, типа ввел ты name@host.ru или что то другое ...

#20 atran


  • Гости
Offline

Отправлено 25 апреля 2006 - 11:07

Ну когда создаешь темы, ну ты хотя бы говори, что за язык то... тут вроде все в основном по php ...





Количество пользователей, читающих эту тему: 2

0 пользователей, 2 гостей, 0 анонимных