Skip to content
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

Users Folder #7

Open
Anitalex opened this issue Nov 16, 2018 · 2 comments
Open

Users Folder #7

Anitalex opened this issue Nov 16, 2018 · 2 comments

Comments

@Anitalex
Copy link

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.....

New
query($sql);
if ($result->num_rows > 0) {
    echo "<table style=width:80% align=center border=thick><tr><th>First Name</th><th>Last Name</th><th>Company</th><th>Email</th><th>Username</th></tr>";
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo "<tr><td>".$row["first_name"]."</td><td>".$row["last_name"]."</td><td>".$row["company"]."</td><td>".$row["email"]."</td><td>".$row["username"]."</td></tr><br>";
    }
} else {
    echo "0 results";
}
?>
</div>
Back to main

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
Copy link
Author

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant