Hi. I’m not sure where to put this, PHP Help & Troubleshooting seemed appropriate.
I’m creating a fairly simple file uploader for some experience, and everything is working quite well. Currently I’m attempting to embed .swf files with SwfObject.
Basically what my code does is upload the file, and then the URL becomes example.com/view.php?id=12345678 – 12345678 being the file name of course. Then, view.php grabs the ID with GET, and echoes it out as the URL to embed into the page.
This works perfectly!
However, what I think would add a really nice touch is prettying up the URL a bit. For instance:
I messed around with some stuff and ended up with this:
Now, if I go to example.com/view/12345678 it looks absolutely fine, and if I view source it’s identical to my ?id version.
Of course this is where my troubles reside. Everything should work fine, the path to the file is fine, the swf dimensions are fine, everything should work.
For some reason, it won’t show the .swf file. The alternate content appears instead (Please install your flash player etc) and I’m r8 lost m8
Any clues? Sorry if this is a bit vague, more code can be provided.
A good thing to do is to start relative paths with a slash.
ie. in your 12345678-file where it says src="path/to/myThing.swf" src="/path/to/myThing.swf" that way it’ll start "counting" from the root of your site and not from the non-existing /view. Or wherever you happen to be.