Informatie verkrijgen uit dropdownselectie
Wie kan mij helpen?
THNX Ton
<table align='center' border='0' cellspacing='0' cellpadding='0' class='tbl'>
<form name='mygallery' method='post' action='".FUSION_SELF."'>
<select name='picture' onChange='showimage()' class='textbox' style='width:190px;'>
<option selected value='/ecards/me.gif'>Picture of me</option>
<option value='/ecards/myaunt.gif'>Picture of my aunt</option>
<option value='/ecards/brother.gif'>Picture of my brother</option>
</select>
</form>
<br>
<td width='100%'><center><img src='/ecards/me.gif' name='pictures' width='100'
height='100'></td>
<br>
</tr></table>
document.mygallery.picture.value
In PHP:
$_POST['picture']
Ik had dit al geprobeerd maar picture blijkt leeg wanneer ik dit mee wil versturen (mail).
Ik zal het stuk code wat ik gebruik voor PHP-Fusion hierbij voegen;
Code (php)
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
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
<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*
| Modified by rtt - www.apbsquad.nl for mod
| tellafriend.php - 20-01-2006
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."tellafriend.php";
echo "<script language='javascript'>
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
</script>";
if (isset($_POST['sendmessage'])) {
$mailname = stripinput($_POST['mailname']);
$email = stripinput($_POST['email']);
$tomailname = stripinput($_POST['tomailname']);
$tomail = stripinput($_POST['toemail']);
$subject = "Website - ";
$subject .= $settings['sitename'];
$message = $locale['409'];
$picturename = stripinput($_POST['picture']);
if ($mailname == "") {
$error .= "· <span class='alt'>".$locale['420']."</span><br>\n";
}
if ($email == "") {
$error .= "· <span class='alt'>".$locale['421']."</span><br>\n";
}
if ($_POST['tomailname'] == "") {
$error .= "· <span class='alt'>".$locale['422']."</span><br>\n";
}
if ($_POST['toemail'] == "") {
$error .= "· <span class='alt'>".$locale['423']."</span><br>\n";
}
if ($_POST['message'] == "") {
$error .= "· <span class='alt'>".$locale['424']."</span><br>\n";
}
if (!$error) {
require_once INCLUDES."sendmail_include.php";
$tomailname .= ", \n\n";
$tomailname .= $message;
$tomailname .= $picturename;
sendemail($tomailname,$toemail,$mailname,$email,$subject,$tomailname);
opentable($locale['400']);
echo "<center><br>\n".$locale['440']."<br><br>\n".$locale['441']."</center><br>\n";
closetable();
} else {
opentable($locale['400']);
echo "<center><br>\n".$locale['442']."<br><br>\n$error<br>\n".$locale['443']."</center><br>\n";
closetable();
}
} else {
opentable($locale['400']);
echo $locale['401']."<br><br>
<table align='center' border='0' cellspacing='0' cellpadding='0' class='tbl'>
<form name='mygallery' method='post' action='".FUSION_SELF."'>
<select name='picture' onChange='showimage()' class='textbox' style='width:190px;'>
<option selected value='/ecards/me.gif'>Picture of me</option>
<option value='/ecards/myaunt.gif'>Picture of my aunt</option>
<option value='/ecards/brother.gif'>Picture of my brother</option>
</select>
</form>
<br>
<td width='100%'><center><img src='/ecards/me.gif' name='picture' width='100'
height='100'></td>
<br>
</tr></table>
<form name='userform' method='post' action='".FUSION_SELF."'>
<table align='center' cellpadding='0' cellspacing='0' class='tbl'>
<tr>
<td width='100'>".$locale['402']."</td>
<td><input type='text' name='mailname' maxlength='64' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['403']."</td>
<td><input type='text' name='email' maxlength='128' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['404']."</td>
<td><input type='text' name='tomailname' maxlength='64' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['405']."</td>
<td><input type='text' name='toemail' maxlength='128' class='textbox' style='width: 220px;'></td>
</tr>
<tr><td valign='top' width='90'>".$locale['407']."</td>
<td><textarea name='message' rows='10' class='textbox' style='width: 320px'>".$locale['409']."</textarea> </td>
</tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' name='sendmessage' value='".$locale['408']."' class='button'>
</td>
</tr>
</table>
</form>\n";
closetable();
}
require_once "side_right.php";
require_once "footer.php";
?>
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------*
| Modified by rtt - www.apbsquad.nl for mod
| tellafriend.php - 20-01-2006
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."tellafriend.php";
echo "<script language='javascript'>
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
</script>";
if (isset($_POST['sendmessage'])) {
$mailname = stripinput($_POST['mailname']);
$email = stripinput($_POST['email']);
$tomailname = stripinput($_POST['tomailname']);
$tomail = stripinput($_POST['toemail']);
$subject = "Website - ";
$subject .= $settings['sitename'];
$message = $locale['409'];
$picturename = stripinput($_POST['picture']);
if ($mailname == "") {
$error .= "· <span class='alt'>".$locale['420']."</span><br>\n";
}
if ($email == "") {
$error .= "· <span class='alt'>".$locale['421']."</span><br>\n";
}
if ($_POST['tomailname'] == "") {
$error .= "· <span class='alt'>".$locale['422']."</span><br>\n";
}
if ($_POST['toemail'] == "") {
$error .= "· <span class='alt'>".$locale['423']."</span><br>\n";
}
if ($_POST['message'] == "") {
$error .= "· <span class='alt'>".$locale['424']."</span><br>\n";
}
if (!$error) {
require_once INCLUDES."sendmail_include.php";
$tomailname .= ", \n\n";
$tomailname .= $message;
$tomailname .= $picturename;
sendemail($tomailname,$toemail,$mailname,$email,$subject,$tomailname);
opentable($locale['400']);
echo "<center><br>\n".$locale['440']."<br><br>\n".$locale['441']."</center><br>\n";
closetable();
} else {
opentable($locale['400']);
echo "<center><br>\n".$locale['442']."<br><br>\n$error<br>\n".$locale['443']."</center><br>\n";
closetable();
}
} else {
opentable($locale['400']);
echo $locale['401']."<br><br>
<table align='center' border='0' cellspacing='0' cellpadding='0' class='tbl'>
<form name='mygallery' method='post' action='".FUSION_SELF."'>
<select name='picture' onChange='showimage()' class='textbox' style='width:190px;'>
<option selected value='/ecards/me.gif'>Picture of me</option>
<option value='/ecards/myaunt.gif'>Picture of my aunt</option>
<option value='/ecards/brother.gif'>Picture of my brother</option>
</select>
</form>
<br>
<td width='100%'><center><img src='/ecards/me.gif' name='picture' width='100'
height='100'></td>
<br>
</tr></table>
<form name='userform' method='post' action='".FUSION_SELF."'>
<table align='center' cellpadding='0' cellspacing='0' class='tbl'>
<tr>
<td width='100'>".$locale['402']."</td>
<td><input type='text' name='mailname' maxlength='64' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['403']."</td>
<td><input type='text' name='email' maxlength='128' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['404']."</td>
<td><input type='text' name='tomailname' maxlength='64' class='textbox' style='width: 220px;'></td>
</tr>
<tr>
<td width='100'>".$locale['405']."</td>
<td><input type='text' name='toemail' maxlength='128' class='textbox' style='width: 220px;'></td>
</tr>
<tr><td valign='top' width='90'>".$locale['407']."</td>
<td><textarea name='message' rows='10' class='textbox' style='width: 320px'>".$locale['409']."</textarea> </td>
</tr>
<tr>
<td align='center' colspan='2'>
<input type='submit' name='sendmessage' value='".$locale['408']."' class='button'>
</td>
</tr>
</table>
</form>\n";
closetable();
}
require_once "side_right.php";
require_once "footer.php";
?>