Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Langages serveur > ASP
ASP Forum sur la programmation ASP. Avant de poster : Cours ASP, FAQ ASP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 09/03/2008, 17h22   #1
Invité de passage
 
Inscription : mars 2008
Messages : 1
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 1
Points : 0
Points : 0
Par défaut URGENT : PB formulaire ASP

Je cherche desesperement quelqu'un pour m'aider car mon souci c'est que je connais nada en asp.

J'ai ete chargé de refaire un site (à la base fait en asp) avec un formulaire de contact. Ni connaissant rien en asp j'ai refait le site en html et le formulaire je l'ai fait en php. Malheureusement l'hebergeur m'a dit que pour que mon formulaire fonctionne il devait etre en asp.
Voila ce que j'ai reussi à faire en me servant de l'ancien site. Malheureusemnt ça ne marche pas. Dans quelle page se trouve le pb???? Sinon comment me simplifier tout ça?????
Merci beaucoup à celui qui pourra m'éclairer. c'est assez urgent car mon client ne comprend pas que cela ne fonctionne pas.

1- Voici La page formulaire :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<form action="contact.asp" method="post" name="theForm" id="theForm" onsubmit="return Form_Contact_Validator(this)">
  <input type="hidden" name="todo" value="envoyer" />
  <table width="441" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFFFFF">
    <tr>
      <td class="td-text-form">&nbsp;</td>
      <td colspan="3" class="texte">
        <input type="radio" name="genre" value="mme" <% if genre="mme" then response.Write("checked='checked'")%> />
        Mme
        <input type="radio" name="genre" value="mlle" <% if genre="mlle" then response.Write("checked='checked'")%> />
        Mlle
        <input type="radio" name="genre" value="m" <% if genre="m" then response.Write("checked='checked'")%> />
        M</td>
    </tr>
    <tr>
      <td class="td-text-form">Nom *</td>
      <td class="texte">
        <input name="nom" type="text" class="input-field-required" size="15" maxlength="30" value="<%=nom%>" />
      </td>
      <td class="td-text-form">Soci&eacute;t&eacute;</td>
      <td class="texte">
        <input name="societe" type="text" class="input-field" id="societe" size="15" maxlength="30" value="<%=societe%>" />
      </td>
    </tr>
    <tr>
      <td class="td-text-form">Pr&eacute;nom</td>
      <td class="texte">
        <input name="prenom" type="text" class="input-field" id="prenom" size="15" maxlength="30" value="<%=prenom%>" />
      </td>
      <td class="td-text-form">Adresse</td>
      <td rowspan="2" valign="top" class="texte">
        <textarea name="adresse" cols="13" rows="2"><%=adresse%></textarea>
      </td>
    </tr>
    <tr>
      <td class="td-text-form">Langue</td>
      <td>
        <select name="langcode" class="select-small">
          <option value="fra"<% if langcode="fra" then response.Write("selected='selected'")%>>Fran&ccedil;ais</option>
          <option value="eng"<% if langcode="eng" then response.Write("selected='selected'")%>>English</option>
        </select>
      </td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td class="td-text-form">Email</td>
      <td class="texte">
        <input name="email" type="text" class="input-field" id="email" size="15" maxlength="30" value="<%=email%>" />
      </td>
      <td class="td-text-form">Code postal</td>
      <td class="texte">
        <input name="codepostal" type="text" class="input-field" id="cp" size="15" maxlength="30" value="<%=codepostal%>" />
      </td>
    </tr>
    <tr>
      <td class="td-text-form">T&eacute;l&eacute;phone</td>
      <td class="texte">
        <input name="telephone" type="text" class="input-field" id="tel" size="15" maxlength="20" value="<%=telephone%>" />
      </td>
      <td class="td-text-form">Ville</td>
      <td class="texte">
        <input name="ville" type="text" class="input-field" id="ville" size="15" maxlength="30" value="<%=ville%>" />
      </td>
    </tr>
    <tr>
      <td class="td-text-form">Fax</td>
      <td class="texte">
        <input name="fax" type="text" class="input-field" id="fax3" size="15" maxlength="20" value="<%=fax%>" />
      </td>
      <td class="td-text-form">Pays</td>
      <td class="texte">
        <input name="pays" type="text" class="input-field" id="pays" size="15" maxlength="30" value="<%=pays%>" />
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td colspan="3" valign="top" class="texte">Questions/Commentaires * <br />
                            <textarea name="question" cols="50" rows="5" class="textarea-required"></textarea>
      </td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" class="texte">
        <div align="center">
          <input name="submit" type="submit" class="submit-button" value="Envoyer" />
        </div>
      </td>
    </tr>
  </table>
