martinontcode / Membership-system

Membership system written in PHP, includes registration form, login form.
MIT License
44 stars 20 forks source link

Users Folder #7

Open Anitalex opened 5 years ago

Anitalex commented 5 years ago

I realize this has not been updated in 2 years and I was hoping you could still help. I am new to doing this and I am using this to create a website login. I like it and it works as is on my system but I would like to clean it up so that everything related to login and users be put on a Users folder in the root directory. So what I have done is changed the views directory to users directory. I have created a projects, reports, and schedule directories. I added this to the loginTrue.php now in the users directory.

        <a href="projects/projects.php">Projects</a><br>
        <!-- Schedule link -->
        <a href="schedules/schedule.php">Schedule</a><br>
        <!-- Reports link -->
        <a href="reports/reports.php">Reports</a><br>
        <!-- Users link -->
        <a href="users/users.php">Users</a><br>
        <!-- Profile link -->
        <a href="profile.php">Account settings</a><br>

So each folder has a new php file named after the folder. Users.php has this code..... <?php include_once 'header.php'; require ("config/dbconnect.php"); ?>

New
query($sql); if ($result->num_rows > 0) { echo ""; // output data of each row while($row = $result->fetch_assoc()) { echo "
"; } } else { echo "0 results"; } ?>

The problem is right here on the last line. When clicking the link it does go back to loginTrue.php but I lose all of the css in the header. The header is there but the formatting is off.

I understand if you are not around anymore or if you don't want to help. Again, your code works its just my understanding of how it works that is flawed :P

Thanks in advanced if you do try to help

Anitalex commented 5 years ago

A little more information. I have created a file called users.php in the same folder as accountSettings.php. I have copied the code from accountSettings.php to users.php and changed the text of Account to User. Then I add a link on loginTrue.php to point to the users.php. When I go to users.php the header shows the logged out header and the css is messed up. When I go to accountSettings.php everything looks fine. I don't get it. :) my destinations files are in the same place being linked from the same place with virutally the same code.

Anitalex commented 5 years ago

Ok just found it....It is because the link for Account Settings on the loginTrue.php goes first to root directory and gets profile.php. Then goes to accountSettings.php. Man that sucks to have to do that just to get it to work. :) but I figured it out, yay!! Thanks for the help, LOL yeah I know you think I am crazy but I have been doing this for about 4 hours now and am still learning.

First NameLast NameCompanyEmailUsername
".$row["first_name"]."".$row["last_name"]."".$row["company"]."".$row["email"]."".$row["username"]."