-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix routing and validations #310
Open
edsaur
wants to merge
49
commits into
BryanTheLai:main
Choose a base branch
from
edsaur:fix-routing-and-login-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MOHDaazam
approved these changes
May 18, 2024
Reservations, staff-login and most likely others not working, issue related to index.php routing. |
Hi, @BryanTheLai! I've already done the migration of the staff page to the routing. I'll do fix the processes of each of the staffs. Thanks <3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
I have come to contribute to your project and expand my experience in using PHP along with jQuery AJAX. I have added along changes in this project that I will explain below:
Adding Routes and Subfolders for view files, processes, etc
The current version of the routing is very messy (Ex:
localhost/customer/customerSide/home.php
). To fix this, there's an addition to the .htaccess file in the root which configures the Apache server to look on index.php for requests.Index.php and its routes.
If you check index.php now it contains the shorthand route to the pages along where folder does these pages are. The changes are when we are now adding new files to the project the routing is now coming from index.php.
Example:
localhost is at Home.php trying to access the Registration page
From
<a href="../registration/registration.php">Register</a>
To
Saying the path of registration is set in index.php
<a href ="/register>Register</a>"
New folders?!
To reduce confusions whether where is what, I have put it in a simple and organized folder system...
Fixing the Sign Up and Login Validation
Right now, the current version of validating the login page is very long process. It takes up time and also it is very messy to see especially if there will be soon bug fixes or adding new features to the process of the login.
Instead... I have shorten the codes.
I have used my own database connection (database-connection.php, also used this in registration (included in this pull request too) You could check it out too). The database connection itself contains the function of querying.
To reduce time complexity and loading per process of validation, I have used jQuery and Ajax so that it will just eat a little time to validate and so that users can see right away the errors without having the page reloading. The processes of both Customer's registration and login decodes a json response which the js files process on.
Be Secure!
For an extra layer of security and reduce the chances of MySQL Injection, when we're checking, inserting, updating, deleting values I've come with an extra params per functions that will accept an array of the values that we are inserting, getting, deleting or updating.
Example:
From
To
New additions...
I might add new fixes to site.
Thank you!