質問編集履歴

2

文法の修正

2016/12/26 18:15

投稿

Kako7788
Kako7788

スコア8

test CHANGED
File without changes
test CHANGED
@@ -54,7 +54,7 @@
54
54
 
55
55
 
56
56
 
57
- echo "<script> window.location.href='confirm0.php'; </script>";
57
+ echo "<script> window.location.href='confirm.php'; </script>";
58
58
 
59
59
 
60
60
 
@@ -72,95 +72,179 @@
72
72
 
73
73
  <table cellpadding="0" cellspacing="0" style="width: 100%">
74
74
 
75
-
76
-
75
+
76
+
77
- <tr>
77
+ <tr>
78
-
78
+
79
- <td>&nbsp;&nbsp;お名前
79
+ <td>&nbsp;&nbsp;メールアドレス
80
80
 
81
81
  <font color="red">(必須)</font></td>
82
82
 
83
+ <td><input type="text" name="email" size="50" style="ime-mode:disabled" required /></td>
84
+
85
+ </tr>
86
+
87
+ <tr>
88
+
89
+ <td>&nbsp;&nbsp;選択カラー
90
+
91
+ <font color="red">(必須)</font></td>
92
+
83
93
  <td>
84
94
 
85
-
86
-
87
- <input type="text" name="name" size="10" class="mbox01" required /></td>
88
-
89
- </tr>
90
-
91
-
92
-
93
-
94
-
95
- <tr>
96
-
97
- <td>&nbsp;&nbsp;電話番号
98
-
99
- <font color="red">(必須)</font></td>
100
-
101
- <td><input type="text" name="phone" size="20" required />
102
-
103
- </td>
104
-
105
- </tr>
106
-
107
- <tr>
108
-
109
- <td>&nbsp;&nbsp;メールアドレス
110
-
111
- <font color="red">(必須)</font></td>
112
-
113
- <td><input type="text" name="email" size="50" style="ime-mode:disabled" required /></td>
114
-
115
- </tr>
116
-
117
- <tr>
118
-
119
- <td>&nbsp;&nbsp;選択カラー
120
-
121
- <font color="red">(必須)</font></td>
95
+ <table border="0">
96
+
97
+ <tr>
98
+
99
+ <td ><label>
100
+
101
+ <input type="checkbox" name="content[]" value="赤" />
102
+
103
+ 赤</label></td>
104
+
105
+ </tr>
106
+
107
+ <tr>
108
+
109
+ <td ><label>
110
+
111
+ <input type="checkbox" name="content[]" value="" />
112
+
113
+ </label></td>
114
+
115
+ </tr>
116
+
117
+ <tr>
118
+
119
+ <td ><label>
120
+
121
+ <input type="checkbox" name="content[]" value="黄" />
122
+
123
+ 黄</label></td>
124
+
125
+ </tr>
126
+
127
+ </table>
128
+
129
+
130
+
131
+ </td>
132
+
133
+ </tr>
134
+
135
+ </table></td>
136
+
137
+ </tr>
138
+
139
+ </table>
140
+
141
+ <br>
142
+
143
+ <p style="text-align: center">
144
+
145
+ <input type="submit" value="" name="submit" class="submit hover" style="opacity: 1;border: none;">
146
+
147
+
148
+
149
+ </p>
150
+
151
+ </form>
152
+
153
+
154
+
155
+ ```
156
+
157
+
158
+
159
+ ◆確認画面ファイル(confirm.php)
160
+
161
+ ```php
162
+
163
+ <?php session_start();
164
+
165
+ if(!isset($_SESSION['entry']) && $_SESSION['entry']['email']=="")
166
+
167
+ {
168
+
169
+ echo "<script> window.location.href='index.php'; </script>";
170
+
171
+ }
172
+
173
+ if(isset($_POST['confirm'])) {
174
+
175
+ $to = $_SESSION['entry']['email'];
176
+
177
+ $from_addr = 'info@hoge.jp';
178
+
179
+ (省略)
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+ if($_SESSION['entry']['email']) {
188
+
189
+ $message .= 'メールアドレス: '.$_SESSION['entry']['email']."\n";
190
+
191
+ }
192
+
193
+
194
+
195
+ if($_POST['entry']['content']) {
196
+
197
+ $message .= 'ご選択カラー: '.$_POST['entry']['content']."\n";
198
+
199
+ }
200
+
201
+
202
+
203
+ (省略)
204
+
205
+ }
206
+
207
+ }
208
+
209
+ ?>
210
+
211
+
212
+
213
+
214
+
215
+
216
+
217
+ <form method="post" action="" >
218
+
219
+ <table cellpadding="0" cellspacing="0" style="width: 100%">
220
+
221
+ <tr>
222
+
223
+ <td style="padding:0px;margin:0px;"><table cellpadding="0" cellspacing="0" class="contactTable">
224
+
225
+
226
+
227
+ <tr>
228
+
229
+ <td>&nbsp;&nbsp;メールアドレス <font color="red">(必須)</font></td>
230
+
231
+ <td><?php echo $_SESSION['entry']['email'];?></td>
232
+
233
+ </tr>
234
+
235
+ <tr>
236
+
237
+ <td>&nbsp;&nbsp;ご選択カラー <font color="red">(必須)</font></td>
122
238
 
