gavin.sibley Posted May 23, 2012 Share Posted May 23, 2012 Hello, Im trying to set up a page that will redirect users to other pages depending on there login credentials. The user name is stored in the under user_login and the page i want them to be redirected to is in the same table and is called HomePage. I havent got a clue when it comes to php so any help would be much appreciated. thanks, gavin Quote Link to comment Share on other sites More sharing options...
scootstah Posted May 23, 2012 Share Posted May 23, 2012 You can redirect with: header('location:http://example.com'); exit; Quote Link to comment Share on other sites More sharing options...
gavin.sibley Posted May 23, 2012 Author Share Posted May 23, 2012 Thats great thanks, any idea on how i would change this redirect using a field in a database depending on the current logged in user? i.e redirect to page 1 when user 1 logged in, redirect to page 2 when user 2 logged in etc. thanks, gavin Quote Link to comment Share on other sites More sharing options...
scootstah Posted May 23, 2012 Share Posted May 23, 2012 Do you know how to run SQL queries and retrieve data from the database? All you need to do is retrieve the specific user and stick the HomePage into the header(). Quote Link to comment Share on other sites More sharing options...
gavin.sibley Posted May 23, 2012 Author Share Posted May 23, 2012 Not the foggiest im sorry, i never use php im building a site in wordpress but need to add this one line of php to be able to set up this redirect. Quote Link to comment Share on other sites More sharing options...
Jessica Posted May 23, 2012 Share Posted May 23, 2012 I think what you're looking for is "pretty urls" with modrewrite. you have one profile page, and it takes a parameter like the user's name. But the URL just has their name, not the page that does the processing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.