Jump to content

Different redirection for each registered user


hariskar

Recommended Posts

I have made for each registered user a page with his pdf examination results. Is it possible if registered user A clicks on menu item "results" to open results-page-A, if another registered user eg B clicks again on "results", open results-page-B, so that each registered user can see only his results?Can I do this with javascript?Thank you

Link to comment
Share on other sites

PHP is probably preferrable. This way you can serve the content based on who is logged in. How do you know who is viewing the site at the moment?

Link to comment
Share on other sites

A possible way to set this up is: 1) If a user clicks the results link/manually types in the address it redirects them to a login/register page.2) When a logged in user goes to the page you can search your database to see if they have completed their survey. - If they haven't redirect them to the survey page. - If they have filled out the survey just gather their specific results from the database. Done.~Krewe (Edit: This would be using PHP, not Javascript)

Link to comment
Share on other sites

Thank you, but I would like what I mentioned in my previous post to happen to already logged in users, there is no need to redirect to login page.Also, there is no survey. I would like for each registered and logged in user when he clicks on "result" to see a page with his pdfs I have uploaded for him only.

Link to comment
Share on other sites

When a user logs in I assume you're storing their information in the session or something so that you can tell who is logged in. So, on the results page, get that information from the session and look up their results. You wouldn't do that with Javascript, you would use a language like PHP on the server.

Link to comment
Share on other sites

Thank you, but I would like what I mentioned in my previous post to happen to already logged in users, there is no need to redirect to login page.Also, there is no survey. I would like for each registered and logged in user when he clicks on "result" to see a page with his pdfs I have uploaded for him only.
That's what Ingolme has been saying. If you have a registration/login system, then surely your code should know that a given user is currently logged in. That should be sufficient to make a mapping to only the relevant documents/assets/etc that they should have access too.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...