Search Webmaster Help and Solution

Opening a file from your computer with PHP.

How would you open and read a php file that is in your hard drive and use it inside a php script that is run on a server.

Example:

security.php - file located on the server would have something like this

PHP Code: include (file://C:/folder/file.key);   // the bad part is it does not want to open the file using this method.

if ($key == open me){
//execute this---
} else {
exit;




file.key - file located on the hard drive in the C:/folder/ folder would have something like this.
PHP Code: <?php
$key = open me;
?>

Thanks,
Haris How would you open and read a php file that is in your hard drive and use it inside a php script that is run on a server.

Example:

security.php - file located on the server would have something like this

PHP Code: include (file://C:/folder/file.key);   // the bad part is it does not want to open the file using this method.

if ($key == open me){
//execute this---
} else {
exit;




file.key - file located on the hard drive in the C:/folder/ folder would have something like this.
PHP Code: <?php
$key = open me;
?>

Thanks,
Haris

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).