Ik krijg de volgende meldingen:
Username already in use.
Passwords don't match or Password fields are empty.
Congratulations, your registration was succesfull.
Bij het volgende script:
Maar hij schijnt nix aan de database toe te voegen, kan iemand mij hiermee helpen?
Username already in use.
Passwords don't match or Password fields are empty.
Congratulations, your registration was succesfull.
Bij het volgende script:
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
| if (!empty($_POST)) { // Connect to Server $server = mysql_connect($host,$user,$pass) or die(mysql_error()); mysql_select_db("NitroServe", $server) or die(mysql_error()); // In case of strange signs,add a \ $Username = addslashes($_POST['Username']); $Password1 = addslashes($_POST['Password1']); $EAddress = addslashes($_POST['EAddress']); $FirstName = addslashes($_POST['FirstName']); $LastName = addslashes($_POST['LastName']); $Country = addslashes($_POST['Country']); $ZipPostal = addslashes($_POST['ZipPostal']); $Address = addslashes($_POST['Address']); $City = addslashes($_POST['City']); $Service = addslashes($_POST['Service']); $CustomWebspace = addslashes($_POST['CustomWebspace']); $CustomFTPUsers = addslashes($_POST['CustomFTPUsers']); $CustomPOP3Addresses = addslashes($_POST['CustomPOP3Addresses']); // Insert to tables (INSERT) $sql = "INSERT INTO userinfo (Username, Password, Email, Name, LastName, Country, ZipOrPostal, Address, City, Service, Webspace, FTPusers, POPaccounts) VALUES ('$Username', '$Password1', '$EAddress', '$FirstName', '$LastName', '$Country', '$ZipPostal', '$Address', '$City', '$Service', '$CustomWebspace', '$CustomFTPusers', '$CustomPOP3Addresses')"; //Username check $sql = "SELECT username FROM Userinfo WHERE username LIKE '$username'"; $result = mysql_query($sql) or die(mysql_error()); if ($row = mysql_fetch_object ($result)) { echo "Username already in use.<br>"; } //Password match if ($Password1 =="" OR $Password1 != $Password2) { echo "Passwords don't match or Password fields are empty.<br>"; } // Exexute SQL mysql_query($sql) or die(mysql_error()); //Complete echo "Congratulations, your registration was succesfull."; } |
Maar hij schijnt nix aan de database toe te voegen, kan iemand mij hiermee helpen?
[ Voor 11% gewijzigd door curry684 op 29-10-2003 11:50 . Reden: [php]-tags ]