Wat is er fout?!
<html>
<head>
<title>SoundSharx.com</title>
<link rel="stylesheet" id="Stylesheet" title="Stylesheet" href="http://stylesheets.soundsharx.com/style.css"
</head>
<body>
<div align="center">
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
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
<?php
$mysql_gebruikersnaam = "soundsha_root";
$mysql_wachtwoord = "root";
$mysql_host = "localhost";
$mysql_database = "soundsha_nieuwsbrief";
if(!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_gebruikersnaam, $mysql_wachtwoord)))
{
echo "
<script language=\"JavaScript\">
alert ('Error!');
</script>
";
exit();
}
if($_GET["Action"] == "Register")
{
if($_POST["Voornaam"] && $_POST["Achternaam"] && $_POST["Leeftijd"] && $_POST["Geslacht"] && $_POST["Wachtwoord"])
{
$sql_select_email = "SELECT eMail FROM leden WHERE eMail = '$_POST[eMail]'";
$res_select_email = mysql_query($sql_select_email);
if(mysql_num_rows($res_select_email) >= 1)
{
echo "
<script language=\"JavaScript\">
alert ('Email already exist!');
</script>
";
}
else
{
$Datum = date("d.m.Y h:i:s");
$sql_insert_member = "INSERT INTO leden SET ID = '', Voornaam = '$_POST[Voornaam]', Achternaam = '$_POST[Achternaam]', Geslacht = '$_POST[Geslacht]', Leeftijd = '$_POST[Leeftijd]', eMail = '$_POST[eMail]', Wachtwoord = '$_POST[Wachtwoord]'";
$res_insert_member = mysql_query($sql_insert_member);
if($res_insert_member)
{
echo "
<script language=\"JavaScript\">
alert ('You are registrated!');
</script>
";
}
else
{
echo "
<script language=\"JavaScript\">
alert ('Error!');
</script>
";
exit();
}
}
}
else
{
echo "
<script language=\"JavaScript\">
alert ('You left somthing empty!');
</script>
";
}
}
echo "
<form action=\"$PHP_SELF\" method=\"post\">
<table width=\"40%\" border=\"0\">
<tr>
<td rowspan=\"8\"><img src=\"http://images.soundsharx.com/logoklein.jpg\" name=\"Logo\" title=\"Logo\" id=\"Logo\"></td>
<td colspan=\"2\"><font color=\"#999999\" size=\"2\" face=\"Verdana\">Register yourself
for our newsletter</font></td>
</tr>
<tr>
<td width=\"14%\"><font size=\"2\" face=\"Verdana\">First name</font></td>
<td width=\"86%\"><input name=\"Voornaam\" type=\"text\" id=\"Voornaam\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Last name</font></td>
<td><input name=\"Achternaam\" type=\"text\" id=\"Achternaam\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Sex</font></td>
<td><select name=\"Geslacht\" size=\"1\" id=\"Geslacht\">
<option value=\"Man\">Male</option>
<option value=\"Vrouw\">Female</option>
</select></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Age</font></td>
<td><input name=\"Leeftijd\" type=\"text\" id=\"Leeftijd\" size=\"3\" maxlength=\"3\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">eMail</font></td>
<td><input name=\"eMail\" type=\"text\" id=\"eMail\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Password</font></td>
<td><input name=\"Wachtwoord\" type=\"password\" id=\"Wachtwoord\"></td>
</tr>
<tr>
<td>
<a href=\"http://newsletter.soundsharx.com/index.php?Action=Register\">
<img src=\"http://buttons.soundsharx.com/register.gif\" title=\"Register\" border=\"0\" id=\"Register\" name=\"Register\" alt=\"Register\">
</a>
</td>
<td>
<a href=\"http://newsletter.soundsharx.com/index.php\">
<img src=\"http://buttons.soundsharx.com/reset.gif\" title=\"Reset\" border=\"0\" id=\"Reset\" name=\"Reset\" alt=\"Reset\">
</a>
</td>
</tr>
</table>
</form>
";
?>
$mysql_gebruikersnaam = "soundsha_root";
$mysql_wachtwoord = "root";
$mysql_host = "localhost";
$mysql_database = "soundsha_nieuwsbrief";
if(!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_gebruikersnaam, $mysql_wachtwoord)))
{
echo "
<script language=\"JavaScript\">
alert ('Error!');
</script>
";
exit();
}
if($_GET["Action"] == "Register")
{
if($_POST["Voornaam"] && $_POST["Achternaam"] && $_POST["Leeftijd"] && $_POST["Geslacht"] && $_POST["Wachtwoord"])
{
$sql_select_email = "SELECT eMail FROM leden WHERE eMail = '$_POST[eMail]'";
$res_select_email = mysql_query($sql_select_email);
if(mysql_num_rows($res_select_email) >= 1)
{
echo "
<script language=\"JavaScript\">
alert ('Email already exist!');
</script>
";
}
else
{
$Datum = date("d.m.Y h:i:s");
$sql_insert_member = "INSERT INTO leden SET ID = '', Voornaam = '$_POST[Voornaam]', Achternaam = '$_POST[Achternaam]', Geslacht = '$_POST[Geslacht]', Leeftijd = '$_POST[Leeftijd]', eMail = '$_POST[eMail]', Wachtwoord = '$_POST[Wachtwoord]'";
$res_insert_member = mysql_query($sql_insert_member);
if($res_insert_member)
{
echo "
<script language=\"JavaScript\">
alert ('You are registrated!');
</script>
";
}
else
{
echo "
<script language=\"JavaScript\">
alert ('Error!');
</script>
";
exit();
}
}
}
else
{
echo "
<script language=\"JavaScript\">
alert ('You left somthing empty!');
</script>
";
}
}
echo "
<form action=\"$PHP_SELF\" method=\"post\">
<table width=\"40%\" border=\"0\">
<tr>
<td rowspan=\"8\"><img src=\"http://images.soundsharx.com/logoklein.jpg\" name=\"Logo\" title=\"Logo\" id=\"Logo\"></td>
<td colspan=\"2\"><font color=\"#999999\" size=\"2\" face=\"Verdana\">Register yourself
for our newsletter</font></td>
</tr>
<tr>
<td width=\"14%\"><font size=\"2\" face=\"Verdana\">First name</font></td>
<td width=\"86%\"><input name=\"Voornaam\" type=\"text\" id=\"Voornaam\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Last name</font></td>
<td><input name=\"Achternaam\" type=\"text\" id=\"Achternaam\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Sex</font></td>
<td><select name=\"Geslacht\" size=\"1\" id=\"Geslacht\">
<option value=\"Man\">Male</option>
<option value=\"Vrouw\">Female</option>
</select></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Age</font></td>
<td><input name=\"Leeftijd\" type=\"text\" id=\"Leeftijd\" size=\"3\" maxlength=\"3\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">eMail</font></td>
<td><input name=\"eMail\" type=\"text\" id=\"eMail\" maxlength=\"255\"></td>
</tr>
<tr>
<td><font size=\"2\" face=\"Verdana\">Password</font></td>
<td><input name=\"Wachtwoord\" type=\"password\" id=\"Wachtwoord\"></td>
</tr>
<tr>
<td>
<a href=\"http://newsletter.soundsharx.com/index.php?Action=Register\">
<img src=\"http://buttons.soundsharx.com/register.gif\" title=\"Register\" border=\"0\" id=\"Register\" name=\"Register\" alt=\"Register\">
</a>
</td>
<td>
<a href=\"http://newsletter.soundsharx.com/index.php\">
<img src=\"http://buttons.soundsharx.com/reset.gif\" title=\"Reset\" border=\"0\" id=\"Reset\" name=\"Reset\" alt=\"Reset\">
</a>
</td>
</tr>
</table>
</form>
";
?>
</div>
</body>
</html>
geen idee maar probeer eens met je alerts er uit te halen en kijken als het dan werkt
{
je moet dan $_GET.... veranderen in $_POST[.......
Maar de submit-button is een plaatje... Hoe moet dat dan????
gebruik <input type="image" src="" name="" value=""> enz....
Mist een >
Maar dat heeft verder niets met de vraag te maken.
maar dat werk niet, wat moet er dan als $_POST komen te staan, ik snap het niet meerr. HHHEEEEEEEEELLLLPPPPPPP!!!!!!!!
Begin eens met
<form action=\"$PHP_SELF?Action=Register\" method=\"post\">
En vervang
<a href=\"http://newsletter.soundsharx.com/index.php?Action=Register\">
<img src=\"http://buttons.soundsharx.com/register.gif\" title=\"Register\" border=\"0\" id=\"Register\" name=\"Register\" alt=\"Register\">
</a>
Voor:
<input type="image" src="http://buttons.soundsharx.com/register.gif" name="" value="Register">\
Dan worden de $_POST variabelen wel verzonden...
Waarom werkt dat dan niet????? Kijk zelf op newsletter.soundsharx.com ...
Heb hem ff verandert :)
<html>
<head>
<title>SoundSharx.com</title>
<link rel="stylesheet" id="Stylesheet" title="Stylesheet" href="http://stylesheets.soundsharx.com/style.css"
</head>
<body>
<div align="center">
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
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
<?php
error_reporting(E_ALL);
$mysql_gebruikersnaam = "soundsha_root";
$mysql_wachtwoord = "root";
$mysql_host = "localhost";
$mysql_database = "soundsha_nieuwsbrief";
if(!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_gebruikersnaam, $mysql_wachtwoord)))
{
echo "<script language='JavaScript'>alert ('Error!');</script>";
exit();
}
if(isset($_POST['register']))
{
if($_POST['voornaam'] && $_POST['achternaam'] && $_POST['leeftijd'] && $_POST['geslacht'] && $_POST['wachtwoord'] && $_POST['email'])
{
$sql_select_email = "SELECT email FROM leden WHERE email = '".$_POST["email"]."'";
$res_select_email = mysql_query($sql_select_email);
if(mysql_num_rows($res_select_email) >= 1)
{
echo " <script language='JavaScript'> alert ('email already exist!');</script>";
}
else
{
$Datum = date("d.m.Y h:i:s");
$sql_insert_member = "INSERT INTO leden SET ID = '', voornaam = '".$_POST['voornaam']."', achternaam = '".$_POST['achternaam']."', geslacht = '".$_POST['geslacht']."', leeftijd = '".$_POST['leeftijd']."', email = '".$_POST['email']."', wachtwoord = '".$_POST['wachtwoord']."'";
$res_insert_member = mysql_query($sql_insert_member);
if($res_insert_member)
{
echo "<script language='JavaScript'> alert ('You are registrated!'); </script>";
}
else
{
echo "<script language='JavaScript'> alert ('Error!'); </script>";
exit();
}
}
}
else
{
echo "<script language='JavaScript'> alert ('You left somthing empty!'); </script>";
}
}
else
{
?>
error_reporting(E_ALL);
$mysql_gebruikersnaam = "soundsha_root";
$mysql_wachtwoord = "root";
$mysql_host = "localhost";
$mysql_database = "soundsha_nieuwsbrief";
if(!@mysql_select_db($mysql_database, @mysql_connect($mysql_host, $mysql_gebruikersnaam, $mysql_wachtwoord)))
{
echo "<script language='JavaScript'>alert ('Error!');</script>";
exit();
}
if(isset($_POST['register']))
{
if($_POST['voornaam'] && $_POST['achternaam'] && $_POST['leeftijd'] && $_POST['geslacht'] && $_POST['wachtwoord'] && $_POST['email'])
{
$sql_select_email = "SELECT email FROM leden WHERE email = '".$_POST["email"]."'";
$res_select_email = mysql_query($sql_select_email);
if(mysql_num_rows($res_select_email) >= 1)
{
echo " <script language='JavaScript'> alert ('email already exist!');</script>";
}
else
{
$Datum = date("d.m.Y h:i:s");
$sql_insert_member = "INSERT INTO leden SET ID = '', voornaam = '".$_POST['voornaam']."', achternaam = '".$_POST['achternaam']."', geslacht = '".$_POST['geslacht']."', leeftijd = '".$_POST['leeftijd']."', email = '".$_POST['email']."', wachtwoord = '".$_POST['wachtwoord']."'";
$res_insert_member = mysql_query($sql_insert_member);
if($res_insert_member)
{
echo "<script language='JavaScript'> alert ('You are registrated!'); </script>";
}
else
{
echo "<script language='JavaScript'> alert ('Error!'); </script>";
exit();
}
}
}
else
{
echo "<script language='JavaScript'> alert ('You left somthing empty!'); </script>";
}
}
else
{
?>
<form method='post'>
<table width='40%' border='0'>
<tr>
<td rowspan='8'><img src='http://images.soundsharx.com/logoklein.jpg' name='Logo' title='Logo' id='Logo'></td>
<td colspan='2'><font color='#999999' size='2' face='Verdana'>Register yourself
for our newsletter</font></td>
</tr>
<tr>
<td width='14%'><font size='2' face='Verdana'>First name</font></td>
<td width='86%'><input name='voornaam' type='text' id='voornaam' maxlength='255'></td>
</tr>
<tr>
<td><font size='2' face='Verdana'>Last name</font></td>
<td><input name='achternaam' type='text' id='achternaam' maxlength='255'></td>
</tr>
<tr>
<td><font size='2' face='Verdana'>Sex</font></td>
<td><select name='geslacht' size='1' id='geslacht'>
<option value='Man'>Male</option>
<option value='Vrouw'>Female</option>
</select></td>
</tr>
<tr>
<td><font size='2' face='Verdana'>Age</font></td>
<td><input name='leeftijd' type='text' id='leeftijd' size='3' maxlength='3'></td>
</tr>
<tr>
<td><font size='2' face='Verdana'>email</font></td>
<td><input name='email' type='text' id='email' maxlength='255'></td>
</tr>
<tr>
<td><font size='2' face='Verdana'>Password</font></td>
<td><input name='wachtwoord' type='password' id='wachtwoord'></td>
</tr>
<tr>
<td>
<input type='image' src='http://buttons.soundsharx.com/register.gif' alt='register' name='register' />
</td>
<td>
<a href='http://newsletter.soundsharx.com/index.php'>
<img src='http://buttons.soundsharx.com/reset.gif' title='Reset' border='0' id='Reset' name='Reset' alt='Reset'>
</a>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>