123
239
  <td>
124
240
 
125
- <table border="0">
241
+ <?php echo $_SESSION['entry']['content'];?>
126
-
242
+
127
- <tr>
243
+ </td>
128
-
129
- <td ><label>
244
+
130
-
131
- <input type="checkbox" name="content[]" value="赤" />
132
-
133
- 赤</label></td>
134
-
135
- </tr>
245
+ </tr>
136
-
137
- <tr>
246
+
138
-
139
- <td ><label>
247
+
140
-
141
- <input type="checkbox" name="content[]" value="青" />
142
-
143
- 青</label></td>
144
-
145
- </tr>
146
-
147
- <tr>
148
-
149
- <td ><label>
150
-
151
- <input type="checkbox" name="content[]" value="黄" />
152
-
153
- 黄</label></td>
154
-
155
- </tr>
156
-
157
- </table>
158
-
159
-
160
-
161
- </td>
162
-
163
- </tr>
164
248
 
165
249
  </table></td>
166
250
 
@@ -172,124 +256,10 @@
172
256
 
173
257
  <p style="text-align: center">
174
258
 
175
- <input type="submit" value="" name="submit" class="submit hover" style="opacity: 1;border: none;">
259
+ <button type="submit" name="confirm" class="submit_confirm hover" style="opacity: 1;border: none;"> &nbsp;&nbsp; </button>
176
-
177
- <!--<input type="reset" value="" class="reset hover" style="opacity: 1;border: none">-->
260
+
178
-
179
- </p>
261
+ </p>
180
262
 
181
263
  </form>
182
264
 
