php dynamic link help
Moderator: General Moderators
php dynamic link help
hello all and thank you for your help with the community,
i'm kinda stuck and need some help.. let me begin by telling you what i want to do and then i'll ask you how i should approach the task...
i'm creating a website that will have video tutorials on 3d design... none of these videos will be user submitted all of them will be submitted by me.
i have all of the site coded except for the video section... what i want to do is have a rank table.. like say 0=guest, 1=registered, 2= gold member.
i want a page that will display all of the videos but only those that match the current users rank will be clickable. please look at this site to explain what i'm talking about.
http://movielibrary.lynda.com/html/modPage.asp?ID=560, if you look at that page you will see that some videos you can view and some you cannot untill you login.
all the videos will be stored in mysql with prolly about 3-4 fields: vid_id, title, src, catagory. when the link is clicked it will call the video by id and play it in a pop-up. but some videos can only be seen by gold members. i already have a pretty good login script being used. the current login script uses sessions and mysql.
how should i go about creating this video section... i dont neccesarilly need code but more a run down of what should take place. but code would also be nice... i cant afford much but i would be willing to pay some money if i needed to... i thank you for your time reading this and your time of solving my problem...
thank you,
Edanlee
i'm kinda stuck and need some help.. let me begin by telling you what i want to do and then i'll ask you how i should approach the task...
i'm creating a website that will have video tutorials on 3d design... none of these videos will be user submitted all of them will be submitted by me.
i have all of the site coded except for the video section... what i want to do is have a rank table.. like say 0=guest, 1=registered, 2= gold member.
i want a page that will display all of the videos but only those that match the current users rank will be clickable. please look at this site to explain what i'm talking about.
http://movielibrary.lynda.com/html/modPage.asp?ID=560, if you look at that page you will see that some videos you can view and some you cannot untill you login.
all the videos will be stored in mysql with prolly about 3-4 fields: vid_id, title, src, catagory. when the link is clicked it will call the video by id and play it in a pop-up. but some videos can only be seen by gold members. i already have a pretty good login script being used. the current login script uses sessions and mysql.
how should i go about creating this video section... i dont neccesarilly need code but more a run down of what should take place. but code would also be nice... i cant afford much but i would be willing to pay some money if i needed to... i thank you for your time reading this and your time of solving my problem...
thank you,
Edanlee
Re: php dynamic link help
can anyone please help me with this.. atleast explain how to do the whole .php?vid=12
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: php dynamic link help
What is your objective?
It sounds like you want to know how to list user-specific links and then you talk about url variables.
Explaid in brief what you're trying to do.
It sounds like you want to know how to list user-specific links and then you talk about url variables.
Explaid in brief what you're trying to do.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: php dynamic link help
Simply put, .php?vid=12
Code: Select all
$vid = $_GET['vid']; //12Re: php dynamic link help
i dont much understand what your telling me to do... but what i want to do is have a pop up that will play a movie based on what link they click... so the pop up will always have the same url but the variable will be defined by the link... like popup.php?vid=12, popup.php?vid=13, and so forth all based on what link they clicked...
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: php dynamic link help
when listing the results, simlpy append the movie id to the url
Then on your movie page, you provide the $_GET['id'] from the link into your query
Clearer?
Code: Select all
while ($row = mysql_fetch_assoc(... )) {
echo '<a href="movie.php?id='. $row['id'].'">'. $row['title'].'</a> <br >';
}Code: Select all
$id = isset($_GET['id']) ? intval($_GET['id']) : 0; //basic sanitation
$sql = 'SELECT * FROM movies WHERE id = '. intval($id);
$result = mysql_query($sql) or die(mysql_error());
// etcRe: php dynamic link help
that is exactly what i was looking for... thank you so much
Re: php dynamic link help
I see you have what you need now but I was a little confused by your link here, this is an asp page but you are trying to use php on it?edanlee wrote: http://movielibrary.lynda.com/html/modPage.asp?ID=560
AMCH
PS: Upon re-examination of the article I have realised that this is not your page but an example of the functionality you require using php instead of asp. It's late!
Re: php dynamic link help
yes thats the gameplan is to have something similar to that website. if i can tackle it. but thank you for your help.
Edanlee
Edanlee
Re: php dynamic link help
this is to show the movie, but where was the rank part taken care of? Wouldn't you use a query to check if the user has access to that video?
Re: php dynamic link help
well i just assumed i would have to come up with that part on my own... i already have a login system that uses sessions... i guess i would have to register the rank from the users database entry and using a if statement check to see if the users rank matches the rank required for the movie and if not then display a error.kryles wrote:this is to show the movie, but where was the rank part taken care of? Wouldn't you use a query to check if the user has access to that video?
edanlee