Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/238307-help-with-pagination/
Share on other sites

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.

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.