183
-
184
-
185
265
  ```
186
-
187
-
188
-
189
- ◆確認画面ファイル(confirm.php)
190
-
191
- ```php
192
-
193
- <?php session_start();
194
-
195
- if(!isset($_SESSION['entry']) && $_SESSION['entry']['email']=="")
196
-
197
- {
198
-
199
- echo "<script> window.location.href='index.php'; </script>";
200
-
201
- }
202
-
203
- if(isset($_POST['confirm'])) {
204
-
205
- $to = $_SESSION['entry']['email'];
206
-
207
- $from_addr = 'info@hoge.jp';
208
-
209
- (省略)
210
-
211
-
212
-
213
-
214
-
215
-
216
-
217
- if($_SESSION['entry']['email']) {
218
-
219
- $message .= 'メールアドレス: '.$_SESSION['entry']['email']."\n";
220
-
221
- }
222
-
223
-
224
-
225
- if($_POST['entry']['content']) {
226
-
227
- $message .= 'ご選択カラー: '.$_POST['entry']['content']."\n";
228
-
229
- }
230
-
231
-
232
-
233
- (省略)
234
-
235
- }
236
-
237
- }
238
-
239
- ?>
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
- <form method="post" action="" >
248
-
249
- <table cellpadding="0" cellspacing="0" style="width: 100%">
250
-
251
- <tr>
252
-
253
- <td style="padding:0px;margin:0px;"><table cellpadding="0" cellspacing="0" class="contactTable">
254
-
255
-
256
-
257
- <tr>
258
-
259
- <td>&nbsp;&nbsp;メールアドレス <font color="red">(必須)</font></td>
260
-
261
- <td><?php echo $_SESSION['entry']['email'];?></td>
262
-
263
- </tr>
264
-
265
- <tr>
266
-
267
- <td>&nbsp;&nbsp;ご選択カラー <font color="red">(必須)</font></td>
268
-
269
- <td>
270
-
271
- <?php echo $_SESSION['entry']['content'];?>
272
-
273
- </td>
274
-
275
- </tr>
276
-
277
-
278
-
279
- </table></td>
280
-
281
- </tr>
282
-
283
- </table>
284
-
285
- <br>
286
-
287
- <p style="text-align: center">
288
-
289
- <button type="submit" name="confirm" class="submit_confirm hover" style="opacity: 1;border: none;"> &nbsp;&nbsp; </button>
290
-
291
- </p>
292
-
293
- </form>
294
-
295
- ```

1

文法の修正

2016/12/26 18:15

投稿

Kako7788
Kako7788

スコア8

test CHANGED
File without changes
test CHANGED
@@ -6,10 +6,6 @@
6
6
 
7
7
  いろいろ試してみたのですが、
8
8
 
9
- 挿入場所等も間違っていそうなので、ほぼ全体を表示しています。(見づらくて申し訳ないです。)
10
-
11
-
12
-
13
9
  下記では、確認画面で「array」と表示されてしまいます。
14
10
 
15
11
 
@@ -58,32 +54,6 @@
58
54
 
59
55
 
60
56
 
61
-
62
-
63
- $note = ((isset($_POST['note']))?$_POST['note']:"");
64
-
65
- $_SESSION['entry']['note']= $note;
66
-
67
-
68
-
69
- //$wantday_input_01 = ((isset($_POST['wantday-input-01']))?$_POST['wantday-input-01']:"");
70
-
71
- //$_SESSION['entry']['wantday-input-01']= $wantday_input_01;
72
-
73
-
74
-
75
- //$wantday_input_02 = ((isset($_POST['wantday-input-02']))?$_POST['wantday-input-02']:"");
76
-
77
- //$_SESSION['entry']['wantday-input-02']= $wantday_input_02;
78
-
79
-
80
-
81
-
82
-
83
- //$wantplace = ((isset($_POST['wantplace']))?$_POST['wantplace']:"");
84
-
85
- //$_SESSION['entry']['wantplace']= $wantplace;
86
-
87
57
  echo "<script> window.location.href='confirm0.php'; </script>";
88
58
 
89
59
 
@@ -192,14 +162,6 @@
192
162
 
193
163
  </tr>
194
164
 
195
- <tr>
196
-
197
- <td>&nbsp;&nbsp;備考</td>
198
-
199
- <td><textarea cols="40" rows="3" name="note"></textarea></td>
200
-
201
- </tr>
202
-
203
165
  </table></td>
204
166
 
205
167
  </tr>
@@ -244,142 +206,36 @@
244
206
 
245
207
  $from_addr = 'info@hoge.jp';
246
208
 
247
- $subject = "【自動返信メール】●●株式会社";
209
+ (省略)
248
-
249
- $message .= 'この度は●●株式会社へお問い合わせいただき、ありがとうございました。'."\n";
210
+
250
-
251
- $message .= '下記確認の後、担当者よりご連絡差し上げます。'."\n";
211
+
252
-
253
- $message .= "\n".'===================================='."\n";
212
+
254
-
255
- $message .= '【ご入力いただいた内容】'."\n";
213
+
256
-
257
-
258
-
259
-
260
-
261
-
262
-
214
+
215
+
216
+
263
- if($_SESSION['entry']['name'] || $_SESSION['entry']['name'] ) {
217
+ if($_SESSION['entry']['email']) {
264
-
218
+
265
- $message .= 'お名前: '.$_SESSION['entry']['name'].' '.$_SESSION['entry']['name']."\n";
219
+ $message .= 'メールアドレス: '.$_SESSION['entry']['email']."\n";
220
+
221
+ }
222
+
223
+
224
+
225
+ if($_POST['entry']['content']) {
226
+
227
+ $message .= 'ご選択カラー: '.$_POST['entry']['content']."\n";
266
228
 
267
229
  }
268
230
 
269
-
270
-
271
-
272
-
273
- if($_SESSION['entry']['phone']) {
231
+
274
-
275
- $message .= '電話番号: '.$_SESSION['entry']['phone']."\n";
232
+
276
-
277
- }
278
-
279
-
280
-
281
- if($_SESSION['entry']['email']) {
282
-
283
- $message .= 'メールアドレス: '.$_SESSION['entry']['email']."\n";
284
-
285
- }
286
-
287
-
288
-
289
- if($_POST['entry']['content']) {
290
-
291
- $message .= 'ご選択カラー: '.$_POST['entry']['content']."\n";
292
-
293
- }
294
-
295
-
296
-
297
- if($_SESSION['entry']['note']) {
298
-
299
- $message .= '備考: '.$_SESSION['entry']['note']."\n";
300
-
301
- }
302
-
303
- $subject = mb_convert_encoding($subject, 'JIS', 'UTF-8');
304
-
305
- $subject = '=?iso-2022-jp?B?' . base64_encode($subject) . '?=';
306
-
307
- $message = mb_convert_encoding($message, 'JIS', 'UTF-8');
308
-
309
-
310
-
311
- $subject2 = mb_convert_encoding($subject2, 'JIS', 'UTF-8');
312
-
313
- $subject2 = '=?iso-2022-jp?B?' . base64_encode($subject2) . '?=';
314
-
315
- $message2 = mb_convert_encoding($message2, 'JIS', 'UTF-8');
316
-
317
-
318
-
319
-
320
-
321
- // lay ten nguoi gui gan vao header gui cho admin
322
-
323
- $from_name = $_SESSION['entry']['name'];
324
-
325
- $from_name = mb_convert_encoding($from_name, 'JIS', 'UTF-8');
326
-
327
- $from_name = '=?iso-2022-jp?B?' . base64_encode($from_name) . '?=';
328
-
329
- $from = "".$from_name;
330
-
331
-
332
-
333
- // header gui cho khach hang
334
-
335
- $header = "X-Mailer: PHP5\n";
336
-
337
- $header .= "From: info@hoge.jp\n";
338
-
339
- $header .= "MIME-Version: 1.0\n";
340
-
341
- $header .= "Content-Type: text/plain; charset=\"iso-2022-jp\"\n";
342
-
343
-
344
-
345
- // header gui cho admin
346
-
347
- $header2 = "X-Mailer: PHP5\n";
348
-
349
- $header2 .= "From: $from_addr\n";
350
-
351
- $header2 .= "MIME-Version: 1.0\n";
352
-
353
- $header2 .= "Content-Type: text/plain; charset=\"iso-2022-jp\"\n";
354
-
355
-
356
-
357
- if (mail($from_addr, $subject2, $message2, $header2)) {
358
-
359
- //mail to customer
360
-
361
- mail($to, $subject, $message, $header);
362
-
363
- unset($_POST);
233
+ (省略)
364
-
365
- unset($_SESSION['entry']);
366
-
367
- session_destroy();
368
-
369
- echo '<script>
370
-
371
- location.href = "thanks.html";
372
-
373
- </script>';
374
234
 
375
235
  }
376
236
 
377
237
  }
378
238
 
379
-
380
-
381
-
382
-
383
239
  ?>
384
240
 
385
241
 
@@ -396,25 +252,7 @@
396
252
 
397
253
  <td style="padding:0px;margin:0px;"><table cellpadding="0" cellspacing="0" class="contactTable">
398
254
 
399
-
400
-
401
-
402
-
403
- <tr>
255
+
404
-
405
- <td>&nbsp;&nbsp;お名前 <font color="red">(必須)</font></td>
406
-
407
- <td> <?php echo $_SESSION['entry']['name'];?> </td>
408
-
409
- </tr>
410
-
411
- <tr>
412
-
413
- <td>&nbsp;&nbsp;電話番号 <font color="red">(必須)</font></td>
414
-
415
- <td><?php echo $_SESSION['entry']['phone'];?></td>
416
-
417
- </tr>
418
256
 
419
257
  <tr>
420
258
 
@@ -436,13 +274,7 @@
436
274
 
437
275
  </tr>
438
276
 
439
- <tr>
277
+
440
-
441
- <td>&nbsp;&nbsp;備考</td>
442
-
443
- <td><?php echo $_SESSION['entry']['note'];?></td>
444
-
445
- </tr>
446
278
 
447
279
  </table></td>
448
280