Reading a Flash file located outside the Site Root
Moderator: General Moderators
Reading a Flash file located outside the Site Root
Hello,
Trying to learn PHP and add it to my site, but running into some difficulties. I am trying to protect some files by placing them outside of the root directory. I want my home page, home/myname/public_html/index.php, to include a Flash file located in home/enddatas/files. I have tried to include the file, but I just get an error saying home/myname/public_html/home/enddatas/files/file.swf doesn't exist.
If anyone can help out, it would be much appreciated.
Thanks.
Trying to learn PHP and add it to my site, but running into some difficulties. I am trying to protect some files by placing them outside of the root directory. I want my home page, home/myname/public_html/index.php, to include a Flash file located in home/enddatas/files. I have tried to include the file, but I just get an error saying home/myname/public_html/home/enddatas/files/file.swf doesn't exist.
If anyone can help out, it would be much appreciated.
Thanks.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Reading a Flash file located outside the Site Root
You're missing the leading forward slash.spaceman wrote:Hello,
Trying to learn PHP and add it to my site, but running into some difficulties. I am trying to protect some files by placing them outside of the root directory. I want my home page, home/myname/public_html/index.php, to include a Flash file located in home/enddatas/files. I have tried to include the file, but I just get an error saying home/myname/public_html/home/enddatas/files/file.swf doesn't exist.
If anyone can help out, it would be much appreciated.
Thanks.
/home/enddatas/files/file.swf
Linux starts at / for the root don't forget
/home is not likely to be on root I would of thought.
run this: To see what the current relation to root is.
As for running flash inside the PHP engine.. doubt that would work.
run this:
Code: Select all
<?php
echo realpath('.');
?>As for running flash inside the PHP engine.. doubt that would work.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Great, I believe that fixed the include issue. I was missing a folder in the directory path. Thanks.
When I run the page now, I get this error:
Warning: Unexpected character in input: '' (ASCII=30) state=1 in /home/enddatas/files/HomePageShow.swf on line 146
Parse error: parse error, unexpected T_STRING in /home/enddatas/files/HomePageShow.swf on line 146
I believe the engine is having issues with the file, as you stated. If it can't be run this way, how would it be possible to hide files like this from users wanting to download it?
Thanks.
When I run the page now, I get this error:
Warning: Unexpected character in input: '' (ASCII=30) state=1 in /home/enddatas/files/HomePageShow.swf on line 146
Parse error: parse error, unexpected T_STRING in /home/enddatas/files/HomePageShow.swf on line 146
I believe the engine is having issues with the file, as you stated. If it can't be run this way, how would it be possible to hide files like this from users wanting to download it?
Thanks.