diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..a9dbf02 --- /dev/null +++ b/functions.php @@ -0,0 +1,50 @@ +Username/password is incorrect."; + } + } +} + // If form submitted, insert values into the database. +function register () +{ + if (isset($_REQUEST['username'])) { + global $con; + // removes backslashes + $username = stripslashes($_REQUEST['username']); + //escapes special characters in a string + $username = mysqli_real_escape_string($con,$username); + $email = stripslashes($_REQUEST['email']); + $email = mysqli_real_escape_string($con,$email); + $password = stripslashes($_REQUEST['password']); + $password = mysqli_real_escape_string($con,$password); + $query = "INSERT into users (userLogin, userPass, userEmail) + VALUES ('$username', '$password', '$email')"; + $result = mysqli_query($con,$query); + if ($result) { + echo "
+

You are registered successfully.

+
Click here to Login
"; + } + } +} +?> diff --git a/index.php b/index.php index 5787afa..e7960a5 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,6 @@ + @@ -20,12 +23,12 @@
- - +
-

Not registered yet? Register Here

+

Not registered yet? Register Here

+ diff --git a/login.php b/login.php deleted file mode 100644 index b7b742f..0000000 --- a/login.php +++ /dev/null @@ -1,27 +0,0 @@ - -

Username/password is incorrect.

-
Click here to Login"; - } -} -?> diff --git a/registration.php b/registration.php index ced1ed8..fc43d11 100644 --- a/registration.php +++ b/registration.php @@ -1,45 +1,37 @@ + - - Registration - + + + + + + - -

You are registered successfully.

-
Click here to Login"; - } - } else { -?> -
-

Registration

-
- - - - -
+
+
+
+ +

WebShop NeXt

+
+
+
+

Registration

+
+ + + + +
+ +
- diff --git a/registrationindex.php b/registrationindex.php deleted file mode 100644 index 5c99b36..0000000 --- a/registrationindex.php +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - -
-
-
- -

WebShop NeXt

- - - - - -
-
-
- - diff --git a/template.html b/template.html deleted file mode 100644 index f71a748..0000000 --- a/template.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - -
-
-
- - - -
-
-
-

Some title

- -