This is a discussion on "Problem phrasing the question." within the PHP Forum section. This forum, and the thread "Problem phrasing the question. are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Problem phrasing the question.
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
I can usually fix computer problems myself using manuals, Google or searching forums. But for this problem I'm not sure where to look, or of the terminology to even phrase the question - or even if I'm in the right forum.
I'm a home user leaning LAMP so I can eventually brighten up my web site. I've been doing an exercise in PHP The code generates the page OK ( a table filled with links to playlists of my music ) but when I click the links nothing happens. If I copy the code of the page from the browser and save it as a HTML it all works OK. The playback program (WinAmp in this case) runs with the correct playlist loaded and plays the tracks. Now I'm sure this is a security related question of some type in that Apache or PHP is stopping the generated web page from executing the program and there's some way to authorize it. Should I be looking into the httpd file, php.ini, .htaccess or somewhere else? Apache and PHP are running on the same machine that holds the music files. |
|
|
|
#2
|
|||
|
|||
|
Re: Problem phrasing the question.
First of all, it would be really helpful to see the code.
Where are you saving that html file to? And when you open it in a browser (and the links work), are you simply opening it as an html file within your directory structure? Or are you saving it within httpdocs and opening it as a http://localhost/yourpage.html? Also, where are the playlist files saved and how exactly are you referencing them in your links? My guess is that there's a path issue. If you're saving the html file to the same directory as the php file and accessing it via http via your local host apache server, there's no reason for it to behave any differently as an html file vice a php file. |
|
#3
|
|||
|
|||
|
Re: Problem phrasing the question.
You've helped narrow down the problem already. I hadn't thought of making Apache serve the .htm file. If I put in the browser 'file:///D:/WebDev/Apache/htdocs/local/test.htm' the music links work OK, if I put http://localhost/local/test.htm they don't. That proves the problem is Apache's not something in php. Thanks. Ahh, but how to fix it?...
The playlists and the music files are on my NAS device. The script goes to the playlist directory, lists all the files and sets them up in a table with html links to them. But I have copied one playlist and the directory for that playlists' songs into my D:/WebDev/Apache/htdocs/local/ directory and that doesn't work either. I've included the full code below... Quote:
Quote:
|
|
#4
|
|||
|
|||
|
Re: Problem phrasing the question.
I wouldn't necessarily call that an apache problem, per se. It's more an issue of making sure that file system objects (outside Apache's httpdocs structure) are accessible from a web page. If you create a subdirectory "mysongs" in the directory where your php file exists, then edit the .m3u file to use relative paths ("mysongs/song1.mp3" etc.) then use <a href="test.m3u">play test playlist</a> - I think you'll find it will work fine. Getting apache to look at file:///d:/whatever is tricky. (It's been a while since I've tried this.)
Does your NAS have a webserver on it? |
|
#5
|
|||
|
|||
|
Re: Problem phrasing the question.
Maybe this will help- it's a page from a site I'm currently working on...
http://stickpuppy.com/dhs57/yearinreview.php View the source on that page to get a feel for what it takes to play an m3u file. (NOTE: you don't need to do things like <a href="file:///c:/program%20files/winamp.exe">Pink</a> You should just post the links to the m3u files and let your browser handle the app used to play them. (Configure your browser as necessary if Winamp isn't currently the app associated with m3u files.) Also right click on the jukebox on that page and save the .m3u file somewhere local and have a look at it. |
|
#6
|
|||
|
|||
|
Re: Problem phrasing the question.
OK, thanks, I'll have a look tomorrow. It's getting a little late here now to engage the brain.
|
|
#7
|
|||
|
|||
|
Re: Problem phrasing the question.
The .m3u files already use relative addressing - as I found out when I moved them
Putting in "echo '<a href="Pink.m3u">Pink</a></font></p>';" did invoke the WinAmp player but it just cycled through the playlist without playing anything. This is its action if it cannot find the songs. Putting in "echo '<a href="01 Stupid Girls.flac">Pink</a></font></p>';" generates an 'Opening' box so I can 'open With' WinAmp or save to disk. If I open with WinAmp it plays this single song OK. I looked at your playlist and thought I'd replicate the format as it uses web paths to the songs rather than relative addressing. This format also cycled through the playlist without playing. I think I do have a problem with my Apache set up that is not allowing 'secondary' running of files or programs for legitimate security purposes. I'm going to post on an Apache forum and ask for clues there, but if you or anyone else here come up with ideas to try I'd like to hear them. And yes, my NAS does have a webserver on it, but I'm choosing not to use it as I'm trying to learn stuff on the PC. Also the instructions for getting it working are non-existant. |
|
#8
|
|||
|
|||
|
Re: Problem phrasing the question.
A quick update. I now know how to phrase the question. How to you stream flac files from Apache? When I tested WAV files the playlists worked OK. It's just flac's that wont stream. It looks like a config problem in Apache but someone in this web forum may well have come across the problem.
|
![]() |
| Tags |
| external programs |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image Problem in HTML-newb question | partyon | Web Page Design | 2 | Jun 6th, 2008 00:18 |
| First image problem and inline list problem | konnor5092 | Web Page Design | 8 | Dec 1st, 2007 09:08 |
| Javascript problem/question | kb3llm129 | JavaScript Forum | 0 | May 6th, 2006 22:03 |
| Question | JacobHaug | Web Page Design | 1 | Dec 26th, 2005 00:57 |
| <body> question/problem..... | Jaken Veina | Web Page Design | 4 | Aug 11th, 2005 16:07 |