![]() Equipping You to Communicate Effectively | support CMN & share a library of 19K+ images, videos, etc Go Pro! |
![]() | ![]() |
| |||||||
| Website Coding Discussions PHP, MySQL, Java, Javascript, ASP, etc. |
![]() |
| | Thread Tools | Search this Thread | Rating: | Display Modes |
| |||
| Need help! PHP, media database, popup window player Hello, I'm quite new to coding, although graduated IT some 15 years ago, but working in graphic design area since then and never practice coding seriously. For our church website which has multimedia database I need an advice in what direction should I go and perhaps dig more into coding techniques. Here's the situation: I have database with info about the stored sermons (both audio & video), i.e. date, title, speaker, location, path to the clip on site, duration etc. I want to display on page the latest 5 (for instance) sermons according to date field descending as a dynamic content, which I did (using mysql database and php code). Every displayed field has an icon which is a link to open new popup window with player playing the related chosen sermon. My problem/question is how can I pass those database-field variables of the chosen clip to the next page (popup window)? I'm using sessions to (try to) pass clip's info. I think I'm stuck because I'm using dynamic content to display the clip's info and link as a repeat region and can't figure out how to pass only the chosen (by clicking) clip's data to the new popup window. PHP code for displaying latest 5 sermons on the web page works fine, but at this moment I don't have the necessary knowledge to open the popup window player displaying and playing the correct thing. At this stage I'm concerned about the audio. The video is on vimeo and at this moment is an embedded player on the page. Excuse me for being too long, but wanted to be more specific. Any help will be highly appreciated! Please, give me some advice and example, if possible! Thank you! |
| ||||
| You could use sessions but that makes it difficult to share a link with someone. I'd suggest making a dynamic player page, and on your index page, use the information collected from the user input to formulate specific url for the player. Example: http://www.domain.com/player.php?video_id=36 In your database, I assume you've some sort of PK or other unique identifier, so use that as an ID for each video. On the dynamic page just create a link pointing to the video id. Care to share your code thus far? Shouldn't be too hard to fix you up. |
| |||
| Thanks a lot! As for now, I have a working code which does exactly what I want with the query and displaying. Now I'm working on two things: 1) Pagination control - it should be for this dynamic page content, not for different html pages. 2) Search bar and several (independent) dropdowns to do query for archives (all media archives by months), preacher, location, etc. Any ideas and suggestions? Here's the working code (in main file media.php), in case it helps someone and for suggestions: PHP Code: |
| |||
| First, don't ever, ever make a pop up window. They're terrible. Down right terrible. It'd be best to make a dynamic play page for instance just use a GET request with the id of the entry, then on the player page, if(isset($_GET['var'])) { //query the database for the video with the id given via GET and print out all the information } else { // return it back to the media listing page header("Location: /mediapage"); } |
| |||
| Don't know what kind of experience you have with jQuery or Javascript, but jQuery could appear to handle everything on the same page, while sending requests and stuff via ajax. Makes for a smoother, seemingly faster experience if you can pull it off well.
__________________ Josh Guerette Producer - Bethel Sarnia |