</form>
<!--#include file="../lib/include_in_all_public_page.inc.asp"-->
<%
 
 
img_master = "master_contact.jpg"
 
message = false
 
if request("todo")<>"" then
   nom = request("nom")
   	nom = Replace(nom,"'","&acute;")
prenom = request("prenom")
 	prenom = Replace(prenom,"'","&acute;")
  genre = request("genre")
   email = request("email")
   societe = request("societe")
	societe = Replace(societe,"'","&acute;")
   adresse = request("adresse")
 	adresse = Replace(adresse,"'","&acute;")
  codepostal = request("codepostal")
   ville = request("ville")
	ville = Replace(ville,"'","&acute;")
   pays = request("pays")
   telephone = request("telephone")
   fax = request("fax")
   langcode = request("langcode")
   question = request("question")
	question = Replace(question,"'","&acute;")
 
%>
<!--#include file="inclus/mail_contact.inc.asp"-->
<%
   message = "Votre message a été transmis à notre équipe. Merci de votre intérêt pour Rêves du désert."
else
  if session("user")<>"" then
     est_inscrit = true
     nom =  session("nom")
     prenom =  session("prenom")
     genre =  session("genre")
     email =  session("email")
     societe =  session("societe")
     adresse =  session("adresse")
     codepostal =  session("codepostal")
     ville =  session("ville")
     pays =  session("pays")
     telephone =  session("telephone")
     fax =  session("fax")
     langcode =  session("langcode")
end if
end if ' if todo
 
 
%>
 
<%
end if
%>
 
2 -Voici La page de reception du formulaire qui se trouve dans un dossier "inclus" et qu s'appelle : mail_contact.inc.asp
 
