943,948 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 733
  • PHP RSS
Nov 27th, 2008
0

PHP Issue

Expand Post »
Hi

I am trying to open the explorer window using php code .But i got the security issue .Please help me how to solve the issue.

PHP Syntax (Toggle Plain Text)
  1. <a href="file:///opt" target="_blank">adas</a>

I got this error message Please help me how to fix the issue

Security Error: Content at http://localhost/test.php may not load or link to file:///opt.
Last edited by peter_budo; Nov 27th, 2008 at 7:40 pm. Reason: Correcting [code] for correct display
Similar Threads
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006
Nov 27th, 2008
0

Re: PHP Issue

It is because you are using the "file" protocole. When managing documents with php, use a relative path which does not breach apachies web root settings. So if your script is in the directory "C:/xampp/htdocs/example/test/index.php" and you want to unlink/delete a file in the web root directory then you would use the string "../../file.php" but with xampp for example, you can't delete anything above the htdocs folder as that is the web root. So try and use relative paths that do not breach the web root.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Nov 27th, 2008
0

Re: PHP Issue

Hi

Thanks for your reply.

I need just open the given path using php . No need for edit or delete the file.

Please advise.
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006
Nov 27th, 2008
0

Re: PHP Issue

I have just done a few tests and it looks like you need to use the http protocole and not the file protocole under the windows operating system due to some windows security feature. I tried both php and javascript to access a file under the file protocole and the error as you mentioned occured. So try locating the file from an address like:
http://domain.com/folder/file.doc
-or via ip-
http://184.294.495.304/folder/file.doc
If you choose to use the ip method you will need apachie installed and the web directory setup. Also you will only be able to access through the http protocole what is theoretically online although the files can be hidden from other users via htaccess. Other than that, I would suggest using a more dedicated client side language such as Java to do the job.
Sponsor
Featured Poster
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
cwarn23 is offline Offline
3,004 posts
since Sep 2007
Nov 27th, 2008
0

Re: PHP Issue

Thanks For your clarification .

Thanks you so much

bye now

vssp
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Problem in sending mail
Next Thread in PHP Forum Timeline: need put banner to my account table on PTC site





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC