pappakaka Posted June 3, 2011 Share Posted June 3, 2011 Hi, I have a problem with pagination. This is my site: http://www.randommovietitle.com/ When you click random you get to a new page (called movies.php) wich displays random content taken from a mysql database. When you click Randomize Again, the same thing happends and so on. What I need is so that every page has it's own URL like this somehow: What it looks like now: Content about the movie Titanic is loaded: http://www.randommovietitle.com/movies.php Content about the movie Avatar is loaded: http://www.randommovietitle.com/movies.php What I need it to look like: Content about the movie Titanic is loaded: http://www.randommovietitle.com/movies.php?mid=xxxxxx Content about the movie Avatar is loaded: http://www.randommovietitle.com/movies.php?mid=xxxxxx I know you can do this but just don't know how? Please help? Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/ Share on other sites More sharing options...
dougjohnson Posted June 3, 2011 Share Posted June 3, 2011 Could you get your random movie info, then redirect to movies.php and append the ?mid=xxxx to the url before the redirect? Or I may not understand your question? Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224623 Share on other sites More sharing options...
realneo Posted June 3, 2011 Share Posted June 3, 2011 It may not help but Do you think its because of your using POST instead of GET? Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224625 Share on other sites More sharing options...
pappakaka Posted June 3, 2011 Author Share Posted June 3, 2011 What I mean is like on the forum. When you post a new thread it get it's own URL like this: http://www.phpfreaks.com/forums/index.php?topic=335006.0 See, it adds a few lines to the URL so you can go to this page directly! I checked the code but it can't be a $_POST or $_GET problem as I'm not doing anything to make the URL specific for the page. Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224635 Share on other sites More sharing options...
dougjohnson Posted June 3, 2011 Share Posted June 3, 2011 How are you going to use the mid value? Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224636 Share on other sites More sharing options...
pappakaka Posted June 3, 2011 Author Share Posted June 3, 2011 The MID is just a short I used in the MySQL database instead of MovieID. So I tought that would be a way to keep track of each movie, or by using the title of the movie in the end like this: http://www.randommovietitle.com/movies.php?title=titanic or http://www.randommovietitle.com/movies.php?mid=123456 Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224642 Share on other sites More sharing options...
WebStyles Posted June 3, 2011 Share Posted June 3, 2011 just place another page in between. (I'll call it jump.php just for this example) every time you hit the 'random' button, send people to jump.php, that reads database, extracts random movie id and then redirects to movie.php?mid=xxxx in movie.php you use the $_GET['mid'] value to display the actual movie. this way every movie shown has a different url that can be bookmarked or sent to friends via email. hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224649 Share on other sites More sharing options...
jcbones Posted June 3, 2011 Share Posted June 3, 2011 We could help out with more detailed info, if we seen some code. Quote Link to comment https://forums.phpfreaks.com/topic/238307-help-with-pagination/#findComment-1224657 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.