<%
 
 txt  = " <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>"
 txt  = txt& "<html>"
 txt  = txt& "<head>"
 txt  = txt& "<title>R&ecirc;ves du d&eacute;sert</title>"
 txt  = txt& "<style type='text/css'>"
 txt  = txt& "<!--"
 txt  = txt& "td {"
 txt  = txt& "	font-family: Verdana, Arial, Helvetica, sans-serif;"
 txt  = txt& "	font-size: 12px;"
 txt  = txt& "	vertical-align: top;"
 txt  = txt& "}"
 txt  = txt& ".tdtitre {"
 txt  = txt& "	font-family: Verdana, Arial, Helvetica, sans-serif;"
 txt  = txt& "	font-size: 12px;"
 txt  = txt& "	font-weight: bold;"
 txt  = txt& "	color: #999999;"
 txt  = txt& "	text-align: right;"
 txt  = txt& "	vertical-align: top;"
 txt  = txt& "}"
 txt  = txt& "body {"
 txt  = txt& "	font-family: Verdana, Arial, Helvetica, sans-serif;"
 txt  = txt& "	font-size: 12px;"
 txt  = txt& "	color: #000000;"
 txt  = txt& "}"
 txt  = txt& ".titre {"
 txt  = txt& "	font-family: Verdana, Arial, Helvetica, sans-serif;"
 txt  = txt& "	font-size: 12px;"
 txt  = txt& "	font-weight: bold;"
 txt  = txt& "	color: #999999;"
 txt  = txt& "}"
 txt  = txt& "-->"
 txt  = txt& "</style>"
 txt  = txt& "</head>"
 txt  = txt& "<body>"
 txt  = txt& "<table border='0' cellpadding='15' cellspacing='1' bgcolor='#999999' width='300'>"
 txt  = txt& "  <tr> "
 txt  = txt& "    <td align='center' bgcolor='#993333'> "
 txt  = txt& "      <p><strong><font color='#FFFFFF'> Demande d'informations.</font></strong></p>"
 txt  = txt& "      </td>"
 txt  = txt& "  </tr>"
 txt  = txt& "  <tr> "
 txt  = txt& "    <td bgcolor='#FFFFFF'><div align='center'>"
 txt  = txt& "        <p><font color='#999999' size='1'>Re&ccedil;u le "&day(now())&"/"&month(now())&"/"&year(now())&" &agrave; "&hour(now())&":"&minute(now())&"</font></p>"
 txt  = txt& "        <table border='0' cellpadding='5' cellspacing='0'>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Nom Pr&eacute;nom</td>"
 txt  = txt& "            <td>"&genre&". "&nom&" "&prenom&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Soci&eacute;t&eacute;</td>"
 txt  = txt& "            <td>"&societe&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Adresse</td>"
 txt  = txt& "            <td>"&adresse&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre'>Ville</td>"
 txt  = txt& "            <td>"&ville&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Code Postal</td>"
 txt  = txt& "            <td>"&codepostal&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Pays</td>"
 txt  = txt& "            <td>"&pays&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >T&eacute;l&eacute;phone</td>"
 txt  = txt& "            <td>"&telephone&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Fax</td>"
 txt  = txt& "            <td>"&fax&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "          <tr> "
 txt  = txt& "            <td class='tdtitre' >Email</td>"
 txt  = txt& "            <td>"&email&"</td>"
 txt  = txt& "          </tr>"
 txt  = txt& "        </table>"
 txt  = txt& "      </div></td>"
 txt  = txt& "  </tr>"
 txt  = txt& "  <tr> "
 txt  = txt& "    <td bgcolor='#FFFFFF'><span class='titre'>Question - Remarque</span><br> "
 txt  = txt& "      <br>"
 txt  = txt& question &"&nbsp;</td>"
 txt  = txt& "  </tr>"
 txt  = txt& "</table>"
 txt  = txt& "<p>&nbsp;</p>"
 txt  = txt& "</body>"
 txt  = txt& "</html>"
 
 
 
 
  BOUNDARY    = "----xxxxxx"
  TEXT_HEADER = "--" & BOUNDARY & VBCrLf & "Content-Type: text/plain;" & VBCrLf & _
                "Content-Transfer-Encoding: 7bit" & VBCrLf & VBCrLf
  HTML_HEADER = "--" & BOUNDARY & VBCrLf & "Content-Type: text/html;" & VBCrLf & _
                "Content-Transfer-Encoding: 7bit" & VBCrLf & VBCrLf
  MP_FOOTER   = "--" & BOUNDARY & "--" & VBCrLf
 
 
  strTextBody = ""
 
  strBody = TEXT_HEADER & strTextBody & VBCrLf & HTML_HEADER & txt & VBCrLf & MP_FOOTER
 
 
	Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
	  Mailer.ContentType = "text/html"
	Mailer.ClearBodyText
	Mailer.ClearAllRecipients
	Mailer.ClearAttachments
	Mailer.CharSet		= 1
	Mailer.WordWrap		= TRUE
 
	Mailer.RemoteHost	= "mail.alcyonis.fr"
if langcode="fra" then 								   
i=0
else if langcode="eng" then 								   
i=1
else 								   
i=2
end if
end if
 
	Mailer.AddRecipient   "RDD", mail_to(i)
'	Mailer.FromName		=  "Contact"
	Mailer.FromAddress	=  mail_from_contact
	Mailer.Subject		= "Demande d'information page de contact"
	Mailer.BodyText		= txt 'strBody
 
	if Mailer.SendMail then
		'message="Votre message nous est bien parvenu, vous serez contacté par un membre de notre équipe très prochainement. Merci"
	else
		response.write("Erreur lors de l'envoi du courrier. (" & Mailer.Response & ")")
	end if
	'Mailer.Close
 
%>
Mimounetimouss est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 09/03/2008, 21h57   #2
Expert Confirmé Sénior

 
Avatar de Immobilis
 
Inscription : mars 2004
Messages : 5 857
Détails du profil
Informations forums :
Inscription : mars 2004
Messages : 5 857
Points : 5 975
Points : 5 975
Salut,

Bienvenu sur le forum.
Citation:
Envoyé par Mimounetimouss Voir le message
Malheureusement l'hebergeur m'a dit que pour que mon formulaire fonctionne il devait etre en asp
Bon ben change d'hebergeur peut-être. Cela se saurait si le PHP ne pouvait pas servir à faire des formulaires. PHP peut plus que l'ASP...

Si tu préfères le PHP fais du PHP. Maintenant, si tu veux faire cohabiter du PHP avec de l'ASP c'est plus difficile.

A+
Immobilis est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 08h40.


 
 
 
 
Partenaires

Hébergement Web