Menu
I’m trying to run PHP script that is outside the document root for security
reasons but it’s not working. Document root is /var/www/html. Application will be in /var/www/app directory.
What should I do to javascript part to access foo.php?
Thanks.
index.html :
[code=php]
<?php
session_cache_limiter(‘private’);
session_start();
?>
<html>
<?php
echo ‘<input id=”button” type=button name=”do” value=”Click here” onclick=”do_foo()”>’;
?>
</html>
<script type=”text/javascript”>
function do_foo()
{
window.location.href = “../app/foo.php”;
}
</script>
In /var/www/app/foo.php :
[code=php]
<?php
echo “<h3>I’m here!</h3>”;
?>